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

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 18 Jun 2003 18:59:20 -0000


albertel		Wed Jun 18 14:59:20 2003 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - should no longer need the ctr, since we should now be properly keeping track of where we are
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.100 loncom/homework/grades.pm:1.101
--- loncom/homework/grades.pm:1.100	Wed Jun 18 13:37:46 2003
+++ loncom/homework/grades.pm	Wed Jun 18 14:59:20 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.100 2003/06/18 17:37:46 bowersj2 Exp $
+# $Id: grades.pm,v 1.101 2003/06/18 18:59:20 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2597,7 +2597,6 @@
 	    my $countProblems = 0;
 	    $mapiterator->next(); # skip the first BEGIN_MAP
 	    my $mapcurRes = $mapiterator->next(); # for "current resource"
-	    my $ctr=0;
 	    while ($mapdepth > 0) {
 		if($mapcurRes == $mapiterator->BEGIN_MAP) { $mapdepth++; }
 		if($mapcurRes == $mapiterator->END_MAP) { $mapdepth--; }
@@ -2668,10 +2667,10 @@
 	'<td align="center"><b>&nbsp;No&nbsp;</b></td>'.
 	'<td><b>&nbsp;'.($ENV{'form.vProb'} eq 'no' ? 'Title' : 'Problem View').'/Grade</b></td></tr>';
 
-    my ($depth,$ctr,$question) = (1,0,1);
+    my ($depth,$question) = (1,1);
     $iterator->next(); # skip the first BEGIN_MAP
     my $curRes = $iterator->next(); # for "current resource"
-    while ($depth > 0 && $ctr < 100) { # ctr, just in case it never gets out of loop
+    while ($depth > 0) {
         if($curRes == $iterator->BEGIN_MAP) { $depth++; }
         if($curRes == $iterator->END_MAP) { $depth--; }
 
@@ -2756,7 +2755,6 @@
 
        }
         $curRes = $iterator->next();
-	$ctr++;
     }
 
     $navmap->untieHashes();
@@ -2804,8 +2802,8 @@
 
     $iterator->next(); # skip the first BEGIN_MAP
     my $curRes = $iterator->next(); # for "current resource"
-    my ($depth,$ctr,$question,$changeflag)= (1,0,1,0);
-    while ($depth > 0 && $ctr < 100) { # ctr, just in case it never gets out of loop
+    my ($depth,$question,$changeflag)= (1,1,0);
+    while ($depth > 0) {
         if($curRes == $iterator->BEGIN_MAP) { $depth++; }
         if($curRes == $iterator->END_MAP) { $depth--; }
 
@@ -2867,7 +2865,6 @@
 
 	}
         $curRes = $iterator->next();
-	$ctr++;
     }
 
     $navmap->untieHashes();