--- loncom/homework/grades.pm 2017/12/21 23:05:04 1.746 +++ loncom/homework/grades.pm 2017/12/31 13:29:53 1.748 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.746 2017/12/21 23:05:04 raeburn Exp $ +# $Id: grades.pm,v 1.748 2017/12/31 13:29:53 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -856,7 +856,7 @@ sub verifyreceipt { sub listStudents { my ($request,$symb,$submitonly) = @_; - my $is_tool = ($symb =~ /ext\.tool$/); + my $is_tool = ($symb =~ /ext\.tool$/); my $cdom = $env{"course.$env{'request.course.id'}.domain"}; my $cnum = $env{"course.$env{'request.course.id'}.num"}; my $getsec = $env{'form.section'} eq '' ? 'all' : $env{'form.section'}; @@ -2635,7 +2635,7 @@ sub get_last_submission { if (!@string) { my $msg; if ($is_tool) { - $msg = &mt('Nothing passed back - no attempts.'); + $msg = &mt('No grade passed back.'); } else { $msg = &mt('Nothing submitted - no attempts.'); } @@ -4090,6 +4090,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').''; @@ -4106,6 +4107,7 @@ sub editgrades { ''.&mt('New').' '.$display.''; $columns{$partid}+=2; } + $totcolspan += $columns{$partid}; } foreach my $partid (@partid) { my $display_part=&get_display_part($partid,$symb); @@ -4121,18 +4123,18 @@ 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; + my $canmodify = &canmodify($usec); + my $line = ''. + &nameUserString(undef,$$fullname{$user},$uname,$udom).''; + if (!$canmodify) { push(@noupdate, - $line."". - &mt('Not allowed to modify student').""); + $line."". + &mt('Not allowed to modify student').""); next; } my %aggregate = (); @@ -4249,8 +4251,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'). @@ -5110,6 +5111,7 @@ sub displaySubByDates { my ($symb,$record,$parts,$responseType,$checkIcon,$uname,$udom) = @_; my $isCODE=0; my $isTask = ($symb =~/\.task$/); + my $is_tool = ($symb =~/\.tool$/); if (exists($record->{'resource.CODE'})) { $isCODE=1; } my $studentTable=&Apache::loncommon::start_data_table(). &Apache::loncommon::start_data_table_header_row(). @@ -5124,7 +5126,11 @@ sub displaySubByDates { my %orders; $mark{'correct_by_student'} = $checkIcon; if (!exists($$record{'1:timestamp'})) { - return '
 '.&mt('Nothing submitted - no attempts.').'
'; + if ($is_tool) { + return '
 '.&mt('No grade passed back.').'
'; + } else { + return '
 '.&mt('Nothing submitted - no attempts.').'
'; + } } my $interaction;