--- loncom/homework/grades.pm 2004/03/19 04:20:24 1.183 +++ loncom/homework/grades.pm 2004/09/29 15:04:50 1.219 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.183 2004/03/19 04:20:24 albertel Exp $ +# $Id: grades.pm,v 1.219 2004/09/29 15:04:50 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -25,16 +25,6 @@ # # http://www.lon-capa.org/ # -# 2/9,2/13 Guy Albertelli -# 6/8 Gerd Kortemeyer -# 7/26 H.K. Ng -# 8/20 Gerd Kortemeyer -# Year 2002 -# June-August H.K. Ng -# Year 2003 -# February, March H.K. Ng -# July, H. K. Ng -# package Apache::grades; use strict; @@ -167,6 +157,20 @@ 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); + 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 +198,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 +3196,7 @@ sub displayPage { $studentTable.=''."\n"; $question++; } + $prob++; } $studentTable.=' | |||
'.$question. + $studentTable.=' | ||||
'.$prob.
(scalar(@{$parts}) == 1 ? '' : ' ('.scalar(@{$parts}).' parts)').' | ';
$studentTable.=''.$title.' | '; @@ -3337,12 +3367,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].' | '. '