--- loncom/interface/Attic/lonspreadsheet.pm 2003/03/10 20:21:45 1.176 +++ loncom/interface/Attic/lonspreadsheet.pm 2003/05/27 19:57:51 1.180 @@ -1,5 +1,5 @@ # -# $Id: lonspreadsheet.pm,v 1.176 2003/03/10 20:21:45 matthew Exp $ +# $Id: lonspreadsheet.pm,v 1.180 2003/05/27 19:57:51 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -152,9 +152,9 @@ sub handler { $ENV{'form.ufn'} eq 'default')) { $ENV{'form.ufn'}='default_'.$1; } - if (!$ENV{'form.ufn'} || $ENV{'form.ufn'} eq 'default') { - $ENV{'form.ufn'}='course_default_'.$sheettype; - } +# if (!$ENV{'form.ufn'} || $ENV{'form.ufn'} eq 'default') { +# $ENV{'form.ufn'}='course_default_'.$sheettype; +# } # # Interactive loading of specific sheet? # @@ -352,6 +352,7 @@ ENDSCRIPT $oldsheets{'course'} ne $sheet->{'cid'}) { undef %oldsheets; undef %loadedcaches; + &Apache::lonspreadsheet::Spreadsheet::clear_package_variables(); } $oldsheets{'course'} = $sheet->{'cid'}; # @@ -534,6 +535,25 @@ my %defaultsheets; my %rowlabel_cache; #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 { my $self = shift; undef %spreadsheets; @@ -751,6 +771,15 @@ sub new { # 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 = { uname => $uname, udom => $udom, @@ -1523,7 +1552,7 @@ sub expandnamed { foreach my $varname ( @vars ) { if ($varname=~/\D/) { $formula=~s/$varname/'$c{\''.$varname.'\'}'/ge; - $varname=~s/$var/\([\\w:- ]\+\)/g; + $varname=~s/$var/\([\\w:\\- ]\+\)/g; foreach (keys(%{$self->{'constants'}})) { if ($_=~/$varname/) { $values{$1}=1;