[LON-CAPA-cvs] cvs: loncom /interface/spreadsheet assesscalc.pm

albertel lon-capa-cvs@mail.lon-capa.org
Sun, 15 May 2005 02:19:49 -0000


albertel		Sat May 14 22:19:49 2005 EDT

  Modified files:              
    /loncom/interface/spreadsheet	assesscalc.pm 
  Log:
  - connection aborted only changes after trying to do $r->rflush( or enough $r->print()) no need tocheck hundreds of times a second
  
  
Index: loncom/interface/spreadsheet/assesscalc.pm
diff -u loncom/interface/spreadsheet/assesscalc.pm:1.41 loncom/interface/spreadsheet/assesscalc.pm:1.42
--- loncom/interface/spreadsheet/assesscalc.pm:1.41	Sat May 14 22:18:12 2005
+++ loncom/interface/spreadsheet/assesscalc.pm	Sat May 14 22:19:49 2005
@@ -1,5 +1,5 @@
 #
-# $Id: assesscalc.pm,v 1.41 2005/05/15 02:18:12 albertel Exp $
+# $Id: assesscalc.pm,v 1.42 2005/05/15 02:19:49 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -710,8 +710,6 @@
 sub compute {
     my $self = shift;
     my ($r) = @_;
-    my $connection = $r->connection();
-    if ($connection->aborted()) { $self->cleanup(); return; }
     $self->initialize_safe_space();
     #########################################
     #########################################
@@ -739,11 +737,8 @@
     }
     #
     # Get the values of the metadata fields
-    if ($connection->aborted()) { $self->cleanup(); return; }
     $self->ensure_current_caches();
-    if ($connection->aborted()) { $self->cleanup(); return; }
     %parameters = $self->get_parameter_values(keys(%parameters));
-    if ($connection->aborted()) { $self->cleanup(); return; }
     #
     # Clean out unnecessary parameters
     foreach (keys(%parameters)) {
@@ -780,7 +775,6 @@
             }
         }
     }
-    if ($connection->aborted()) { $self->cleanup(); return; }
     #
     # Move the parameters into the spreadsheet
     while (my ($parm,$value) = each(%parameters)) {
@@ -794,14 +788,12 @@
     }
     $self->formulas(\%f);
     $self->constants(\%c);
-    if ($connection->aborted()) { $self->cleanup(); return; }
     $self->calcsheet();
     #
     # Store export row in cache
     my @exportarray = $self->exportrow();
     $self->deal_with_export_row(@exportarray);
     $self->save() if ($self->need_to_save());
-    if ($connection->aborted()) { $self->cleanup(); return; }
     return;
 }
 
@@ -918,7 +910,6 @@
 sub export_data {
     my $self = shift;
     my ($r) = @_;
-    my $connection = $r->connection();
     my $symb = $self->{'symb'};
     if (! exists($env{'request.role.adv'}) || ! $env{'request.role.adv'} ||
         ! exists($Exportrows{$symb}) || ! defined($Exportrows{$symb})  ||
@@ -929,7 +920,6 @@
         ) {
         $self->compute($r);
     }
-    if ($connection->aborted()) { $self->cleanup(); return; }
     my @Data;
     if ($self->badcalc()) {
         @Data = ();