version 1.28, 2006/08/18 15:15:39
|
version 1.32, 2014/02/12 16:53:09
|
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 .= '<nobr>'.&mt('Status: [_1]', |
|
'<input type="text" '. |
|
'name="spreadsheet_status" size="60" value="" />' |
|
).'</nobr>'; |
|
|
|
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 321 sub outsheet_htmlclasslist {
|
Line 316 sub outsheet_htmlclasslist {
|
# |
# |
if ($show_expire_link) { |
if ($show_expire_link) { |
$r->print('<a href="/adm/classcalc?output_format=htmlclasslist&'. |
$r->print('<a href="/adm/classcalc?output_format=htmlclasslist&'. |
'recalc=ilovewastingtime¬_first_run=1">'. |
'recalc=expireallsheets¬_first_run=1">'. |
&mt('Expire all student spreadsheets').'</a>'.$/); |
&mt('Expire all student spreadsheets').'</a>'.$/); |
} |
} |
# |
# |
$r->print('<h3>'. |
$r->print('<p class="LC_info">'. |
&mt('Click on a student to be taken to their spreadsheet'). |
&mt('Click on a student to be taken to their spreadsheet'). |
'</h3>'); |
'</p>'); |
# |
# |
my %header=&Apache::lonlocal::texthash( |
my %header=&Apache::lonlocal::texthash( |
'student' => 'Student', |
'student' => 'Student', |
Line 362 END
|
Line 357 END
|
$r->print("</table>\n".$tableheader); |
$r->print("</table>\n".$tableheader); |
} |
} |
my $link = '<a href="/adm/studentcalc?sname='.$student->{'username'}. |
my $link = '<a href="/adm/studentcalc?sname='.$student->{'username'}. |
'&sdomain='.$student->{'domain'}.'">'; |
'&sdomain='.$student->{'domain'}.'">'; |
$student->{'section'} = 'none' if ($student->{'section'} eq '-1'); |
$student->{'section'} = 'none' if ($student->{'section'} eq '-1'); |
$r->print('<tr>'. |
$r->print('<tr>'. |
'<td>'.$num_output.'</td>'. |
'<td>'.$num_output.'</td>'. |
Line 375 END
|
Line 370 END
|
if ($show_expire_link) { |
if ($show_expire_link) { |
$r->print('<td>'. |
$r->print('<td>'. |
'<a href="/adm/classcalc?recalc=student:'. |
'<a href="/adm/classcalc?recalc=student:'. |
$student->{'username'}.':'.$student->{'domain'}.'&'. |
$student->{'username'}.':'.$student->{'domain'}.'&'. |
'output_format=htmlclasslist&'. |
'output_format=htmlclasslist&'. |
'not_first_run=1'.'">Expire Record</a>'.$/); |
'not_first_run=1'.'">'.&mt('Expire Record').'</a>'.$/); |
} |
} |
$r->print("</tr>\n"); |
$r->print("</tr>\n"); |
} |
} |
Line 385 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 403 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 436 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; |