version 1.56, 2010/12/03 22:00:28
|
version 1.64, 2011/01/21 16:28:32
|
Line 121 sub startGradeScreen {
|
Line 121 sub startGradeScreen {
|
my $allowed_to_edit = &Apache::lonnet::allowed('mgr',$env{'request.course.id'}); |
my $allowed_to_edit = &Apache::lonnet::allowed('mgr',$env{'request.course.id'}); |
|
|
if ($allowed_to_view) { |
if ($allowed_to_view) { |
$r->print('<div id="LC_head_subbox">'); |
my @notes; |
if ($notshowTotals) { $r->print (' '.&mt('Students do not see total points.').' '); } |
push(@notes,&mt('Students do not see total points.')) if ($notshowTotals); |
if ($notshowSPRSlink){ $r->print (' '.&mt('Students do not see link to spreadsheet.').' '); } |
push(@notes,&mt('Students do not see link to spreadsheet.')) if ($notshowSPRSlink); |
if ($showPoints) { $r->print (' '.&mt('Students will see points based on problem weights.').' '); } |
push(@notes,&mt('Students will see points based on problem weights.')) if ($showPoints); |
if ($showCategories) { $r->print (' '.&mt('Students will see points based on categories.').' '); } |
push(@notes,&mt('Students will see points based on categories.')) if ($showCategories); |
$r->print(' '.&Apache::lonhtmlcommon::coursepreflink(&mt('Grade display settings'),'grading').'</div>'); |
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".'<ul class="LC_TabContentBigger" id="main">'); |
$r->print("\n".'<li'.($mode eq 'quick'?' class="active"':'').'><a href="/adm/quickgrades"><b>'. |
$r->print("\n".'<li'.($mode eq 'quick'?' class="active"':'').'><a href="/adm/quickgrades"><b> '. |
($showPoints?&mt('Points'):($showCategories?&mt('Grades'):&mt('Completion'))).'</b></a></li>'); |
($showPoints?&mt('Individual Points Overview'):($showCategories?&mt('Grades Overview'):&mt('Completion Overview'))). |
|
' </b></a></li>'); |
|
|
if (!($showPoints || $notshowSPRSlink) || ($allowed_to_view)) { |
if (!($showPoints || $notshowSPRSlink) || ($allowed_to_view)) { |
$r->print("\n".'<li'.($mode eq 'spreadsheet'?' class="active"':'').'><a href="/adm/'.($allowed_to_view?'classcalc':'studentcalc').'"><b>'. |
$r->print("\n".'<li'.($mode eq 'spreadsheet'?' class="active"':'').'><a href="/adm/'.($allowed_to_view?'classcalc':'studentcalc').'"><b>'. |
&mt('Spreadsheet').'</b></a></li>'); |
&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("\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;">'); |
$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;">'); |
Line 392 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 |