version 1.30, 2010/12/03 21:33:56
|
version 1.31, 2011/12/21 21:25:46
|
Line 91 sub html_header {
|
Line 91 sub html_header {
|
$toprow .= '<th align="center"><b>'.&mt($name).'</b></th>'; |
$toprow .= '<th align="center"><b>'.&mt($name).'</b></th>'; |
$bottomrow .= '<td>'.$selector.'</td>'; |
$bottomrow .= '<td>'.$selector.'</td>'; |
} |
} |
my $status .= '<p><span class="LC_nobreak">' |
|
.&mt('Status: [_1]', |
|
'<input type="text" name="spreadsheet_status"' |
|
.' size="60" value="" readonly="readonly" />') |
|
.'</span></p>'; |
|
|
|
return "<p>\n<table>\n". |
return "<p>\n<table>\n". |
"<tr>".$toprow."</tr>\n". |
"<tr>".$toprow."</tr>\n". |
"<tr>".$bottomrow."</tr>\n". |
"<tr>".$bottomrow."</tr>\n". |
"</table>\n".$status."\n". |
"</table>\n". |
"</p>"; |
"</p>"; |
} |
} |
|
|
Line 386 END
|
Line 380 END
|
return; |
return; |
} |
} |
|
|
sub update_status { |
|
my ($r,$message) = @_; |
|
$r->print('<script>'. |
|
'window.document.sheet.spreadsheet_status.value="'. |
|
$message. |
|
'";</script>'); |
|
$r->rflush(); |
|
return; |
|
} |
|
|
|
sub compute { |
sub compute { |
my $self = shift; |
my $self = shift; |
my ($r) = @_; |
my ($r) = @_; |
Line 404 sub compute {
|
Line 388 sub compute {
|
$self->initialize_safe_space(); |
$self->initialize_safe_space(); |
my %c = $self->constants(); |
my %c = $self->constants(); |
my %f = $self->formulas(); |
my %f = $self->formulas(); |
&update_status($r,'Initializing Course Structure'); |
|
&Apache::studentcalc::initialize_package(); |
&Apache::studentcalc::initialize_package(); |
my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin |
my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,scalar(@Students)); |
($r,&mt('Spreadsheet Computation Status'), |
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,&mt('Processing first student')); |
&mt('Spreadsheet Computation'), scalar(@Students),'inline',undef, |
|
'sheet','spreadsheet_status'); |
|
&Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state, |
|
&mt('Processing first student')); |
|
foreach my $student (@Students) { |
foreach my $student (@Students) { |
if ($connection->aborted()) { $self->cleanup(); return; } |
if ($connection->aborted()) { $self->cleanup(); return; } |
my $sname = $student->{'username'}.':'.$student->{'domain'}; |
my $sname = $student->{'username'}.':'.$student->{'domain'}; |
Line 437 sub compute {
|
Line 416 sub compute {
|
$c{$cell} = $data; |
$c{$cell} = $data; |
} |
} |
} |
} |
&Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, |
&Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,'last student'); |
'last student'); |
|
} |
} |
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); |
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); |
&update_status($r,'Done computing student sheets'); |
|
$r->rflush(); |
$r->rflush(); |
$self->constants(\%c); |
$self->constants(\%c); |
$self->formulas(\%f); |
$self->formulas(\%f); |
$self->calcsheet(); |
$self->calcsheet(); |
$self->save() if ($self->need_to_save()); |
$self->save() if ($self->need_to_save()); |
&update_status($r,'Done!'); |
|
} |
} |
|
|
1; |
1; |