[LON-CAPA-cvs] cvs: loncom /interface/spreadsheet assesscalc.pm
matthew
lon-capa-cvs@mail.lon-capa.org
Thu, 22 May 2003 20:06:09 -0000
matthew Thu May 22 16:06:09 2003 EDT
Modified files:
/loncom/interface/spreadsheet assesscalc.pm
Log:
All parameters are treated as strings, which fixes a most insidious bug.
Course level parameter data is no longer cached with the students name
prepended. &parmval reflects this change as well.
Removed excess &logthis call.
Index: loncom/interface/spreadsheet/assesscalc.pm
diff -u loncom/interface/spreadsheet/assesscalc.pm:1.2 loncom/interface/spreadsheet/assesscalc.pm:1.3
--- loncom/interface/spreadsheet/assesscalc.pm:1.2 Mon May 19 11:48:18 2003
+++ loncom/interface/spreadsheet/assesscalc.pm Thu May 22 16:06:09 2003
@@ -1,5 +1,5 @@
#
-# $Id: assesscalc.pm,v 1.2 2003/05/19 15:48:18 matthew Exp $
+# $Id: assesscalc.pm,v 1.3 2003/05/22 20:06:09 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -172,7 +172,7 @@
my $id = $ENV{'course.'.$ENV{'request.course.id'}.'.num'};
my %Tmp = &Apache::lonnet::dump('resourcedata',$dom,$id);
while (my ($name,$value) = each(%Tmp)) {
- $courseopt{$userprefix.$name}=$value;
+ $courseopt{$name}=$value;
}
}
if (! %useropt) {
@@ -199,7 +199,6 @@
########################################################
########################################################
-
sub ensure_current_parameter_caches {
my $self = shift;
if (! defined($current_course) ||
@@ -259,20 +258,25 @@
#
my $symbparm = $symb.'.'.$what;
my $mapparm = $mapname.'___(all).'.$what;
+ my $courseprefix = $self->{'cid'};
my $usercourseprefix = $uname.'_'.$udom.'_'.$self->{'cid'};
#
- my $seclevel = $usercourseprefix.'.['.$csec.'].'.$what;
- my $seclevelr = $usercourseprefix.'.['.$csec.'].'.$symbparm;
- my $seclevelm = $usercourseprefix.'.['.$csec.'].'.$mapparm;
- #
- my $courselevel = $usercourseprefix.'.'.$what;
- my $courselevelr = $usercourseprefix.'.'.$symbparm;
- my $courselevelm = $usercourseprefix.'.'.$mapparm;
+ my $seclevel = $courseprefix.'.['.$csec.'].'.$what;
+ my $seclevelr = $courseprefix.'.['.$csec.'].'.$symbparm;
+ my $seclevelm = $courseprefix.'.['.$csec.'].'.$mapparm;
+ #
+ my $courselevel = $courseprefix.'.'.$what;
+ my $courselevelr = $courseprefix.'.'.$symbparm;
+ my $courselevelm = $courseprefix.'.'.$mapparm;
+ #
+ my $ucourselevel = $usercourseprefix.'.'.$what;
+ my $ucourselevelr = $usercourseprefix.'.'.$symbparm;
+ my $ucourselevelm = $usercourseprefix.'.'.$mapparm;
# check user
if (defined($uname)) {
- return $useropt{$courselevelr} if (defined($useropt{$courselevelr}));
- return $useropt{$courselevelm} if (defined($useropt{$courselevelm}));
- return $useropt{$courselevel} if (defined($useropt{$courselevel}));
+ return $useropt{$ucourselevelr} if (defined($useropt{$ucourselevelr}));
+ return $useropt{$ucourselevelm} if (defined($useropt{$ucourselevelm}));
+ return $useropt{$ucourselevel} if (defined($useropt{$ucourselevel}));
}
# check section
if (defined($csec)) {
@@ -490,7 +494,7 @@
if (tie(%parmhash,'GDBM_File',
$self->{'coursefilename'}.'_parms.db',&GDBM_READER(),0640)) {
foreach my $parmname (keys(%parameters)) {
- my $value = $self->parmval($parmname);
+ my $value = $self->parmval($parmname);
$parameters{$parmname} =$value;
}
untie(%parmhash);
@@ -522,7 +526,7 @@
while (my ($parm,$value) = each(%parameters)) {
my $cell = 'A'.$self->get_row_number_from_key($parm);
$f{$cell} = $parm;
- $c{$parm} = $value;
+ $c{$parm} = '"'.$value.'"';
}
$self->formulas(%f);
$self->constants(%c);
@@ -604,7 +608,6 @@
########################################################
sub load_cached_export_rows {
%Exportrows = undef;
- &Apache::lonnet::logthis("loading cached assess sheets for $current_name $current_domain");
my @tmp = &Apache::lonnet::dump('nohist_calculatedsheets_'.
$ENV{'request.course.id'},
$current_domain,$current_name,undef);