--- loncom/interface/spreadsheet/assesscalc.pm	2006/09/03 00:39:57	1.56
+++ loncom/interface/spreadsheet/assesscalc.pm	2006/12/21 02:54:19	1.57
@@ -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 {
 ########################################################
 ########################################################
 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 @@ sub initialize_package {
         undef(%courseopt);
     }
     &load_cached_export_rows();
-    &load_parameter_caches();
+    &load_parameter_caches($calling_sheet);
     &Apache::loncoursedata::clear_internal_caches();
 }
 
@@ -202,6 +202,7 @@ sub initialize_package {
 ########################################################
 ########################################################
 sub load_parameter_caches {
+    my ($calling_sheet) = @_;
     my $userprefix = $current_name.':'.$current_domain.'_';
     $userprefix =~ s/:/_/g;
     #
@@ -234,6 +235,10 @@ sub load_parameter_caches {
     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 @@ sub ensure_current_caches {
         undef(%useropt);
         undef(%userdata);
     }
-    &load_parameter_caches();
+    &load_parameter_caches($self);
 }
 
 ##################################################