--- loncom/interface/lonquickgrades.pm 2011/05/24 18:06:10 1.90
+++ loncom/interface/lonquickgrades.pm 2011/05/24 23:44:33 1.91
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Quick Student Grades Display
#
-# $Id: lonquickgrades.pm,v 1.90 2011/05/24 18:06:10 www Exp $
+# $Id: lonquickgrades.pm,v 1.91 2011/05/24 23:44:33 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -646,11 +646,13 @@ ENDMOVE
# Content display and summing up of points
my $totalpossible=0;
my $totalcorrect=0;
+ my @individual=();
if ($output) { $r->print('
'); }
foreach my $contentid (split(/\,/,$categories{$id.'_content'})) {
my ($type,$possible,$attempted,$correct)=split(/\:/,$$performance{$contentid});
$totalpossible+=$possible;
$totalcorrect+=$correct;
+ if ($possible>0) { push(@individual,"$possible:$correct"); }
if ($output) {
$r->print('- ');
$r->print(&Apache::lonnet::gettitle($contentid).' ('.$correct.'/'.$possible.')');
@@ -695,6 +697,7 @@ ENDMOVE
# Calculation
+ my $actualtotal=$totalcorrect;
if ($output) { $r->print('
'); }
foreach my $calcrule (split(/\,/,$categories{$id.'_calculations'})) {
if ($output) { $r->print('- '); }
@@ -703,9 +706,26 @@ ENDMOVE
if ($cangrade) {
if ($output) { $r->print(' '.&mt('Delete').''); }
}
+ if ($code eq 'capabove') {
+ if ($totalpossible>0) {
+ if ($actualtotal/$totalpossible>$value/100.) {
+ $actualtotal=$totalpossible*$value/100.;
+ }
+ }
+ } elsif ($code eq 'capbelow') {
+ if ($totalpossible>0) {
+ if ($actualtotal/$totalpossible<$value/100.) {
+ $actualtotal=$totalpossible*$value/100.;
+ }
+ }
+ }
if ($output) { $r->print('
'); }
}
- if ($output) { $r->print(' '); }
+ if ($output) {
+ $r->print('');
+ $r->print(''.&mt('Calculated points: [_1]/[_2]',$actualtotal,$totalpossible).' ');
+ }
+
if ($cangrade) {
if ($output) { $r->print(' '.&new_calc_rule_form($id)); }
}
@@ -789,8 +809,10 @@ sub make_new_category {
sub category_rule_codes {
return &Apache::lonlocal::texthash(
- 'droplow' => 'Drop N lowest grade assignments',
- 'drophigh' => 'Drop N highest grade assignments',
+ 'droplowperc' => 'Drop N lowest grade percentage problems/folders',
+ 'drophighperc' => 'Drop N highest grade percentage problems/folderss',
+ 'droplow' => 'Drop N lowest point problems/folders',
+ 'drophigh' => 'Drop N highest point problems/folders',
'capabove' => 'Cap percentage above N percent',
'capbelow' => 'Cap percentage below N percent');
}
| |