[LON-CAPA-cvs] cvs: loncom /interface/spreadsheet assesscalc.pm studentcalc.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Thu, 21 Dec 2006 02:54:19 -0000
albertel Wed Dec 20 21:54:19 2006 EDT
Modified files:
/loncom/interface/spreadsheet assesscalc.pm studentcalc.pm
Log:
- notice and announce when errors occur trying to calculate spreadsheets
Index: loncom/interface/spreadsheet/assesscalc.pm
diff -u loncom/interface/spreadsheet/assesscalc.pm:1.56 loncom/interface/spreadsheet/assesscalc.pm:1.57
--- loncom/interface/spreadsheet/assesscalc.pm:1.56 Sat Sep 2 20:39:57 2006
+++ loncom/interface/spreadsheet/assesscalc.pm Wed Dec 20 21:54:19 2006
@@ -1,5 +1,5 @@
#
-# $Id: assesscalc.pm,v 1.56 2006/09/03 00:39:57 albertel Exp $
+# $Id: assesscalc.pm,v 1.57 2006/12/21 02:54:19 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -174,7 +174,7 @@
########################################################
########################################################
sub initialize_package {
- my ($sname,$sdomain,$in_navmap) = @_;
+ my ($sname,$sdomain,$in_navmap,$calling_sheet) = @_;
$current_name = $sname;
$current_domain = $sdomain;
$navmap = $in_navmap;
@@ -185,7 +185,7 @@
undef(%courseopt);
}
&load_cached_export_rows();
- &load_parameter_caches();
+ &load_parameter_caches($calling_sheet);
&Apache::loncoursedata::clear_internal_caches();
}
@@ -202,6 +202,7 @@
########################################################
########################################################
sub load_parameter_caches {
+ my ($calling_sheet) = @_;
my $userprefix = $current_name.':'.$current_domain.'_';
$userprefix =~ s/:/_/g;
#
@@ -234,6 +235,10 @@
if (! %userdata) {
%userdata = &Apache::loncoursedata::get_current_state($current_name,
$current_domain);
+ my ($tmp) = %userdata;
+ if ($tmp =~ /^error:(.*)/) {
+ $calling_sheet->set_calcerror($1);
+ }
$userdata{'loadtime'} = time;
}
return;
@@ -272,7 +277,7 @@
undef(%useropt);
undef(%userdata);
}
- &load_parameter_caches();
+ &load_parameter_caches($self);
}
##################################################
Index: loncom/interface/spreadsheet/studentcalc.pm
diff -u loncom/interface/spreadsheet/studentcalc.pm:1.41 loncom/interface/spreadsheet/studentcalc.pm:1.42
--- loncom/interface/spreadsheet/studentcalc.pm:1.41 Mon Oct 2 13:04:33 2006
+++ loncom/interface/spreadsheet/studentcalc.pm Wed Dec 20 21:54:19 2006
@@ -1,5 +1,5 @@
#
-# $Id: studentcalc.pm,v 1.41 2006/10/02 17:04:33 raeburn Exp $
+# $Id: studentcalc.pm,v 1.42 2006/12/21 02:54:19 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -554,7 +554,7 @@
}
$self->initialize_safe_space();
&Apache::assesscalc::initialize_package($self->{'name'},$self->{'domain'},
- $navmap);
+ $navmap,$self);
my %f = $self->formulas();
#
# Process the formulas list -