--- loncom/interface/spreadsheet/studentcalc.pm 2003/05/23 19:36:04 1.6 +++ loncom/interface/spreadsheet/studentcalc.pm 2003/05/29 13:39:38 1.8 @@ -1,5 +1,5 @@ # -# $Id: studentcalc.pm,v 1.6 2003/05/23 19:36:04 matthew Exp $ +# $Id: studentcalc.pm,v 1.8 2003/05/29 13:39:38 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -64,12 +64,24 @@ my %Exportrows = (); my $current_course; +sub initialize { + &initialize_sequence_cache(); +} + sub initialize_package { $current_course = $ENV{'request.course.id'}; &initialize_sequence_cache(); &load_cached_export_rows(); } +sub ensure_correct_sequence_data { + if ($current_course ne $ENV{'request.course.id'}) { + &initialize_sequence_cache(); + $current_course = $ENV{'request.course.id'}; + } + return; +} + sub initialize_sequence_cache { # # Set up the sequences and assessments @@ -312,10 +324,30 @@ sub modify_cell { return; } -sub outsheet_csv { +sub csv_rows { + # writes the meat of the spreadsheet to an excel worksheet. Called + # by Spreadsheet::outsheet_excel; my $self = shift; - my ($r) = @_; - $r->print('