--- loncom/interface/spreadsheet/classcalc.pm 2003/06/23 16:06:11 1.9 +++ loncom/interface/spreadsheet/classcalc.pm 2003/12/05 22:24:20 1.10.2.1 @@ -1,5 +1,5 @@ # -# $Id: classcalc.pm,v 1.9 2003/06/23 16:06:11 matthew Exp $ +# $Id: classcalc.pm,v 1.10.2.1 2003/12/05 22:24:20 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -109,9 +109,15 @@ sub parent_link { sub outsheet_html { my $self = shift; my ($r) = @_; + #################################### + # Report any calculation errors # + #################################### + $r->print($self->html_report_error()); ################################### # Determine table structure ################################### + my $importcolor = '#88FF88'; + my $exportcolor = '#BBBBFF'; my $num_uneditable = 26; my $num_left = 52-$num_uneditable; my $tableheader =<<"END"; @@ -119,7 +125,7 @@ sub outsheet_html { - @@ -128,7 +134,7 @@ END my $label_num = 0; foreach (split(//,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')){ if ($label_num<$num_uneditable) { - $tableheader.=''. - $self->html_template_row($num_uneditable)."\n"); + $self->html_template_row($num_uneditable,$importcolor). + "\n"); # # Print out summary/export row $r->print(''. - $self->html_export_row()."\n"); + $self->html_export_row($exportcolor)."\n"); # # Prepare to output rows $tableheader =<<"END"; @@ -157,7 +164,7 @@ END END foreach (split(//,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')){ if ($label_num<$num_uneditable) { - $tableheader.=''. ''. ''. - $self->html_row($num_uneditable,$rownum)."\n"); + $self->html_row($num_uneditable,$rownum,$exportcolor, + $importcolor). + "\n"); } $r->print("
Course + Import Calculations'; + $tableheader.=''; } else { $tableheader.=''; } @@ -141,11 +147,12 @@ END # # Print out template row $r->print('
Template 
Summary0
'; + $tableheader.=''; } else { $tableheader.=''; } @@ -180,7 +187,9 @@ END ''.$student->{'domain'} .''.$student->{'section'} .''.$student->{'status'} .'

\n"); return; @@ -266,6 +275,10 @@ sub compute { my $studentsheet = Apache::studentcalc->new ($student->{'username'},$student->{'domain'},undef); my @exportdata = $studentsheet->export_data(); + if ($studentsheet->badcalc()) { + $self->set_calcerror($sname.' : '. + $studentsheet->calcerror()); + } my $rownum = $self->get_row_number_from_key($sname); $f{'A'.$rownum} = $sname; $self->{'row_source'}->{$rownum} = $sname;