--- 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>&nbsp;'."\n".
-		'<a href="javascript:viewOneStudent(\''.$uname.'\',\''.$udom.
-		'\')"; TARGET=_self>'.$$fullname{$_}.'</a>&nbsp;</td>'."\n".
-		'<td>&nbsp;'.$uname.'&nbsp;</td>'.
-		'<td>&nbsp;'.$udom.'&nbsp;</td></tr>'."\n";
-	    
-	    $matches++;
+	foreach my $part (@$parts) {
+	    if ($receipt eq &Apache::lonnet::ireceipt($uname,$udom,$courseid,$symb,$part)) {
+		$contents.='<tr bgcolor="#ffffe6"><td>&nbsp;'."\n".
+		    '<a href="javascript:viewOneStudent(\''.$uname.'\',\''.$udom.
+		    '\')"; TARGET=_self>'.$$fullname{$_}.'</a>&nbsp;</td>'."\n".
+		    '<td>&nbsp;'.$uname.'&nbsp;</td>'.
+		    '<td>&nbsp;'.$udom.'&nbsp;</td>';
+		if ($receiptparts) {
+		    $contents.='<td>&nbsp;'.$part.'&nbsp;</td>';
+		}
+		$contents.='</tr>'."\n";
+		
+		$matches++;
+	    }
 	}
     }
     if ($matches == 0) {
@@ -550,8 +560,11 @@ sub verifyreceipt {
 	    '<table border="0"><tr bgcolor="#e6ffff">'."\n".
 	    '<td><b>&nbsp;Fullname&nbsp;</b></td>'."\n".
 	    '<td><b>&nbsp;Username&nbsp;</b></td>'."\n".
-	    '<td><b>&nbsp;Domain&nbsp;</b></td></tr>'."\n".
-	    $contents.
+	    '<td><b>&nbsp;Domain&nbsp;</b></td>';
+	if ($receiptparts) {
+	    $string.='<td>&nbsp;Problem Part&nbsp;</td>';
+	}
+	$string.='</tr>'."\n".$contents.
 	    '</table></td></tr></table>'."\n";
     }
     return $string.&show_grading_menu_form($symb,$url);