version 1.175, 2003/03/07 23:32:05
|
version 1.180, 2003/05/27 19:57:51
|
Line 152 sub handler {
|
Line 152 sub handler {
|
$ENV{'form.ufn'} eq 'default')) { |
$ENV{'form.ufn'} eq 'default')) { |
$ENV{'form.ufn'}='default_'.$1; |
$ENV{'form.ufn'}='default_'.$1; |
} |
} |
if (!$ENV{'form.ufn'} || $ENV{'form.ufn'} eq 'default') { |
# if (!$ENV{'form.ufn'} || $ENV{'form.ufn'} eq 'default') { |
$ENV{'form.ufn'}='course_default_'.$sheettype; |
# $ENV{'form.ufn'}='course_default_'.$sheettype; |
} |
# } |
# |
# |
# Interactive loading of specific sheet? |
# Interactive loading of specific sheet? |
# |
# |
Line 183 sub handler {
|
Line 183 sub handler {
|
# Header.... |
# Header.... |
# |
# |
$r->print('<html><head><title>LON-CAPA Spreadsheet</title>'); |
$r->print('<html><head><title>LON-CAPA Spreadsheet</title>'); |
my $nothing = "''"; |
my $nothing = &Apache::lonhtmlcommon::javascript_nothing(); |
if ($ENV{'browser.type'} eq 'explorer') { |
|
$nothing = "'javascript:void(0);'"; |
|
} |
|
|
|
if ($ENV{'request.role'} !~ /^st\./) { |
if ($ENV{'request.role'} !~ /^st\./) { |
$r->print(<<ENDSCRIPT); |
$r->print(<<ENDSCRIPT); |
Line 355 ENDSCRIPT
|
Line 352 ENDSCRIPT
|
$oldsheets{'course'} ne $sheet->{'cid'}) { |
$oldsheets{'course'} ne $sheet->{'cid'}) { |
undef %oldsheets; |
undef %oldsheets; |
undef %loadedcaches; |
undef %loadedcaches; |
|
&Apache::lonspreadsheet::Spreadsheet::clear_package_variables(); |
} |
} |
$oldsheets{'course'} = $sheet->{'cid'}; |
$oldsheets{'course'} = $sheet->{'cid'}; |
# |
# |
Line 537 my %defaultsheets;
|
Line 535 my %defaultsheets;
|
my %rowlabel_cache; |
my %rowlabel_cache; |
#my %oldsheets; |
#my %oldsheets; |
|
|
|
sub clear_package_variables { |
|
undef %courseopt; |
|
undef %useropt; |
|
undef %parmhash; |
|
undef %Section; |
|
undef %expiredates; |
|
undef $cachedassess; |
|
undef %cachedstores; |
|
undef %starttimes; |
|
undef %usedtimes; |
|
undef %numbertimes; |
|
undef $includedir; |
|
undef %spreadsheets; |
|
undef %courserdatas; |
|
undef %userrdatas; |
|
undef %defaultsheets; |
|
undef %rowlabel_cache; |
|
} |
|
|
sub complete_recalc { |
sub complete_recalc { |
my $self = shift; |
my $self = shift; |
undef %spreadsheets; |
undef %spreadsheets; |
Line 754 sub new {
|
Line 771 sub new {
|
# |
# |
my ($uname,$udom,$stype,$usymb)=@_; |
my ($uname,$udom,$stype,$usymb)=@_; |
# |
# |
|
if (! exists($Section{$uname.':'.$udom})) { |
|
my $classlist = &Apache::loncoursedata::get_classlist(); |
|
# |
|
foreach my $student (keys(%$classlist)) { |
|
my ($studentDomain,$studentName,undef,undef,undef,$studentSection, |
|
undef,undef) = @{$classlist->{$student}}; |
|
$Section{$studentName.':'.$studentDomain} = $studentSection; |
|
} |
|
} |
my $self = { |
my $self = { |
uname => $uname, |
uname => $uname, |
udom => $udom, |
udom => $udom, |
Line 1526 sub expandnamed {
|
Line 1552 sub expandnamed {
|
foreach my $varname ( @vars ) { |
foreach my $varname ( @vars ) { |
if ($varname=~/\D/) { |
if ($varname=~/\D/) { |
$formula=~s/$varname/'$c{\''.$varname.'\'}'/ge; |
$formula=~s/$varname/'$c{\''.$varname.'\'}'/ge; |
$varname=~s/$var/\([\\w:- ]\+\)/g; |
$varname=~s/$var/\([\\w:\\- ]\+\)/g; |
foreach (keys(%{$self->{'constants'}})) { |
foreach (keys(%{$self->{'constants'}})) { |
if ($_=~/$varname/) { |
if ($_=~/$varname/) { |
$values{$1}=1; |
$values{$1}=1; |