--- loncom/interface/spreadsheet/classcalc.pm 2003/09/05 01:06:45 1.11 +++ loncom/interface/spreadsheet/classcalc.pm 2003/09/05 01:57:54 1.12 @@ -1,5 +1,5 @@ # -# $Id: classcalc.pm,v 1.11 2003/09/05 01:06:45 matthew Exp $ +# $Id: classcalc.pm,v 1.12 2003/09/05 01:57:54 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -73,6 +73,11 @@ sub initialize { return; } +sub clear_package { + undef(@Students); + &Apache::studentcalc::clear_package(); +} + sub html_header { my $self = shift; my ($toprow,$bottomrow); @@ -257,6 +262,8 @@ sub outsheet_recursive_excel { sub compute { my $self = shift; my ($r) = @_; + my $connection = $r->connection(); + if ($connection->aborted()) { $self->cleanup(); return; } $self->initialize_safe_space(); my %c = $self->constants(); my %f = $self->formulas(); @@ -269,10 +276,13 @@ sub compute { &Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state, 'Processing first student'); foreach my $student (@Students) { + if ($connection->aborted()) { $self->cleanup(); return; } my $sname = $student->{'username'}.':'.$student->{'domain'}; my $studentsheet = Apache::studentcalc->new ($student->{'username'},$student->{'domain'},undef); - my @exportdata = $studentsheet->export_data(); + if ($connection->aborted()) { $self->cleanup(); return; } + my @exportdata = $studentsheet->export_data($r); + if ($connection->aborted()) { $self->cleanup(); return; } my $rownum = $self->get_row_number_from_key($sname); $f{'A'.$rownum} = $sname; $self->{'row_source'}->{$rownum} = $sname;