--- loncom/interface/lonhelper.pm 2005/01/03 13:45:31 1.90 +++ loncom/interface/lonhelper.pm 2005/01/05 12:07:27 1.91 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # .helper XML handler to implement the LON-CAPA helper # -# $Id: lonhelper.pm,v 1.90 2005/01/03 13:45:31 foxr Exp $ +# $Id: lonhelper.pm,v 1.91 2005/01/05 12:07:27 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1871,16 +1871,28 @@ sub start_option { if (!defined($paramHash->{OPTION_TEXTS})) { $paramHash->{OPTION_TEXTS} = [ ]; $paramHash->{OPTION_VARS} = [ ]; - + } + # OPTION_TEXTS is a list of the text attribute + # values used to create column headings. + # OPTION_VARS is a list of the variable names, used to create the checkbox + # inputs. # We're ok with empty elements. as place holders # Although the 'variable' element should really exist. + # + my $option_texts = $paramHash->{OPTION_TEXTS}; my $option_vars = $paramHash->{OPTION_VARS}; - push(@$option_texts, $token->[2]{'text'}); push(@$option_vars, $token->[2]{'variable'}); + # Need to create and declare the option variables as well to make them + # persistent. + # + my $varname = $token->[2]{'variable'}; + $helper->declareVar($varname); + + return ''; } @@ -1989,9 +2001,10 @@ BUTTONS my $resource_name = HTML::Entities::encode(&$valueFunc($resource),"<>&\"'"); if($option_vars) { - foreach my $var (@$option_vars) { + foreach my $option_var (@$option_vars) { $col .= - " "; } }