version 1.2, 2003/05/19 13:58:05
|
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 |
|
# student. |
|
blackout => 0, |
# |
# |
# Data storage |
# Data storage |
formulas => {}, |
formulas => {}, |
Line 1396 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 1438 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 1468 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; |
Line 1508 sub othersheets {
|
Line 1527 sub othersheets {
|
return @alternatives; |
return @alternatives; |
} |
} |
|
|
|
sub blackout { |
|
my $self = shift; |
|
$self->{'blackout'} = $_[0] if (@_); |
|
return $self->{'blackout'}; |
|
} |
|
|
sub get_row { |
sub get_row { |
my $self = shift; |
my $self = shift; |
my ($n)=@_; |
my ($n)=@_; |