--- loncom/interface/Attic/lonspreadsheet.pm 2001/01/20 22:57:05 1.36
+++ loncom/interface/Attic/lonspreadsheet.pm 2001/01/22 18:22:51 1.37
@@ -3,7 +3,7 @@
#
# 11/11,11/15,11/27,12/04,12/05,12/06,12/07,
# 12/08,12/09,12/11,12/12,12/15,12/16,12/18,12/19,12/30,
-# 01/01/01,02/01,03/01,19/01,20/01 Gerd Kortemeyer
+# 01/01/01,02/01,03/01,19/01,20/01,22/01 Gerd Kortemeyer
package Apache::lonspreadsheet;
@@ -1217,17 +1217,32 @@ sub loadstudent {
# --------------------------------------------------- Load data for one student
sub loadcourse {
- my $safeeval=shift;
+ my ($safeeval,$r)=@_;
my %c=();
my %f=&getformulas($safeeval);
+ my $total=0;
+ map {
+ if ($_=~/^A(\d+)/) {
+ unless ($f{$_}=~/^\!/) { $total++; }
+ }
+ } keys %f;
+ my $now=0;
+ my $since=time;
+ $r->print('
');
+ $r->rflush();
map {
if ($_=~/^A(\d+)/) {
my $row=$1;
unless ($f{$_}=~/^\!/) {
- my @studentdata=&exportsheet(&getuname($safeeval),
- &getudom($safeeval),
+ my @studentdata=&exportsheet(split(/\:/,$f{$_}),
'studentcalc');
- undef %userrdatas;
+ undef %userrdatas;
+ $now++;
+ $r->print(''."\n");
+ $r->rflush();
+
my $index=0;
map {
if ($studentdata[$index]) {
@@ -1244,6 +1259,9 @@ sub loadcourse {
} keys %f;
&setformulas($safeeval,%f);
&setconstants($safeeval,%c);
+ $r->print(''.
+ "
\n");
+ $r->rflush();
}
# ------------------------------------------------ Load data for one assessment
@@ -1392,11 +1410,11 @@ sub updatesheet {
# Import the data for rows
#
-sub loadrows() {
- my $safeeval=shift;
+sub loadrows {
+ my ($safeeval,$r)=@_;
my $stype=&gettype($safeeval);
if ($stype eq 'classcalc') {
- &loadcourse($safeeval);
+ &loadcourse($safeeval,$r);
} elsif ($stype eq 'studentcalc') {
&loadstudent($safeeval);
} else {
@@ -1599,7 +1617,7 @@ ENDSCRIPT
$r->print("Updated rows, loading row data ...
\n");
$r->rflush();
- &loadrows($asheet);
+ &loadrows($asheet,$r);
$r->print("Loaded row data, calculating sheet ...
\n");
$r->rflush();