version 1.54, 2010/12/03 15:21:35
|
version 1.57, 2010/12/03 22:23:21
|
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(); |
|
|
Line 110 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) { |
|
$r->print('<div id="LC_head_subbox">'); |
|
if ($notshowTotals) { $r->print (' '.&mt('Students do not see total points.').' '); } |
|
if ($notshowSPRSlink){ $r->print (' '.&mt('Students do not see link to spreadsheet.').' '); } |
|
if ($showPoints) { $r->print (' '.&mt('Students will see points based on problem weights.').' '); } |
|
if ($showCategories) { $r->print (' '.&mt('Students will see points based on categories.').' '); } |
|
$r->print(' '.&Apache::lonhtmlcommon::coursepreflink(&mt('Grade display settings'),'grading').'</div>'); |
|
} |
|
|
|
|
|
$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('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>'); |
|
} |
|
$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)=@_; |