--- loncom/homework/grades.pm 2017/11/01 03:27:19 1.596.2.12.2.41.2.1
+++ loncom/homework/grades.pm 2018/04/29 15:29:05 1.596.2.12.2.41.2.2
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.596.2.12.2.41.2.1 2017/11/01 03:27:19 raeburn Exp $
+# $Id: grades.pm,v 1.596.2.12.2.41.2.2 2018/04/29 15:29:05 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -4177,6 +4177,7 @@ sub editgrades {
$ctr++;
}
my (undef,undef,$url) = &Apache::lonnet::decode_symb($symb);
+ my $totcolspan = 0;
foreach my $partid (@partid) {
$header .= '
'.&mt('Old Score').' | '.
''.&mt('New Score').' | ';
@@ -4193,6 +4194,7 @@ sub editgrades {
''.&mt('New').' '.$display.' | ';
$columns{$partid}+=2;
}
+ $totcolspan += $columns{$partid};
}
foreach my $partid (@partid) {
my $display_part=&get_display_part($partid,$symb);
@@ -4208,20 +4210,20 @@ sub editgrades {
my @noupdate;
my ($updateCtr,$noupdateCtr) = (1,1);
for ($i=0; $i<$env{'form.total'}; $i++) {
- my $line;
my $user = $env{'form.ctr'.$i};
my ($uname,$udom)=split(/:/,$user);
my %newrecord;
my $updateflag = 0;
- $line .= ''.&nameUserString(undef,$$fullname{$user},$uname,$udom).' | ';
my $usec=$classlist->{"$uname:$udom"}[5];
- if (!&canmodify($usec)) {
- my $numcols=scalar(@partid)*4+2;
- push(@noupdate,
- $line."".
- &mt('Not allowed to modify student')." | ");
- next;
- }
+ my $canmodify = &canmodify($usec);
+ my $line = ''.
+ &nameUserString(undef,$$fullname{$user},$uname,$udom).' | ';
+ if (!$canmodify) {
+ push(@noupdate,
+ $line."".
+ &mt('Not allowed to modify student')." | ");
+ next;
+ }
my %aggregate = ();
my $aggregateflag = 0;
$user=~s/:/_/; # colon doen't work in javascript for names
@@ -4336,8 +4338,7 @@ sub editgrades {
}
}
if (@noupdate) {
-# my $numcols=(scalar(@partid)*(scalar(@parts)-1)*2)+3;
- my $numcols=scalar(@partid)*4+2;
+ my $numcols=$totcolspan+2;
$result .= &Apache::loncommon::start_data_table_row('LC_empty_row').
''.
&mt('No Changes Occurred For the Students Below').
|