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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 07 May 2004 15:09:13 -0000


albertel		Fri May  7 11:09:13 2004 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - BUG# 2984, make the Prob column actually be Prob number
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.195 loncom/homework/grades.pm:1.196
--- loncom/homework/grades.pm:1.195	Thu May  6 02:49:48 2004
+++ loncom/homework/grades.pm	Fri May  7 11:09:13 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.195 2004/05/06 06:49:48 albertel Exp $
+# $Id: grades.pm,v 1.196 2004/05/07 15:09:13 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3108,7 +3108,7 @@
 	'<td align="center"><b>&nbsp;Prob.&nbsp;</b></td>'.
 	'<td><b>&nbsp;'.($ENV{'form.vProb'} eq 'no' ? 'Title' : 'Problem Text').'/Grade</b></td></tr>';
 
-    my ($depth,$question) = (1,1);
+    my ($depth,$question,$prob) = (1,1,1);
     $iterator->next(); # skip the first BEGIN_MAP
     my $curRes = $iterator->next(); # for "current resource"
     while ($depth > 0) {
@@ -3119,7 +3119,7 @@
 	    my $parts = $curRes->parts();
             my $title = $curRes->compTitle();
 	    my $symbx = $curRes->symb();
-	    $studentTable.='<tr bgcolor="#ffffe6"><td align="center" valign="top" >'.$question.
+	    $studentTable.='<tr bgcolor="#ffffe6"><td align="center" valign="top" >'.$prob.
 		(scalar(@{$parts}) == 1 ? '' : '<br>('.scalar(@{$parts}).'&nbsp;parts)').'</td>';
 	    $studentTable.='<td valign="top">';
 	    if ($ENV{'form.vProb'} eq 'yes' ) {
@@ -3169,6 +3169,7 @@
 		    $studentTable.='<input type="hidden" name="q_'.$question.'" value="'.$partid.'" />'."\n";
 		    $question++;
 		}
+		$prob++;
 	    }
 	    $studentTable.='</td></tr>';
 
@@ -3295,7 +3296,7 @@
 
     $iterator->next(); # skip the first BEGIN_MAP
     my $curRes = $iterator->next(); # for "current resource"
-    my ($depth,$question,$changeflag)= (1,1,0);
+    my ($depth,$question,$prob,$changeflag)= (1,1,1,0);
     while ($depth > 0) {
         if($curRes == $iterator->BEGIN_MAP) { $depth++; }
         if($curRes == $iterator->END_MAP) { $depth--; }
@@ -3304,7 +3305,7 @@
 	    my $parts = $curRes->parts();
             my $title = $curRes->compTitle();
 	    my $symbx = $curRes->symb();
-	    $studentTable.='<tr bgcolor="#ffffe6"><td align="center" valign="top" >'.$question.
+	    $studentTable.='<tr bgcolor="#ffffe6"><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>';
 
@@ -3365,6 +3366,7 @@
 		'<td valign="top">'.$displayPts[1].'</td>'.
 		'</tr>';
 
+	    $prob++;
 	}
         $curRes = $iterator->next();
     }