--- loncom/interface/spreadsheet/Spreadsheet.pm 2005/10/13 10:27:28 1.58 +++ loncom/interface/spreadsheet/Spreadsheet.pm 2006/03/05 21:35:10 1.64 @@ -1,5 +1,5 @@ # -# $Id: Spreadsheet.pm,v 1.58 2005/10/13 10:27:28 albertel Exp $ +# $Id: Spreadsheet.pm,v 1.64 2006/03/05 21:35:10 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -378,10 +378,12 @@ Calls the system EXT function to determi #------------------------------------------------------- sub EXT { - my ($parameter) = @_; + my ($parameter,$specific_symb) = @_; return '' if (! defined($parameter) || $parameter eq ''); $parameter =~ s/^parameter\./resource\./; - my $value = &Apache::lonnet::EXT($parameter,$symb,$domain,$name,$usection); + if ($specific_symb eq '') { $specific_symb = $symb; } + my $value = &Apache::lonnet::EXT($parameter,$specific_symb,$domain,$name, + $usection); return $value; } @@ -697,7 +699,7 @@ sub get_values { } return \@values; } else { - $num = '(\d+)'; + $num = '([1-9]\d*)'; } if (($la eq '*') || ($ua eq '*')) { $alpha='[A-z]'; @@ -720,7 +722,7 @@ sub calc { $notfinished=0; while (my ($cell,$value) = each(%t)) { my $old=$sheet_values{$cell}; - $sheet_values{$cell}=eval $value; + #$sheet_values{$cell}=eval $value; # $errorlog .= $cell.' = '.$old.'->'.$sheet_values{$cell}."\n"; if ($@) { undef %sheet_values; @@ -806,7 +808,7 @@ sub expandnamed { $result.=$thissum.'+'; } $result=~s/\+$//; - return $result; + return '('.$result.')'; } else { return 0; } @@ -1193,12 +1195,19 @@ sub display { last; } } + $self->{outputmode} = $outputmode; if ($outputmode eq 'html') { $self->compute($r); $self->outsheet_html($r); } elsif ($outputmode eq 'htmlclasslist') { # No computation neccessary... This is kludgy $self->outsheet_htmlclasslist($r); + } elsif ($outputmode eq 'source') { + # No computation necessary. Rumor has it that this is some + # sort of kludge w.r.t. not "computing". It's also + # a bit of of a kludge that we call "outsheet_html" and + # let the 'outputmode' cause the outputting of source. + $self->outsheet_html($r); } elsif ($outputmode eq 'excel') { $self->compute($r); $self->outsheet_excel($r); @@ -1238,10 +1247,12 @@ sub html_export_row { foreach my $cell (@rowdata) { if ($cell->{'name'} =~ /^[A-Z]/) { $row_html .= '