--- loncom/interface/spreadsheet/Spreadsheet.pm 2003/06/18 17:35:14 1.14 +++ loncom/interface/spreadsheet/Spreadsheet.pm 2003/06/23 19:58:18 1.17 @@ -1,5 +1,5 @@ # -# $Id: Spreadsheet.pm,v 1.14 2003/06/18 17:35:14 matthew Exp $ +# $Id: Spreadsheet.pm,v 1.17 2003/06/23 19:58:18 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1143,13 +1143,15 @@ sub display { ############################################ sub html_export_row { my $self = shift(); + my ($color) = @_; + $color = '#CCCCFF' if (! defined($color)); my $allowed = &Apache::lonnet::allowed('mgr',$ENV{'request.course.id'}); my $row_html; my @rowdata = $self->get_row(0); foreach my $cell (@rowdata) { if ($cell->{'name'} =~ /^[A-Z]/) { - $row_html .= ''. - &html_editable_cell($cell,'#CCCCFF',$allowed).''; + $row_html .= ''. + &html_editable_cell($cell,$color,$allowed).''; } else { $row_html .= ''. &html_editable_cell($cell,'#DDCCFF',$allowed).''; @@ -1161,14 +1163,14 @@ sub html_export_row { sub html_template_row { my $self = shift(); my $allowed = &Apache::lonnet::allowed('mgr',$ENV{'request.course.id'}); - my ($num_uneditable) = @_; + my ($num_uneditable,$importcolor) = @_; my $row_html; my @rowdata = $self->get_template_row(); my $count = 0; for (my $i = 0; $i<=$#rowdata; $i++) { my $cell = $rowdata[$i]; if ($i < $num_uneditable) { - $row_html .= ''. + $row_html .= ''. &html_uneditable_cell($cell,'#FFDDDD',$allowed).''; } else { $row_html .= ''. @@ -1222,14 +1224,19 @@ sub html_uneditable_cell { sub html_row { my $self = shift(); - my ($num_uneditable,$row) = @_; + my ($num_uneditable,$row,$exportcolor,$importcolor) = @_; my $allowed = &Apache::lonnet::allowed('mgr',$ENV{'request.course.id'}); my @rowdata = $self->get_row($row); my $num_cols_output = 0; my $row_html; + my $color = $importcolor; + if ($row == 0) { + $color = $exportcolor; + } + $color = '#FFDDDD' if (! defined($color)); foreach my $cell (@rowdata) { if ($num_cols_output++ < $num_uneditable) { - $row_html .= ''; + $row_html .= ''; $row_html .= &html_uneditable_cell($cell,'#FFDDDD'); } else { $row_html .= ''; @@ -1531,9 +1538,6 @@ sub load { } else { $self->filename($newfilename); } - } elsif ($filename =~ /^default\.$self->{'type'}/) { - # if there is an Original_$stype, load it instead - $formulas = $self->load_system_default_sheet(); } else { # Load the spreadsheet definition file from the save file my %tmphash = &Apache::lonnet::dump($filename,$cdom,$cnum); @@ -1621,6 +1625,9 @@ sub save { } if ($self->is_default()) { &Apache::lonnet::expirespread('','',$self->{'type'},''); + if ($self->{'type'} eq 'assesscalc') { + &Apache::lonnet::expirespread('','','studentcalc',''); + } } return $reply; }