[LON-CAPA-cvs] cvs: loncom /homework grades.pm

albertel lon-capa-cvs-allow@mail.lon-capa.org
Thu, 08 Nov 2007 19:57:35 -0000


albertel		Thu Nov  8 14:57:35 2007 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - data table the receipt verification screen
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.485 loncom/homework/grades.pm:1.486
--- loncom/homework/grades.pm:1.485	Wed Nov  7 20:48:18 2007
+++ loncom/homework/grades.pm	Thu Nov  8 14:57:30 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.485 2007/11/08 01:48:18 albertel Exp $
+# $Id: grades.pm,v 1.486 2007/11/08 19:57:30 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -745,6 +745,19 @@
 	$env{"course.$courseid.receiptalg"} eq 'receipt3') { $receiptparts=1; }
     my $parts=['0'];
     if ($receiptparts) { ($parts)=&response_type($symb); }
+    
+    my $header = 
+	&Apache::loncommon::start_data_table().
+	&Apache::loncommon::start_data_table_header_row().
+	'<th>&nbsp;Fullname&nbsp;</th>'."\n".
+	'<th>&nbsp;Username&nbsp;</th>'."\n".
+	'<th>&nbsp;Domain&nbsp;</th>';
+    if ($receiptparts) {
+	$header.='<th>&nbsp;Problem Part&nbsp;</th>';
+    }
+    $header.=
+	&Apache::loncommon::end_data_table_header_row();
+
     foreach (sort 
 	     {
 		 if (lc($$fullname{$a}) ne lc($$fullname{$b})) {
@@ -755,7 +768,9 @@
 	my ($uname,$udom)=split(/\:/);
 	foreach my $part (@$parts) {
 	    if ($receipt eq &Apache::lonnet::ireceipt($uname,$udom,$courseid,$symb,$part)) {
-		$contents.='<tr bgcolor="#ffffe6"><td>&nbsp;'."\n".
+		$contents.=
+		    &Apache::loncommon::start_data_table_row().
+		    '<td>&nbsp;'."\n".
 		    '<a href="javascript:viewOneStudent(\''.$uname.'\',\''.$udom.
 		    '\');" target="_self">'.$$fullname{$_}.'</a>&nbsp;</td>'."\n".
 		    '<td>&nbsp;'.$uname.'&nbsp;</td>'.
@@ -763,7 +778,8 @@
 		if ($receiptparts) {
 		    $contents.='<td>&nbsp;'.$part.'&nbsp;</td>';
 		}
-		$contents.='</tr>'."\n";
+		$contents.= 
+		    &Apache::loncommon::end_data_table_row()."\n";
 		
 		$matches++;
 	    }
@@ -775,16 +791,9 @@
 	$string = &jscriptNform($symb).$title.
 	    'The above receipt matches the following student'.
 	    ($matches <= 1 ? '.' : 's.')."\n".
-	    '<table border="0"><tr><td bgcolor="#777777">'."\n".
-	    '<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>';
-	if ($receiptparts) {
-	    $string.='<td>&nbsp;Problem Part&nbsp;</td>';
-	}
-	$string.='</tr>'."\n".$contents.
-	    '</table></td></tr></table>'."\n";
+	    $header.
+	    $contents.
+	    &Apache::loncommon::end_data_table()."\n";
     }
     return $string.&show_grading_menu_form($symb);
 }