--- loncom/interface/spreadsheet/classcalc.pm 2003/05/23 21:03:29 1.4 +++ loncom/interface/spreadsheet/classcalc.pm 2003/05/27 14:52:45 1.5 @@ -1,5 +1,5 @@ # -# $Id: classcalc.pm,v 1.4 2003/05/23 21:03:29 matthew Exp $ +# $Id: classcalc.pm,v 1.5 2003/05/27 14:52:45 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -51,6 +51,7 @@ use Apache::loncoursedata(); use Apache::lonhtmlcommon(); use Apache::Spreadsheet; use Apache::studentcalc; +use Apache::lonstatistics(); use HTML::Entities(); use Spreadsheet::WriteExcel; use Apache::lonnet; @@ -61,7 +62,8 @@ use Time::HiRes; sub html_header { my $self = shift; my ($toprow,$bottomrow); - foreach (['Sections','Section selector goes here'], + &Apache::lonstatistics::clear_classlist_variables(); + foreach (['Sections',&Apache::lonstatistics::SectionSelect('Section','multpile',3)], ['Enrollment Status',&Apache::lonhtmlcommon::StatusOptions(undef,undef,3)], ['Output Format',&Apache::Spreadsheet::output_selector()]) { my ($name,$selector) = @{$_}; @@ -76,22 +78,8 @@ sub html_header { sub get_classlist { my $self = shift; - # Retrieve the classlist - my @Students = (); - my ($classlist,$field_names) = &Apache::loncoursedata::get_classlist - ($self->{'cid'},$self->{'cdom'},$self->{'cnum'}); - while (my ($student,$student_data) = each (%$classlist)) { - my $studenthash = (); - for (my $i=0; $i< scalar(@$field_names);$i++) { - my $field = $field_names->[$i]; - $studenthash->{$field}=$student_data->[$i]; - } - # This is where we can skip students because they are in - # the wrong section, have expired or pending roles, whatever... - push (@Students,$studenthash); - } - my @SortedStudents = sort { $a->{'fullname'} cmp $b->{'fullname'} } @Students; - return @SortedStudents; + # Retrieve the classlist and return it + return &Apache::lonstatistics::get_students(); } sub get_title {