--- loncom/interface/lonhelper.pm 2003/04/15 19:10:00 1.11 +++ loncom/interface/lonhelper.pm 2003/04/17 17:21:24 1.12 @@ -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 @@ sub start_student { $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 @@ BUTTONS # Load up the students my $choices = &Apache::loncoursedata::get_classlist(); - my @keys = keys %{$choices}; # Constants @@ -1752,16 +1755,17 @@ sub new { 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 @@ sub start_section { } 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;