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

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 02 Jun 2003 17:18:33 -0000


matthew		Mon Jun  2 13:18:33 2003 EDT

  Modified files:              
    /loncom/interface	loncoursedata.pm 
  Log:
  Towards Bug 1251 - get_sequence_assessment_data keeps track of randompick.
  
  
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.74 loncom/interface/loncoursedata.pm:1.75
--- loncom/interface/loncoursedata.pm:1.74	Mon Jun  2 13:09:09 2003
+++ loncom/interface/loncoursedata.pm	Mon Jun  2 13:18:33 2003
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursedata.pm,v 1.74 2003/06/02 17:09:09 matthew Exp $
+# $Id: loncoursedata.pm,v 1.75 2003/06/02 17:18:33 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -109,6 +109,10 @@
     if (!defined($navmap)) {
         return 'Can not open Coursemap';
     }
+    # We explicity grab the top level map because I am not sure we
+    # are pulling it from the iterator.
+    my $top_level_map = $navmap->getById('0.0');
+    #
     my $iterator = $navmap->getIterator(undef, undef, undef, 1);
     my $curRes = $iterator->next(); # Top level sequence
     ##
@@ -117,9 +121,10 @@
     ## We are going to loop until we run out of sequences/pages to explore for
     ## resources.  This means we have to start out with something to look
     ## at.
-    my $title = $ENV{'course.'.$ENV{'request.course.id'}.'.description'};
-    my $symb  = 'top';
-    my $src   = 'not applicable';
+    my $title = $top_level_map->title();
+    my $symb  = $top_level_map->symb();
+    my $src   = $top_level_map->src();
+    my $randompick = $top_level_map->randompick();
     #
     my @Sequences; 
     my @Assessments;
@@ -130,7 +135,9 @@
                 type     => 'container',
                 num_assess => 0,
                 num_assess_parts => 0,
-                contents   => [], };
+                contents   => [], 
+                randompick => $randompick,
+            };
     push (@Sequences,$top);
     push (@Nested_Sequences, $top);
     #
@@ -146,11 +153,13 @@
             $title = $previous->title();
             $symb  = $previous->symb();
             $src   = $previous->src();
+            $randompick = $previous->randompick();
             my $newmap = { title    => $title,
                            src      => $src,
                            symb     => $symb,
                            type     => 'container',
                            num_assess => 0,
+                           randompick => $randompick,
                            contents   => [],
                        };
             push (@{$currentmap->{'contents'}},$newmap); # this is permanent