--- loncom/interface/lonhelper.pm 2005/09/28 19:03:42 1.115 +++ loncom/interface/lonhelper.pm 2005/10/01 02:28:55 1.116 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # .helper XML handler to implement the LON-CAPA helper # -# $Id: lonhelper.pm,v 1.115 2005/09/28 19:03:42 albertel Exp $ +# $Id: lonhelper.pm,v 1.116 2005/10/01 02:28:55 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2257,10 +2257,10 @@ sub render { numSections = document.forms.helpform.chosensections.length; desiredState = getDesiredState(); - for (option = 0; option , numSections; option++) { + for (var option = 0; option < numSections; option++) { if(document.forms.helpform.chosensections.options[option].selected) { section = document.forms.helpform.chosensections.options[option].text; - if (section == "Staff") { // Staff are indicated by an empty section. + if (section == "none") { section =""; } for (i = 0; i < document.forms.helpform.elements.length; i++ ) { @@ -2268,8 +2268,12 @@ sub render { info = document.forms.helpform.elements[i].value.split(':'); hisSection = info[2]; hisState = info[4]; - if((hisSection == section) && ((desiredState ==hisState) || (section =="") || (desiredState == "All"))) { - document.forms.helpform.elements[i].checked = value; + if (desiredState == hisState || + desiredState == "All") { + if(hisSection == section || + section =="" ) { + document.forms.helpform.elements[i].checked = value; + } } } } @@ -2397,41 +2401,48 @@ BUTTONS $result .= $buttons; # # now add the fancy section choice... first enumerate the sections: - - my %sections; - for my $key (@keys) { - my $section_name = $classlist->{$key}->[$section]; - if ($section_name ne "") { - $sections{$section_name} = 1; + if ($self->{'multichoice'}) { + my %sections; + for my $key (@keys) { + my $section_name = $classlist->{$key}->[$section]; + if ($section_name ne "") { + $sections{$section_name} = 1; + } } - } - # The variable $choice_widget will have the html to make the choice - # selector. + # The variable $choice_widget will have the html to make the choice + # selector. + my $size=5; + if (scalar(keys(%sections)) < 5) { + $size=scalar(keys(%sections)); + } + my $choice_widget = '\n"; - my $choice_widget = '\n"; - - # Build a table without any borders to contain the section based - # selection: - - my $section_selectors = ''."\n"; - $section_selectors .= "\n\n"; - $section_selectors .= ' \n"; - $section_selectors .= ' \n"; - $section_selectors .= ' \n"; - $section_selectors .= "\n"; - $section_selectors .= "\n"; - $section_selectors .= ' '."\n"; - $section_selectors .= ' '."\n
For Sections:$choice_widget
\n"; - $section_selectors .= "
"; + # Build a table without any borders to contain the section based + # selection: - $result .= $section_selectors; + my $section_selectors =< + + For Sections:$choice_widget + + + + + + + + +
+SECTIONSELECT + $result .= $section_selectors; + } return $result; }