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

ng lon-capa-cvs@mail.lon-capa.org
Mon, 14 Jul 2003 14:29:07 -0000


ng		Mon Jul 14 10:29:07 2003 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  work on top level maps
  
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.112 loncom/homework/grades.pm:1.113
--- loncom/homework/grades.pm:1.112	Fri Jul 11 16:22:43 2003
+++ loncom/homework/grades.pm	Mon Jul 14 10:29:07 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.112 2003/07/11 20:22:43 ng Exp $
+# $Id: grades.pm,v 1.113 2003/07/14 14:29:07 ng Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2663,21 +2663,21 @@
     my $navmap = Apache::lonnavmaps::navmap-> new($ENV{'request.course.fn'}.'.db',
 						  $ENV{'request.course.fn'}.'_parms.db',1, 1);
 
-    my $res = $navmap->firstResource(); # temp resource to access constants
+    #my $res = $navmap->firstResource(); # temp resource to access constants
     $navmap->init();
 
     # End navmap using boilerplate
 
-    my $iterator = $navmap->getIterator(undef, undef, undef, 1);
+    my $iterator = Apache::lonnavmaps::iterator->new($navmap, undef, undef, undef, 1, undef, 1);
     my $depth = 1;
-    $iterator->next(); # ignore first BEGIN_MAP
     my $curRes = $iterator->next();
 
     my %symbx = ();
     my @titles = ();
     my $minder=0;
-    while ($depth > 0) {
-        if ($curRes == $iterator->BEGIN_MAP()) {$depth++;}
+    my $seenBeginMap = 0;
+    while ($depth > 0 && !$seenBeginMap) {
+        if ($curRes == $iterator->BEGIN_MAP()) {$depth++; $seenBeginMap = 1; }
         if ($curRes == $iterator->END_MAP()) { $depth--; }
 
         if (ref($curRes) && $curRes->is_map()) {