--- loncom/interface/Attic/lonspreadsheet.pm 2003/02/13 19:07:46 1.168 +++ loncom/interface/Attic/lonspreadsheet.pm 2003/02/13 22:52:48 1.171 @@ -1,5 +1,5 @@ # -# $Id: lonspreadsheet.pm,v 1.168 2003/02/13 19:07:46 matthew Exp $ +# $Id: lonspreadsheet.pm,v 1.171 2003/02/13 22:52:48 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -262,7 +262,6 @@ ENDSCRIPT # Global directory configs # $sheet->includedir($r->dir_config('lonIncludes')); - $sheet->tmpdir($r->dir_config('lonDaemons').'/tmp/'); # # Check user permissions if (($sheet->{'type'} eq 'classcalc' ) || @@ -524,18 +523,12 @@ my %numbertimes; # Directories # my $includedir; -my $tmpdir; sub includedir { my $self = shift; $includedir = shift; } -sub tmpdir { - my $self = shift; - $tmpdir = shift; -} - my %spreadsheets; #my %loadedcaches; my %courserdatas; @@ -1893,6 +1886,22 @@ sub dump_values_to_log { } $self->logthis("--------------------------------------------------------");} +## +## Yet another debugging function +## +sub dump_hash_to_log { + my $self= shift(); + my %tmp = @_; + if (@_<2) { + %tmp = %{$_[0]}; + } + $self->logthis('---------------------------- (entries end with ":"'); + while (my ($key,$val) = each (%tmp)) { + $self->logthis($key.' = '.$val.':'); + } + $self->logthis('---------------------------- (entries end with ":"'); +} + ################################ ## Helper functions ## ################################ @@ -2778,7 +2787,7 @@ sub tmpwrite { $ENV{'user.domain'}.'_spreadsheet_'.$self->{'usymb'}.'_'. $self->{'filename'}; $fn=~s/\W/\_/g; - $fn=$tmpdir.$fn.'.tmp'; + $fn=$Apache::lonnet::tmpdir.$fn.'.tmp'; my $fh; if ($fh=Apache::File->new('>'.$fn)) { my %f = $self->formulas(); @@ -2797,7 +2806,7 @@ sub tmpread { $ENV{'user.domain'}.'_spreadsheet_'.$self->{'usymb'}.'_'. $self->{'filename'}; $fn=~s/\W/\_/g; - $fn=$tmpdir.$fn.'.tmp'; + $fn=$Apache::lonnet::tmpdir.$fn.'.tmp'; my $fh; my %fo=(); my $countrows=0; @@ -3133,14 +3142,17 @@ sub loadstudent{ my %formulas = $self->formulas(); $cachedassess = $self->{'uname'}.':'.$self->{'udom'}; # Get ALL the student preformance data - my @tmp = &Apache::lonnet::currentdump($self->{'uname'}, - $self->{'udom'}, - $self->{'cid'}); + my @tmp = &Apache::loncoursedata::get_current_state($self->{'uname'}, + $self->{'udom'}, + undef, + $self->{'cid'}); if ((scalar @tmp > 0) && ($tmp[0] !~ /^error:/)) { %cachedstores = @tmp; } undef @tmp; - # + # debugging code + # $self->dump_hash_to_log(\%cachedstores); + # my @assessdata=(); foreach my $row ($self->rows()) { my $cell = 'A'.$row;