--- loncom/homework/grades.pm 2010/04/01 02:28:27 1.574.2.10 +++ loncom/homework/grades.pm 2009/08/19 19:25:21 1.579 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.574.2.10 2010/04/01 02:28:27 raeburn Exp $ +# $Id: grades.pm,v 1.579 2009/08/19 19:25:21 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -97,15 +97,9 @@ sub ssi_print_error { # # --- Retrieve the parts from the metadata file.--- sub getpartlist { - my ($symb,$errorref) = @_; + my ($symb) = @_; my $navmap = Apache::lonnavmaps::navmap->new(); - unless (ref($navmap)) { - if (ref($errorref)) { - $$errorref = 'navmap'; - return; - } - } my $res = $navmap->getBySymb($symb); my $partlist = $res->parts(); my $url = $res->src(); @@ -150,15 +144,9 @@ sub nameUserString { #--- Get the partlist and the response type for a given problem. --- #--- Indicate if a response type is coded handgraded or not. --- sub response_type { - my ($symb,$response_error) = @_; + my ($symb) = shift; my $navmap = Apache::lonnavmaps::navmap->new(); - unless (ref($navmap)) { - if (ref($response_error)) { - $$response_error = 1; - } - return; - } my $res = $navmap->getBySymb($symb); my $partlist = $res->parts(); my %vPart = @@ -195,7 +183,8 @@ sub get_display_part { my ($partID,$symb)=@_; my $display=&Apache::lonnet::EXT('resource.'.$partID.'.display',$symb); if (defined($display) and $display ne '') { - $display.= " (id $partID)"; + $display.= ' (' + .&mt('Part ID: [_1]',$partID).')'; } else { $display=$partID; } @@ -205,17 +194,12 @@ sub get_display_part { #--- Show resource title #--- and parts and response type sub showResourceInfo { - my ($symb,$probTitle,$checkboxes,$res_error) = @_; + my ($symb,$probTitle,$checkboxes) = @_; my $col=3; if ($checkboxes) { $col=4; } my $result = '
'.&mt('Part').': '.$display_part. + $result.=' | '.&mt('Part: [_1]',$display_part).''. ' '.$resID.' | '. - ''.&mt('Type').': '.$responsetype.' | '; + ''.&mt('Type: [_1]',$responsetype).' | '; # ''.&mt('Handgrade: [_1]',$handgrade).' | '; } } @@ -771,7 +755,7 @@ sub verifyreceipt { my $title.= 'Part: | [_1] | Points: | [_2] | or | [_3] | ',$display_part,$radio,$line); $result .= - ''.&mt('Part').': | '.$display_part.' | '.&mt('Points').': | '.$radio.' | '.&mt('or').' | '.$line.' | '; + ''.&mt('Part:').' | '.$display_part.' | '.&mt('Points:').' | '.$radio.' | '.&mt('or').' | '.$line.' | '. + $result.='