--- loncom/interface/spreadsheet/assesscalc.pm 2003/11/17 19:55:41 1.29 +++ loncom/interface/spreadsheet/assesscalc.pm 2004/02/24 20:47:14 1.33 @@ -1,5 +1,5 @@ # -# $Id: assesscalc.pm,v 1.29 2003/11/17 19:55:41 matthew Exp $ +# $Id: assesscalc.pm,v 1.33 2004/02/24 20:47:14 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -531,7 +531,7 @@ sub csv_rows { # writes the meat of the spreadsheet to an excel worksheet. Called # by Spreadsheet::outsheet_excel; my $self = shift; - my ($filehandle) = @_; + my ($connection,$filehandle) = @_; # # Write a header row $self->csv_output_row($filehandle,undef, @@ -554,12 +554,13 @@ sub excel_rows { # writes the meat of the spreadsheet to an excel worksheet. Called # by Spreadsheet::outsheet_excel; my $self = shift; - my ($worksheet,$cols_output,$rows_output) = @_; + my ($connection,$worksheet,$cols_output,$rows_output) = @_; + return if (! ref($worksheet)); # # Write a header row $cols_output = 0; foreach my $value ('Parameter','Description','Value') { - $worksheet->write($rows_output,$cols_output++,&mt($value)); + $worksheet->write($rows_output,$cols_output++,$value); } $rows_output++; # @@ -780,7 +781,10 @@ sub compute { 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 =~/([^\d\.]|\.\.)/); $c{$parm} = $value; } $self->formulas(\%f); @@ -872,6 +876,10 @@ sub load_cached_export_rows { # We only got one key, so we will access it directly. while (my ($key,$sheetdata) = each(%tmp)) { my ($sname,$sdom,$sheettype,$symb) = split(':',$key); + if (! defined($sname) || $sname eq '' || + ! defined($sdom) || $sdom eq '' ) { + next; + } if ($symb =~ /\.time$/) { $symb =~ s/\.time$//; $Exportrows{$symb}->{'time'} = $sheetdata;