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

matthew lon-capa-cvs@mail.lon-capa.org
Tue, 03 Feb 2004 22:19:47 -0000


matthew		Tue Feb  3 17:19:47 2004 EDT

  Modified files:              
    /loncom/interface/spreadsheet	assesscalc.pm 
  Log:
  Fixes horrible bug.  Should go on production servers immediately and 
  definately in 1.1.x.
  
  
Index: loncom/interface/spreadsheet/assesscalc.pm
diff -u loncom/interface/spreadsheet/assesscalc.pm:1.30 loncom/interface/spreadsheet/assesscalc.pm:1.31
--- loncom/interface/spreadsheet/assesscalc.pm:1.30	Mon Dec  8 14:58:39 2003
+++ loncom/interface/spreadsheet/assesscalc.pm	Tue Feb  3 17:19:47 2004
@@ -1,5 +1,5 @@
 #
-# $Id: assesscalc.pm,v 1.30 2003/12/08 19:58:39 matthew Exp $
+# $Id: assesscalc.pm,v 1.31 2004/02/03 22:19:47 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -781,7 +781,10 @@
     while (my ($parm,$value) = each(%parameters)) {
         my $cell = 'A'.$self->get_row_number_from_key($parm);
         $f{$cell} = $parm;
-        $value = '"'.$value.'"' if ($value =~/[^0-9.]/);
+        if ($parm =~ /_submission$/ && $value =~ /(\{|\})/) {
+            $value = 'witheld';
+        }
+        $value = 'q{'.$value.'}' if ($value !~/^\s*\d+(\.\d+)?\s*$/);
         $c{$parm} = $value;
     }
     $self->formulas(\%f);