[LON-CAPA-cvs] cvs: loncom /homework grades.pm
bowersj2
lon-capa-cvs@mail.lon-capa.org
Wed, 18 Jun 2003 17:37:46 -0000
bowersj2 Wed Jun 18 13:37:46 2003 EDT
Modified files:
/loncom/homework grades.pm
Log:
Should fix the infinite loops.
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.99 loncom/homework/grades.pm:1.100
--- loncom/homework/grades.pm:1.99 Wed Jun 18 13:37:10 2003
+++ loncom/homework/grades.pm Wed Jun 18 13:37:46 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.99 2003/06/18 17:37:10 albertel Exp $
+# $Id: grades.pm,v 1.100 2003/06/18 17:37:46 bowersj2 Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2600,7 +2600,7 @@
my $ctr=0;
while ($mapdepth > 0) {
if($mapcurRes == $mapiterator->BEGIN_MAP) { $mapdepth++; }
- if($mapcurRes == $mapiterator->END_MAP) { $mapdepth++; }
+ if($mapcurRes == $mapiterator->END_MAP) { $mapdepth--; }
if (ref($mapcurRes) && $mapcurRes->is_problem() && !$mapcurRes->randomout) {
$countProblems++;
@@ -2673,7 +2673,7 @@
my $curRes = $iterator->next(); # for "current resource"
while ($depth > 0 && $ctr < 100) { # ctr, just in case it never gets out of loop
if($curRes == $iterator->BEGIN_MAP) { $depth++; }
- if($curRes == $iterator->END_MAP) { $depth++; }
+ if($curRes == $iterator->END_MAP) { $depth--; }
if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) {
my $parts = $curRes->parts();
@@ -2807,7 +2807,7 @@
my ($depth,$ctr,$question,$changeflag)= (1,0,1,0);
while ($depth > 0 && $ctr < 100) { # ctr, just in case it never gets out of loop
if($curRes == $iterator->BEGIN_MAP) { $depth++; }
- if($curRes == $iterator->END_MAP) { $depth++; }
+ if($curRes == $iterator->END_MAP) { $depth--; }
if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) {
my $parts = $curRes->parts();