--- loncom/homework/grades.pm 2004/05/04 14:17:18 1.194 +++ loncom/homework/grades.pm 2004/09/24 21:09:52 1.204.2.5 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.194 2004/05/04 14:17:18 albertel Exp $ +# $Id: grades.pm,v 1.204.2.5 2004/09/24 21:09:52 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -167,6 +167,21 @@ sub response_type { return \@partlist,\%handgrade,\%responseType; } +sub get_display_part { + my ($partID,$url,$symb)=@_; + if (!defined($symb) || $symb eq '') { + $symb=$ENV{'form.symb'}; + if ($symb eq '') { $symb=&Apache::lonnet::symbread($url) } + } + my $display=&Apache::lonnet::EXT('resource.'.$partID.'.display',$symb); + &Apache::lonnet::logthis("\nsymb $symb\n url $url\npartID $partID\ndisplay $display \n"); + if (defined($display) and $display ne '') { + $display.= " (id $partID)"; + } else { + $display=$partID; + } + return $display; +} #--- Show resource title #--- and parts and response type sub showResourceInfo { @@ -194,7 +209,8 @@ sub showResourceInfo { } $partsseen{$partID}=1; } - $result.='
'. - 'Part '.$partid.' Points: | '."\n"; + 'Part: '.$display_part.' Points: | '."\n"; my $ctr = 0; $result.=' | Prob. | '. ''.($ENV{'form.vProb'} eq 'no' ? 'Title' : 'Problem Text').'/Grade |
'.$question. + $studentTable.=' | ||||
'.$prob.
(scalar(@{$parts}) == 1 ? '' : ' ('.scalar(@{$parts}).' parts)').' | ';
$studentTable.=''; if ($ENV{'form.vProb'} eq 'yes' ) { @@ -3169,6 +3197,7 @@ sub displayPage { $studentTable.=''."\n"; $question++; } + $prob++; } $studentTable.=' | |||
'.$question. + $studentTable.=' | ||||
'.$prob.
(scalar(@{$parts}) == 1 ? '' : ' ('.scalar(@{$parts}).' parts)').' | ';
$studentTable.=''.$title.' | '; @@ -3337,12 +3368,13 @@ sub updateGradeByPage { $changeflag++; $newpts = ''; } - + my $display_part=&get_display_part($partid,undef, + $curRes->symb()); my $oldstatus = $ENV{'form.solved'.$question.'_'.$partid}; - $displayPts[0].=' Part '.$partid.' = '. + $displayPts[0].=' Part: '.$display_part.' = '. (($oldstatus eq 'excused') ? 'excused' : $oldpts). ''.$displayPts[1].' | '. '