--- loncom/interface/spreadsheet/Spreadsheet.pm 2003/11/17 19:55:41 1.30 +++ loncom/interface/spreadsheet/Spreadsheet.pm 2003/11/21 21:51:28 1.31 @@ -1,5 +1,5 @@ # -# $Id: Spreadsheet.pm,v 1.30 2003/11/17 19:55:41 matthew Exp $ +# $Id: Spreadsheet.pm,v 1.31 2003/11/21 21:51:28 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1190,16 +1190,24 @@ sub calcerror { sub display { my $self = shift; my ($r) = @_; - $self->compute($r); my $outputmode = 'html'; - if ($ENV{'form.output_format'} =~ /^(html|excel|csv)$/) { - $outputmode = $ENV{'form.output_format'}; + foreach ($self->output_options()) { + if ($ENV{'form.output_format'} eq $_->{'value'}) { + $outputmode = $_->{'value'}; + last; + } } 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 'excel') { + $self->compute($r); $self->outsheet_excel($r); } elsif ($outputmode eq 'csv') { + $self->compute($r); $self->outsheet_csv($r); } $self->cleanup(); @@ -1336,11 +1344,24 @@ sub html_header { return '' if (! $ENV{'request.role.adv'}); return "
'.&mt('Output Format').' |
---|
'.&output_selector()." |
'.$self->output_selector()." |