--- loncom/interface/lonstatistics.pm 2003/05/13 14:30:26 1.70 +++ loncom/interface/lonstatistics.pm 2003/05/27 14:51:24 1.71 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstatistics.pm,v 1.70 2003/05/13 14:30:26 matthew Exp $ +# $Id: lonstatistics.pm,v 1.71 2003/05/27 14:51:24 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -206,7 +206,6 @@ upon the calling context. ####################################################### ####################################################### sub PrepareClasslist { - my $r = shift; my %Sections; &clear_classlist_variables(); # @@ -342,6 +341,27 @@ sub PrepareClasslist { return; } + +####################################################### +####################################################### + +=pod + +=item get_students + +Returns a list of the selected students + +=cut + +####################################################### +####################################################### +sub get_students { + if (! @Students) { + &PrepareClasslist() + } + return @Students; +} + ####################################################### ####################################################### @@ -739,6 +759,7 @@ sub MapSelect { Returns html for a selection box allowing the user to choose one (or more) of the sections in the course. +Uses the package variables @Sections and @SelectedSections =over 4 =item $elementname The name of the HTML form element @@ -747,13 +768,6 @@ of the sections in the course. =item $numvisible The number of options to be visible -=item $selected Array ref to the names of the already selected sections. -If undef, $ENV{'form.'.$elementname} is used. -If $ENV{'form.'.$elementname} is also empty, none will be selected. - -=item $restriction Code reference to subroutine which returns true or -false. The code must expect a reference to a sequence data structure. - =back =cut @@ -766,6 +780,11 @@ sub SectionSelect { return; } # + # Make sure we have the data we need to continue + if (! @Sections) { + &PrepareClasslist() + } + # # Build the form element my $Str = "\n"; $Str .= '