--- loncom/interface/Attic/lonspreadsheet.pm 2003/03/07 04:20:20 1.174 +++ loncom/interface/Attic/lonspreadsheet.pm 2003/03/20 19:10:27 1.178 @@ -1,5 +1,5 @@ # -# $Id: lonspreadsheet.pm,v 1.174 2003/03/07 04:20:20 albertel Exp $ +# $Id: lonspreadsheet.pm,v 1.178 2003/03/20 19:10:27 matthew 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? # @@ -183,10 +183,7 @@ sub handler { # Header.... # $r->print('LON-CAPA Spreadsheet'); - my $nothing = "''"; - if ($ENV{'browser.type'} eq 'explorer') { - $nothing = "'javascript:void(0);'"; - } + my $nothing = &Apache::lonhtmlcommon::javascript_nothing(); if ($ENV{'request.role'} !~ /^st\./) { $r->print(<{'cid'}) { undef %oldsheets; undef %loadedcaches; + &Apache::lonspreadsheet::Spreadsheet::clear_package_variables(); } $oldsheets{'course'} = $sheet->{'cid'}; # @@ -537,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; @@ -754,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, @@ -1526,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;