version 1.3, 2003/05/22 21:16:35
|
version 1.4, 2003/05/23 14:52:51
|
Line 97 sub new {
|
Line 97 sub new {
|
chome => $ENV{'course.'.$ENV{'request.course.id'}.'.home'}, |
chome => $ENV{'course.'.$ENV{'request.course.id'}.'.home'}, |
coursedesc => $ENV{'course.'.$ENV{'request.course.id'}.'.description'}, |
coursedesc => $ENV{'course.'.$ENV{'request.course.id'}.'.description'}, |
coursefilename => $ENV{'request.course.fn'}, |
coursefilename => $ENV{'request.course.fn'}, |
|
temporary => '', |
# |
# |
# blackout is used to determine if any data needs to be hidden from the |
# blackout is used to determine if any data needs to be hidden from the |
# student. |
# student. |
Line 1400 sub save {
|
Line 1401 sub save {
|
my $self = shift; |
my $self = shift; |
my ($makedef)=@_; |
my ($makedef)=@_; |
my $cid=$self->{'cid'}; |
my $cid=$self->{'cid'}; |
|
# If we are saving it, it must not be temporary |
|
$self->temporary(0); |
if (&Apache::lonnet::allowed('opa',$cid)) { |
if (&Apache::lonnet::allowed('opa',$cid)) { |
my %f=$self->formulas(); |
my %f=$self->formulas(); |
my $stype = $self->{'type'}; |
my $stype = $self->{'type'}; |
Line 1442 sub save_tmp {
|
Line 1445 sub save_tmp {
|
$self->{'filename'}; |
$self->{'filename'}; |
$fn=~s/\W/\_/g; |
$fn=~s/\W/\_/g; |
$fn=$Apache::lonnet::tmpdir.$fn.'.tmp'; |
$fn=$Apache::lonnet::tmpdir.$fn.'.tmp'; |
|
$self->temporary(1); |
my $fh; |
my $fh; |
if ($fh=Apache::File->new('>'.$fn)) { |
if ($fh=Apache::File->new('>'.$fn)) { |
my %f = $self->formulas(); |
my %f = $self->formulas(); |
Line 1472 sub load_tmp {
|
Line 1476 sub load_tmp {
|
} |
} |
$spreadsheet_file->close(); |
$spreadsheet_file->close(); |
} |
} |
|
# flag the sheet as temporary |
|
$self->temporary(1); |
$self->formulas(\%formulas); |
$self->formulas(\%formulas); |
$self->set_row_sources(); |
$self->set_row_sources(); |
$self->set_row_numbers(); |
$self->set_row_numbers(); |
return; |
return; |
} |
} |
|
|
|
sub temporary { |
|
my $self=shift; |
|
if (@_) { |
|
($self->{'temporary'})= @_; |
|
} |
|
$self->logthis('temporary = '.$self->{'temporary'}); |
|
return $self->{'temporary'}; |
|
} |
|
|
sub modify_cell { |
sub modify_cell { |
# studentcalc overrides this |
# studentcalc overrides this |
my $self = shift; |
my $self = shift; |