version 1.21, 2003/08/26 19:14:06
|
version 1.22, 2003/09/05 01:06:45
|
Line 48 Spreadsheet
|
Line 48 Spreadsheet
|
package Apache::Spreadsheet; |
package Apache::Spreadsheet; |
|
|
use strict; |
use strict; |
|
use warnings FATAL=>'all'; |
|
no warnings 'uninitialized'; |
use Apache::Constants qw(:common :http); |
use Apache::Constants qw(:common :http); |
use Apache::lonnet; |
use Apache::lonnet; |
use Safe; |
use Safe; |
Line 90 sub new {
|
Line 92 sub new {
|
type => $stype, |
type => $stype, |
symb => $usymb, |
symb => $usymb, |
errorlog => '', |
errorlog => '', |
maxrow => '', |
maxrow => 0, |
cid => $ENV{'request.course.id'}, |
cid => $ENV{'request.course.id'}, |
cnum => $ENV{'course.'.$ENV{'request.course.id'}.'.num'}, |
cnum => $ENV{'course.'.$ENV{'request.course.id'}.'.num'}, |
cdom => $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, |
cdom => $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}, |
Line 248 sub load_spreadsheet_expirationdates {
|
Line 250 sub load_spreadsheet_expirationdates {
|
sub check_expiration_time { |
sub check_expiration_time { |
my $self = shift; |
my $self = shift; |
my ($time)=@_; |
my ($time)=@_; |
|
return 0 if (! defined($time)); |
my ($key1,$key2,$key3,$key4,$key5); |
my ($key1,$key2,$key3,$key4,$key5); |
# Description of keys |
# Description of keys |
# |
# |
Line 1144 sub display {
|
Line 1147 sub display {
|
} elsif ($outputmode eq 'csv') { |
} elsif ($outputmode eq 'csv') { |
$self->outsheet_csv($r); |
$self->outsheet_csv($r); |
} |
} |
|
$self->cleanup(); |
return; |
return; |
} |
} |
|
|
Line 1575 sub load {
|
Line 1579 sub load {
|
sub set_row_sources { |
sub set_row_sources { |
my $self = shift; |
my $self = shift; |
while (my ($cell,$value) = each(%{$self->{'formulas'}})) { |
while (my ($cell,$value) = each(%{$self->{'formulas'}})) { |
next if ($cell !~ /^A(\d+)/ && $1 > 0); |
next if ($cell !~ /^A(\d+)/ || $1 < 1); |
my $row = $1; |
my $row = $1; |
$self->{'row_source'}->{$row} = $value; |
$self->{'row_source'}->{$row} = $value; |
} |
} |
Line 1637 sub save {
|
Line 1641 sub save {
|
return $reply if ($reply ne 'ok'); |
return $reply if ($reply ne 'ok'); |
} |
} |
if ($self->is_default()) { |
if ($self->is_default()) { |
&Apache::lonnet::expirespread('','',$self->{'type'},''); |
if ($self->{'type'} eq 'studentcalc') { |
if ($self->{'type'} eq 'assesscalc') { |
&Apache::lonnet::expirespread('','','studentcalc',''); |
|
} elsif ($self->{'type'} eq 'assesscalc') { |
|
&Apache::lonnet::expirespread('','','assesscalc',''); |
&Apache::lonnet::expirespread('','','studentcalc',''); |
&Apache::lonnet::expirespread('','','studentcalc',''); |
} |
} |
} |
} |