[LON-CAPA-cvs] cvs: loncom /interface loncoursedata.pm

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 17 Jun 2003 21:45:36 -0000


matthew		Tue Jun 17 17:45:36 2003 EDT

  Modified files:              
    /loncom/interface	loncoursedata.pm 
  Log:
  Address to some degree the bug we saw today with instructors getting the
  white page of death when they view stats or chart.  Now the white page
  of death does not appear but the chart and stats think there are no
  resources in the course.
  
  
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.77 loncom/interface/loncoursedata.pm:1.78
--- loncom/interface/loncoursedata.pm:1.77	Mon Jun 16 11:55:27 2003
+++ loncom/interface/loncoursedata.pm	Tue Jun 17 17:45:36 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursedata.pm,v 1.77 2003/06/16 15:55:27 matthew Exp $
+# $Id: loncoursedata.pm,v 1.78 2003/06/17 21:45:36 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -143,12 +143,20 @@
     #
     # We need to keep track of which sequences contain homework problems
     # 
+    my $previous_too;
     my $previous;
     while (scalar(@Nested_Sequences)) {
+        $previous_too = $previous;
         $previous = $curRes;
         $curRes = $iterator->next();
         my $currentmap = $Nested_Sequences[-1]; # Last one on the stack
         if ($curRes == $iterator->BEGIN_MAP()) {
+            if (! ref($previous)) {
+                $previous = $previous_too;
+            }
+            if (! ref($previous)) {
+                next;
+            }
             # get the map itself, instead of BEGIN_MAP
             $title = $previous->title();
             $symb  = $previous->symb();