--- loncom/interface/lonstatistics.pm 2005/04/07 06:56:23 1.123 +++ loncom/interface/lonstatistics.pm 2005/04/07 07:34:52 1.124 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstatistics.pm,v 1.123 2005/04/07 06:56:23 albertel Exp $ +# $Id: lonstatistics.pm,v 1.124 2005/04/07 07:34:52 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -298,11 +298,8 @@ sub PrepareClasslist { } # if (exists($env{'form.StudentData'})) { - if (ref($env{'form.StudentData'}) eq 'ARRAY') { - @SelectedStudentData = @{$env{'form.StudentData'}}; - } else { - @SelectedStudentData = ($env{'form.StudentData'}); - } + @SelectedStudentData = + &Apache::loncommon::get_env_multiple('form.StudentData'); } else { @SelectedStudentData = ('username'); } @@ -330,14 +327,8 @@ Returns an array of the selected section ####################################################### ####################################################### sub get_selected_sections { - my @selected_sections; - if (exists($env{'form.Section'})) { - if (ref($env{'form.Section'})) { - @selected_sections = @{$env{'form.Section'}}; - } elsif ($env{'form.Section'} !~ /^\s*$/) { - @selected_sections = ($env{'form.Section'}); - } - } + my @selected_sections = + &Apache::loncommon::get_env_multiple('form.Section'); @selected_sections = ('all') if (! @selected_sections); foreach (@selected_sections) { if ($_ eq 'all') { @@ -569,16 +560,9 @@ Returns: Array of symbs of selected maps ####################################################### sub get_selected_maps { my ($elementname) = @_; - my @selected_maps; - if (exists($env{'form.'.$elementname})) { - if (ref($env{'form.'.$elementname})) { - @selected_maps = @{$env{'form.'.$elementname}}; - } else { - @selected_maps = ($env{'form.'.$elementname}); - } - } else { - @selected_maps = ('all'); - } + my @selected_maps = + &Apache::loncommon::get_env_multiple('form.'.$elementname); + @selected_maps = ('all') if (! @selected_maps); foreach my $map (@selected_maps) { if ($map eq 'all') { @selected_maps = ('all');