version 1.53, 2010/12/03 15:19:09
|
version 1.64, 2011/01/21 16:28:32
|
Line 61 sub real_handler {
|
Line 61 sub real_handler {
|
&Apache::loncommon::no_cache($r); |
&Apache::loncommon::no_cache($r); |
$r->send_http_header; |
$r->send_http_header; |
|
|
my $showPoints = |
my $showPoints = |
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'standard'; |
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'standard'; |
my $notshowSPRSlink = |
my $notshowSPRSlink = |
(($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'external') |
(($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'external') |
|| ($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals')); |
|| ($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals')); |
my $notshowTotals= |
my $notshowTotals= |
Line 72 sub real_handler {
|
Line 72 sub real_handler {
|
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'categories'; |
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'categories'; |
|
|
|
|
# Header |
|
my $title = "Grading and Statistics";#$showPoints ? "Points Display" : "Completed Problems Display"; |
my $title = "Grading and Statistics";#$showPoints ? "Points Display" : "Completed Problems Display"; |
my $brcrum = [{href=>"/adm/quickgrades",text => "Points Display"}]; |
my $brcrum = [{href=>"/adm/quickgrades",text => "Points Display"}]; |
$r->print(&Apache::loncommon::start_page($title,undef, |
$r->print(&Apache::loncommon::start_page($title,undef, |
{'bread_crumbs' => $brcrum}) |
{'bread_crumbs' => $brcrum}) |
); |
); |
|
|
$r->print(&Apache::lonhtmlcommon::coursepreflink(&mt('Grade display settings'),'grading')); |
&startGradeScreen($r,'quick'); |
|
|
if (!$showPoints && !$notshowSPRSlink ) { |
|
$r->print('<p>' |
|
.&mt('This screen shows how many problems (or problem parts) you have completed' |
|
.', and how many you have not yet done.' |
|
.' You can also look at [_1]a detailed score sheet[_2].' |
|
,'<a href="/adm/studentcalc">','</a>') |
|
.'</p>'); |
|
} |
|
|
|
$r->print('<p class="LC_info">'.&mt('This may take a few moments to display.').'</p>'); |
|
|
|
$r->rflush(); |
$r->rflush(); |
|
|
my $uname='korte'; |
# my $uname='korte'; |
my $udom='gerd'; |
# my $udom='gerd'; |
|
|
|
my $uname; |
|
my $udom; |
|
|
my ($navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted)= |
my ($navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted)= |
&getData($showPoints,$uname,$udom); |
&getData($showPoints,$uname,$udom); |
Line 107 sub real_handler {
|
Line 98 sub real_handler {
|
&outputTable($r,$showPoints,$notshowTotals, |
&outputTable($r,$showPoints,$notshowTotals, |
$navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted); |
$navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted); |
} |
} |
|
&endGradeScreen($r); |
return OK; |
return OK; |
|
|
} |
} |
|
|
|
sub startGradeScreen { |
|
my ($r,$mode)=@_; |
|
|
|
my $showPoints = |
|
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'standard'; |
|
my $notshowSPRSlink = |
|
(($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'external') |
|
|| ($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals') |
|
|| ($env{'course.'.$env{'request.course.id'}.'.grading'} eq 'categories')); |
|
my $notshowTotals= |
|
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'externalnototals'; |
|
my $showCategories= |
|
$env{'course.'.$env{'request.course.id'}.'.grading'} eq 'categories'; |
|
|
|
my $allowed_to_view = &Apache::lonnet::allowed('vgr',$env{'request.course.id'}); |
|
my $allowed_to_edit = &Apache::lonnet::allowed('mgr',$env{'request.course.id'}); |
|
|
|
if ($allowed_to_view) { |
|
my @notes; |
|
push(@notes,&mt('Students do not see total points.')) if ($notshowTotals); |
|
push(@notes,&mt('Students do not see link to spreadsheet.')) if ($notshowSPRSlink); |
|
push(@notes,&mt('Students will see points based on problem weights.')) if ($showPoints); |
|
push(@notes,&mt('Students will see points based on categories.')) if ($showCategories); |
|
push(@notes, &Apache::lonhtmlcommon::coursepreflink(&mt('Grade display settings'),'grading')); |
|
$r->print(&Apache::loncommon::head_subbox(join(' ',@notes))); |
|
} |
|
|
|
|
|
$r->print("\n".'<ul class="LC_TabContentBigger" id="main">'); |
|
$r->print("\n".'<li'.($mode eq 'quick'?' class="active"':'').'><a href="/adm/quickgrades"><b> '. |
|
($showPoints?&mt('Individual Points Overview'):($showCategories?&mt('Grades Overview'):&mt('Completion Overview'))). |
|
' </b></a></li>'); |
|
|
|
if (!($showPoints || $notshowSPRSlink) || ($allowed_to_view)) { |
|
$r->print("\n".'<li'.($mode eq 'spreadsheet'?' class="active"':'').'><a href="/adm/'.($allowed_to_view?'classcalc':'studentcalc').'"><b>'. |
|
&mt('Spreadsheet (Detailed)').'</b></a></li>'); |
|
} |
|
if ($allowed_to_view) { |
|
$r->print("\n".'<li'.($mode eq 'statistics'?' class="active"':'').'><a href="/adm/statistics"><b>'. |
|
&mt('Statistics and Reports').'</b></a></li>'); |
|
|
|
$r->print("\n".'<li'.($mode eq 'chart'?' class="active"':'').'><a href="/adm/statistics?reportSelected=student_assessment"><b>'. |
|
&mt('Assessment Overview Chart').'</b></a></li>'); |
|
|
|
} |
|
if ($allowed_to_edit) { |
|
$r->print("\n".'<li'.($mode eq 'grading'?' class="active"':'').'><a href="/adm/grades"><b> '. |
|
&mt('Problem Grading').' </b></a></li>'); |
|
} |
|
$r->print("\n".'</ul>'."\n"); |
|
$r->print('<div class="LC_Box" style="clear:both;margin:0;"><div id="maincoursedoc" style="margin:0 0;padding:0 0;"><div class="LC_ContentBox" id="mainCourseDocuments" style="display: block;">'); |
|
} |
|
|
|
sub endGradeScreen { |
|
my ($r)=@_; |
|
$r->print('</div></div></div>'); |
|
} |
|
|
|
|
sub getData { |
sub getData { |
|
|
my ($showPoints,$uname,$udom)=@_; |
my ($showPoints,$uname,$udom)=@_; |
Line 355 sub outputCategories {
|
Line 406 sub outputCategories {
|
|
|
my ($r,$showPoints,$notshowTotals, |
my ($r,$showPoints,$notshowTotals, |
$navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted)=@_; |
$navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted)=@_; |
|
# Take care of storing and retrieving categories |
|
|
|
my $cangrade=&Apache::lonnet::allowed('mgr'); |
|
|
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my %categories=(); |
|
# Storing |
|
if (($cangrade) && ($env{'form.storechanges'})) { |
|
|
|
# Actually store |
|
&Apache::lonnet::put('grading_categories',\%categories,$cdom,$cnum); |
|
} else { |
|
# Loading |
|
%categories=&Apache::lonnet::dump('grading_categories',$cdom,$cnum); |
|
} |
|
# categories loaded now |
|
# Form only generated if user can change the grading categories |
|
if ($cangrade) { |
|
$r->print('<form method="post">'); |
|
} |
|
# |
|
# Business logic here |
|
# |
|
if ($cangrade) { |
|
$r->print('<input type="submit" name="storechanges" value="'.&mt("Save changes to grading categories").'" /></form>'); |
|
} |
} |
} |
|
|
# Pass this two refs to arrays for the start and end color, and a number |
# Pass this two refs to arrays for the start and end color, and a number |