--- loncom/homework/grades.pm 2004/02/17 16:45:58 1.176 +++ loncom/homework/grades.pm 2004/02/24 23:22:24 1.177 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.176 2004/02/17 16:45:58 albertel Exp $ +# $Id: grades.pm,v 1.177 2004/02/24 23:22:24 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -526,18 +526,28 @@ sub verifyreceipt { my ($string,$contents,$matches) = ('','',0); my (undef,undef,$fullname) = &getclasslist('all','0'); - + + my $receiptparts=0; + if ($ENV{"course.$courseid.receiptalg"} eq 'receipt2') { $receiptparts=1; } + my $parts=['0']; + if ($receiptparts) { ($parts)=&response_type($url,$symb); } + $request->print("got Parts ".join(':',@$parts)); foreach (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) { my ($uname,$udom)=split(/\:/); - if ($receipt eq - &Apache::lonnet::ireceipt($uname,$udom,$courseid,$symb)) { - $contents.='<tr bgcolor="#ffffe6"><td> '."\n". - '<a href="javascript:viewOneStudent(\''.$uname.'\',\''.$udom. - '\')"; TARGET=_self>'.$$fullname{$_}.'</a> </td>'."\n". - '<td> '.$uname.' </td>'. - '<td> '.$udom.' </td></tr>'."\n"; - - $matches++; + foreach my $part (@$parts) { + if ($receipt eq &Apache::lonnet::ireceipt($uname,$udom,$courseid,$symb,$part)) { + $contents.='<tr bgcolor="#ffffe6"><td> '."\n". + '<a href="javascript:viewOneStudent(\''.$uname.'\',\''.$udom. + '\')"; TARGET=_self>'.$$fullname{$_}.'</a> </td>'."\n". + '<td> '.$uname.' </td>'. + '<td> '.$udom.' </td>'; + if ($receiptparts) { + $contents.='<td> '.$part.' </td>'; + } + $contents.='</tr>'."\n"; + + $matches++; + } } } if ($matches == 0) { @@ -550,8 +560,11 @@ sub verifyreceipt { '<table border="0"><tr bgcolor="#e6ffff">'."\n". '<td><b> Fullname </b></td>'."\n". '<td><b> Username </b></td>'."\n". - '<td><b> Domain </b></td></tr>'."\n". - $contents. + '<td><b> Domain </b></td>'; + if ($receiptparts) { + $string.='<td> Problem Part </td>'; + } + $string.='</tr>'."\n".$contents. '</table></td></tr></table>'."\n"; } return $string.&show_grading_menu_form($symb,$url);