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

bowersj2 lon-capa-cvs@mail.lon-capa.org
Thu, 17 Apr 2003 17:21:24 -0000


bowersj2		Thu Apr 17 13:21:24 2003 EDT

  Modified files:              
    /loncom/interface	lonhelper.pm 
  Log:
  Student and section selection should work now.
  
  
Index: loncom/interface/lonhelper.pm
diff -u loncom/interface/lonhelper.pm:1.11 loncom/interface/lonhelper.pm:1.12
--- loncom/interface/lonhelper.pm:1.11	Tue Apr 15 15:10:00 2003
+++ loncom/interface/lonhelper.pm	Thu Apr 17 13:21:24 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # .helper XML handler to implement the LON-CAPA helper
 #
-# $Id: lonhelper.pm,v 1.11 2003/04/15 19:10:00 bowersj2 Exp $
+# $Id: lonhelper.pm,v 1.12 2003/04/17 17:21:24 bowersj2 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1401,6 +1401,10 @@
     $paramHash->{'variable'} = $token->[2]{'variable'};
     $helper->declareVar($paramHash->{'variable'});
     $paramHash->{'multichoice'} = $token->[2]{'multichoice'};
+    if (defined($token->[2]{'nextstate'})) {
+        $paramHash->{NEXTSTATE} = $token->[2]{'nextstate'};
+    }
+    
 }    
 
 sub end_student {
@@ -1441,7 +1445,6 @@
 
     # Load up the students
     my $choices = &Apache::loncoursedata::get_classlist();
-
     my @keys = keys %{$choices};
 
     # Constants
@@ -1752,16 +1755,17 @@
 sub start_section {
     my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
 
-    $paramHash->{CHOICES} = [];
-
     if ($target ne 'helper') {
         return '';
     }
+
+    $paramHash->{CHOICES} = [];
+
     $paramHash->{'variable'} = $token->[2]{'variable'};
     $helper->declareVar($paramHash->{'variable'});
     $paramHash->{'multichoice'} = $token->[2]{'multichoice'};
     if (defined($token->[2]{'nextstate'})) {
-        $paramHash->{'nextstate'} = $token->[2]{'nextstate'};
+        $paramHash->{NEXTSTATE} = $token->[2]{'nextstate'};
     }
 
     # Populate the CHOICES element
@@ -1776,16 +1780,22 @@
         } else {
             $choices{$sectionName} = $sectionName;
         }
-    }
-    
+    } 
+   
     for my $sectionName (sort(keys(%choices))) {
+        
         push @{$paramHash->{CHOICES}}, [$sectionName, $sectionName];
     }
-
 }    
 
-sub end_section { return ''; }
+sub end_section {
+    my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
 
+    if ($target ne 'helper') {
+        return '';
+    }
+    Apache::lonhelper::section->new();
+}    
 1;
 
 package Apache::lonhelper::general;