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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Tue, 06 Nov 2007 19:19:54 -0000


albertel		Tue Nov  6 14:19:54 2007 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - data tabling the grade whole for 1 student path
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.483 loncom/homework/grades.pm:1.484
--- loncom/homework/grades.pm:1.483	Tue Nov  6 06:48:48 2007
+++ loncom/homework/grades.pm	Tue Nov  6 14:19:54 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.483 2007/11/06 11:48:48 foxr Exp $
+# $Id: grades.pm,v 1.484 2007/11/06 19:19:54 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4099,12 +4099,13 @@
     $request->print($result);
 
     my $studentTable.='&nbsp;<b>Select a student you wish to grade and then click on the Next button.</b><br />'.
-	'<table border="0"><tr><td bgcolor="#777777">'.
-	'<table border="0"><tr bgcolor="#e6ffff">'.
-	'<td align="right">&nbsp;<b>No.</b></td>'.
-	'<td>'.&nameUserString('header').'</td>'.
-	'<td align="right">&nbsp;<b>No.</b></td>'.
-	'<td>'.&nameUserString('header').'</td></tr>';
+	&Apache::loncommon::start_data_table().
+	&Apache::loncommon::start_data_table_header_row().
+	'<th align="right">&nbsp;No.</th>'.
+	'<th>'.&nameUserString('header').'</th>'.
+	'<th align="right">&nbsp;No.</th>'.
+	'<th>'.&nameUserString('header').'</th>'.
+	&Apache::loncommon::end_data_table_header_row();
  
     my (undef,undef,$fullname) = &getclasslist($getsec,'1');
     my $ptr = 1;
@@ -4116,15 +4117,21 @@
 			     return $a cmp $b;
 			 } (keys(%$fullname))) {
 	my ($uname,$udom) = split(/:/,$student);
-	$studentTable.=($ptr%2 == 1 ? '<tr bgcolor="#ffffe6">' : '</td>');
+	$studentTable.=($ptr%2==1 ? &Apache::loncommon::start_data_table_row()
+                                  : '</td>');
 	$studentTable.='<td align="right">'.$ptr.'&nbsp;</td>';
 	$studentTable.='<td>&nbsp;<label><input type="radio" name="student" value="'.$student.'" /> '
 	    .&nameUserString(undef,$$fullname{$student},$uname,$udom)."</label>\n";
-	$studentTable.=($ptr%2 == 0 ? '</td></tr>' : '');
+	$studentTable.=
+	    ($ptr%2 == 0 ? '</td>'.&Apache::loncommon::end_data_table_row() 
+                         : '');
 	$ptr++;
     }
-    $studentTable.='</td><td>&nbsp;</td><td>&nbsp;</td></tr>' if ($ptr%2 == 0);
-    $studentTable.='</table></td></tr></table>'."\n";
+    if ($ptr%2 == 0) {
+	$studentTable.='</td><td>&nbsp;</td><td>&nbsp;</td>'.
+	    &Apache::loncommon::end_data_table_row();
+    }
+    $studentTable.=&Apache::loncommon::end_data_table()."\n";
     $studentTable.='<input type="button" '.
 	'onClick="javascript:checkPickOne(this.form);"value="Next->" /></form>'."\n";
 
@@ -4224,10 +4231,11 @@
 
     $studentTable.='&nbsp;<b>Note:</b> Problems graded correct by the computer are marked with a '.$checkIcon.
 	' symbol.'."\n".
-	'<table border="0"><tr><td bgcolor="#777777">'.
-	'<table border="0"><tr bgcolor="#e6ffff">'.
-	'<td align="center"><b>&nbsp;Prob.&nbsp;</b></td>'.
-	'<td><b>&nbsp;'.($env{'form.vProb'} eq 'no' ? 'Title' : 'Problem Text').'/Grade</b></td></tr>';
+	&Apache::loncommon::start_data_table().
+	&Apache::loncommon::start_data_table_header_row().
+	'<th align="center">&nbsp;Prob.&nbsp;</th>'.
+	'<th>&nbsp;'.($env{'form.vProb'} eq 'no' ? 'Title' : 'Problem Text').'/Grade</th>'.
+	&Apache::loncommon::end_data_table_header_row();
 
     &Apache::lonxml::clear_problem_counter();
     my ($depth,$question,$prob) = (1,1,1);
@@ -4241,7 +4249,9 @@
 	    my $parts = $curRes->parts();
             my $title = $curRes->compTitle();
 	    my $symbx = $curRes->symb();
-	    $studentTable.='<tr bgcolor="#ffffe6"><td align="center" valign="top" >'.$prob.
+	    $studentTable.=
+		&Apache::loncommon::start_data_table_row().
+		'<td align="center" valign="top" >'.$prob.
 		(scalar(@{$parts}) == 1 ? '' : '<br />('.scalar(@{$parts}).'&nbsp;parts)').'</td>';
 	    $studentTable.='<td valign="top">';
 	    my %form = ('CODE' => $env{'form.CODE'},);
@@ -4449,12 +4459,14 @@
     my $iterator = $navmap->getIterator($map->map_start(),
 					$map->map_finish());
 
-    my $studentTable='<table border="0"><tr><td bgcolor="#777777">'.
-	'<table border="0"><tr bgcolor="#e6ffff">'.
-	'<td align="center"><b>&nbsp;Prob.&nbsp;</b></td>'.
-	'<td><b>&nbsp;Title&nbsp;</b></td>'.
-	'<td><b>&nbsp;Previous Score&nbsp;</b></td>'.
-	'<td><b>&nbsp;New Score&nbsp;</b></td></tr>';
+    my $studentTable=
+	&Apache::loncommon::start_data_table().
+	&Apache::loncommon::start_data_table_header_row().
+	'<th align="center">&nbsp;Prob.&nbsp;</th>'.
+	'<th>&nbsp;Title&nbsp;</th>'.
+	'<th>&nbsp;Previous Score&nbsp;</th>'.
+	'<th>&nbsp;New Score&nbsp;</th>'.
+	&Apache::loncommon::end_data_table_header_row();
 
     $iterator->next(); # skip the first BEGIN_MAP
     my $curRes = $iterator->next(); # for "current resource"
@@ -4467,7 +4479,9 @@
 	    my $parts = $curRes->parts();
             my $title = $curRes->compTitle();
 	    my $symbx = $curRes->symb();
-	    $studentTable.='<tr bgcolor="#ffffe6"><td align="center" valign="top" >'.$prob.
+	    $studentTable.=
+		&Apache::loncommon::start_data_table_row().
+		'<td align="center" valign="top" >'.$prob.
 		(scalar(@{$parts}) == 1 ? '' : '<br />('.scalar(@{$parts}).'&nbsp;parts)').'</td>';
 	    $studentTable.='<td valign="top">&nbsp;<b>'.$title.'</b>&nbsp;</td>';
 
@@ -4555,14 +4569,14 @@
 
 	    $studentTable.='<td valign="top">'.$displayPts[0].'</td>'.
 		'<td valign="top">'.$displayPts[1].'</td>'.
-		'</tr>';
+		&Apache::loncommon::end_data_table_row();
 
 	    $prob++;
 	}
         $curRes = $iterator->next();
     }
 
-    $studentTable.='</td></tr></table></td></tr></table>';
+    $studentTable.=&Apache::loncommon::end_data_table();
     $studentTable.=&show_grading_menu_form($env{'form.symb'});
     my $grademsg=($changeflag == 0 ? 'No score was changed or updated.' :
 		  'The scores were changed for '.