--- loncom/interface/spreadsheet/assesscalc.pm 2003/05/22 20:06:09 1.3 +++ loncom/interface/spreadsheet/assesscalc.pm 2003/05/23 14:52:51 1.7 @@ -1,5 +1,5 @@ # -# $Id: assesscalc.pm,v 1.3 2003/05/22 20:06:09 matthew Exp $ +# $Id: assesscalc.pm,v 1.7 2003/05/23 14:52:51 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -523,13 +523,28 @@ sub compute { my %f=$self->formulas(); my %c; # + # Check for blackout requirements + if ((!exists($ENV{'request.role.adv'}) || !$ENV{'request.role.adv'})) { + while (my ($parm,$value) = each(%parameters)) { + last if ($self->blackout()); + next if ($parm !~ /^(parameter_.*)_problemstatus$/); + next if ($parameters{$1.'_answerdate'}blackout(1); + } + } + } + # + # Move the parameters into the spreadsheet while (my ($parm,$value) = each(%parameters)) { my $cell = 'A'.$self->get_row_number_from_key($parm); $f{$cell} = $parm; - $c{$parm} = '"'.$value.'"'; + $value = '"'.$value.'"' if ($value =~/[^0-9.]/); + $c{$parm} = $value; } - $self->formulas(%f); - $self->constants(%c); + $self->formulas(\%f); + $self->constants(\%c); $self->calcsheet(); # # Store export row in cache @@ -649,7 +664,8 @@ spreadsheet only if necessary. sub export_data { my $self = shift; my $symb = $self->{'symb'}; - if (! exists($Exportrows{$symb}) || ! defined($Exportrows{$symb}) || + if (! exists($ENV{'request.role.adv'}) || ! $ENV{'request.role.adv'} || + ! exists($Exportrows{$symb}) || ! defined($Exportrows{$symb}) || ! $self->check_expiration_time($Exportrows{$symb}->{'time'}) || ! exists($Exportrows{$symb}->{$self->{'filename'}}) || ! defined($Exportrows{$symb}->{$self->{'filename'}})) { @@ -681,6 +697,7 @@ Writes the export data for this spreadsh ############################################# sub save_export_data { my $self = shift; + return if ($self->temporary()); my $student = $self->{'name'}.':'.$self->{'domain'}; my $symb = $self->{'symb'}; if (! exists($Exportrows{$symb}) ||