[LON-CAPA-cvs] cvs: loncom /homework grades.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Tue, 30 Aug 2005 14:52:52 -0000
albertel Tue Aug 30 10:52:52 2005 EDT
Modified files:
/loncom/homework grades.pm
Log:
- BUG#4291, username with underscores weren't working in 'Grade whole course or section'
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.280 loncom/homework/grades.pm:1.281
--- loncom/homework/grades.pm:1.280 Mon Aug 29 06:06:07 2005
+++ loncom/homework/grades.pm Tue Aug 30 10:52:51 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.280 2005/08/29 10:06:07 foxr Exp $
+# $Id: grades.pm,v 1.281 2005/08/30 14:52:51 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2656,7 +2656,6 @@
sub viewstudentgrade {
my ($url,$symb,$courseid,$student,$fullname,$parts,$weight,$ctr,$last_resets) = @_;
my ($uname,$udom) = split(/:/,$student);
- $student=~s/:/_/;
my %record=&Apache::lonnet::restore($symb,$courseid,$udom,$uname);
my %aggregates = ();
my $result='<tr bgcolor="#ffffdd"><td align="right">'.
@@ -2665,6 +2664,7 @@
'<a href="javascript:viewOneStudent(\''.$uname.'\',\''.$udom.
'\')"; TARGET=_self>'.$fullname.'</a> '.
'<font color="#999999">('.$uname.($env{'user.domain'} eq $udom ? '' : ':'.$udom).')</font></td>'."\n";
+ $student=~s/:/_/; # colon doen't work in javascript for names
foreach my $apart (@$parts) {
my ($part,$type) = &split_part_type($apart);
my $score=$record{"resource.$part.$type"};
@@ -2786,12 +2786,10 @@
for ($i=0; $i<$env{'form.total'}; $i++) {
my $line;
my $user = $env{'form.ctr'.$i};
- my $usercolon = $user;
- $usercolon =~s/_/:/;
- my ($uname,$udom)=split(/_/,$user);
+ my ($uname,$udom)=split(/:/,$user);
my %newrecord;
my $updateflag = 0;
- $line .= '<td>'.&nameUserString(undef,$$fullname{$usercolon},$uname,$udom).'</td>';
+ $line .= '<td>'.&nameUserString(undef,$$fullname{$user},$uname,$udom).'</td>';
my $usec=$classlist->{"$uname:$udom"}[5];
if (!&canmodify($usec)) {
my $numcols=scalar(@partid)*4+2;
@@ -2800,6 +2798,7 @@
}
my %aggregate = ();
my $aggregateflag = 0;
+ $user=~s/:/_/; # colon doen't work in javascript for names
foreach (@partid) {
my $old_aw = $env{'form.GD_'.$user.'_'.$_.'_awarded_s'};
my $old_part_pcr = $old_aw/($weight{$_} ne '0' ? $weight{$_}:1);