[LON-CAPA-cvs] cvs: loncom /interface/spreadsheet assesscalc.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Sun, 15 May 2005 02:40:27 -0000
albertel Sat May 14 22:40:27 2005 EDT
Modified files:
/loncom/interface/spreadsheet assesscalc.pm
Log:
- moving the decode_symb out of the way inner loop saves us about 2 seconds, down to about 11.5 secodns to complet calc a student now (from 93)
Index: loncom/interface/spreadsheet/assesscalc.pm
diff -u loncom/interface/spreadsheet/assesscalc.pm:1.43 loncom/interface/spreadsheet/assesscalc.pm:1.44
--- loncom/interface/spreadsheet/assesscalc.pm:1.43 Sat May 14 22:28:23 2005
+++ loncom/interface/spreadsheet/assesscalc.pm Sat May 14 22:40:26 2005
@@ -1,5 +1,5 @@
#
-# $Id: assesscalc.pm,v 1.43 2005/05/15 02:28:23 albertel Exp $
+# $Id: assesscalc.pm,v 1.44 2005/05/15 02:40:26 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -301,7 +301,7 @@
##################################################
sub parmval {
my $self = shift;
- my ($what,$symb,$uname,$udom,$csec,$recurse)=@_;
+ my ($what,$symb,$uname,$udom,$csec,$recurse,$mapname,$id,$fn)=@_;
$uname = $self->{'name'} if (! defined($uname));
$udom = $self->{'domain'} if (! defined($udom));
$csec = $self->{'section'} if (! defined($csec));
@@ -310,7 +310,9 @@
my $result='';
#
# This should be a
- my ($mapname,$id,$fn)=&Apache::lonnet::decode_symb($symb);
+ if (!defined($mapname) || !defined($id) || !defined($fn)) {
+ ($mapname,$id,$fn)=&Apache::lonnet::decode_symb($symb);
+ }
# Cascading lookup scheme
my $rwhat=$what;
$what =~ s/^parameter\_//;
@@ -367,7 +369,8 @@
if ($part eq '') { $part='0'; }
my $newwhat=$rwhat;
$newwhat=~s/\Q$space\E/$part/;
- my $partgeneral=$self->parmval($newwhat,$symb,$uname,$udom,$csec,1);
+ my $partgeneral=$self->parmval($newwhat,$symb,$uname,$udom,$csec,1,
+ $mapname,$id,$fn);
if (defined($partgeneral)) { return $partgeneral; }
}
if ($recurse) { return undef; }
@@ -627,8 +630,9 @@
my $filename = $self->{'coursefilename'}.'_parms.db';
if (tie(%parmhash,'GDBM_File',
$self->{'coursefilename'}.'_parms.db',&GDBM_READER(),0640)) {
+ my ($mapname,$id,$fn)=&Apache::lonnet::decode_symb($self->{'symb'});
foreach my $parmname (@Parameters) {
- my $value = $self->parmval($parmname);
+ my $value = $self->parmval($parmname,$self->{'name'},$self->{'domain'},$self->{'section'},$self->{'symb'},undef,$mapname,$id,$fn);
$parameters{$parmname} =$value;
}
untie(%parmhash);