--- loncom/interface/lonquickgrades.pm 2011/03/21 00:56:58 1.77
+++ loncom/interface/lonquickgrades.pm 2011/03/25 01:34:49 1.78
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Quick Student Grades Display
#
-# $Id: lonquickgrades.pm,v 1.77 2011/03/21 00:56:58 www Exp $
+# $Id: lonquickgrades.pm,v 1.78 2011/03/25 01:34:49 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -612,9 +612,10 @@ ENDMOVE
$r->print('
');
foreach my $calcrule (split(/\,/,$categories{$id.'_calculations'})) {
$r->print('- ');
- $r->print(&pretty_prt_rule($calcrule));
+ my ($code,$value)=split(/\:/,$calcrule);
+ $r->print(&pretty_prt_rule($cangrade,$id,$code,$value));
if ($cangrade) {
- $r->print(' '.&mt('Delete').'');
+ $r->print(' '.&mt('Delete').'');
}
$r->print('
');
}
@@ -690,8 +691,25 @@ sub make_new_category {
# === Calculation Rule Editing
sub pretty_prt_rule {
- my ($rule)=@_;
- return $rule;
+ my ($cangrade,$id,$code,$value)=@_;
+ my $cid=$id.'_'.$code;
+ my %lt=&Apache::lonlocal::texthash(
+ 'droplow' => 'Drop N lowest grade assignments',
+ 'drophigh' => 'Drop N highest grade assignments',
+ 'capabove' => 'Cap percentage above N percent',
+ 'capbelow' => 'Cap percentage below N percent');
+ my $ret='';
+ if ($cangrade) {
+ $ret.=' N=';
+ } else {
+ $ret.=$lt{$code}.'; N='.$value;
+ }
+ $ret.='';
+ return $ret;
}
sub new_calc_rule_form {
@@ -723,7 +741,7 @@ sub del_calculation_rule {
unless ($cangrade) { return %categories; }
my @newcontent=();
foreach my $current (split(/\,/,$categories{$id.'_calculations'})) {
- unless ($current eq $delcontent) {
+ unless ($current=~/^\Q$delcontent\E\:/) {
push(@newcontent,$current);
}
}
|