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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 17 May 2005 20:14:19 -0000


albertel		Tue May 17 16:14:19 2005 EDT

  Modified files:              
    /loncom/interface/spreadsheet	assesscalc.pm 
  Log:
  - remove any formulas that don't have an associated const
  
  
Index: loncom/interface/spreadsheet/assesscalc.pm
diff -u loncom/interface/spreadsheet/assesscalc.pm:1.49 loncom/interface/spreadsheet/assesscalc.pm:1.50
--- loncom/interface/spreadsheet/assesscalc.pm:1.49	Tue May 17 14:04:40 2005
+++ loncom/interface/spreadsheet/assesscalc.pm	Tue May 17 16:14:19 2005
@@ -1,5 +1,5 @@
 #
-# $Id: assesscalc.pm,v 1.49 2005/05/17 18:04:40 albertel Exp $
+# $Id: assesscalc.pm,v 1.50 2005/05/17 20:14:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -789,6 +789,12 @@
         $value = 'q{'.$value.'}' if ($value =~/([^\d\.]|\.\.)/);
         $c{$parm} = $value;
     }
+    foreach my $cell (grep(/^A/,keys(%f))) {
+        # Clean out any bad formulas
+	next if (exists($c{$f{$cell}}));
+	next if ($cell eq 'A0');
+	delete($f{$cell});
+    }
     $self->formulas(\%f);
     $self->constants(\%c);
     $self->calcsheet();