version 1.18, 2003/08/01 13:31:41
|
version 1.23, 2003/09/05 01:06:45
|
Line 54 built-in functions.
|
Line 54 built-in functions.
|
package Apache::lonspreadsheet; |
package Apache::lonspreadsheet; |
|
|
use strict; |
use strict; |
|
use warnings FATAL=>'all'; |
|
no warnings 'uninitialized'; |
use Apache::classcalc(); |
use Apache::classcalc(); |
use Apache::studentcalc(); |
use Apache::studentcalc(); |
use Apache::assesscalc(); |
use Apache::assesscalc(); |
Line 165 END
|
Line 167 END
|
} |
} |
$load_dialog .= '>'.$sheetfilename."</option>\n"; |
$load_dialog .= '>'.$sheetfilename."</option>\n"; |
} |
} |
$load_dialog .= "</td><td> </td></tr>\n</table>\n"; |
$load_dialog .= "</select>\n</td><td> </td></tr>\n</table>\n"; |
# |
# |
$result .=<<END; |
$result .=<<END; |
|
<!-- |
|
<fieldset title="File Dialogs" > |
|
<legend>File Dialogs</legend> |
|
--> |
<!-- load / save dialogs --> |
<!-- load / save dialogs --> |
<table cellspacing="2"> |
<table cellspacing="2"> |
<tr> |
<tr> |
Line 180 END
|
Line 186 END
|
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
|
<!-- |
|
</fieldset> |
|
--> |
END |
END |
return ($result,$message); |
return ($result,$message); |
} |
} |
Line 226 sub handler {
|
Line 235 sub handler {
|
# Get query string for limited number of parameters |
# Get query string for limited number of parameters |
# |
# |
&Apache::loncommon::get_unprocessed_cgi |
&Apache::loncommon::get_unprocessed_cgi |
($ENV{'QUERY_STRING'},['sname','sdomain','usymb','filename']); |
($ENV{'QUERY_STRING'},['sname','sdomain','usymb','filename','recalc']); |
# |
# |
# Deal with restricted student permissions |
# Deal with restricted student permissions |
# |
# |
Line 363 ENDSCRIPT
|
Line 372 ENDSCRIPT
|
} |
} |
} |
} |
## |
## |
|
## Take care of "backdoor" spreadsheet expiration / recalc stuff |
|
if ($allowed_to_edit && exists($ENV{'form.recalc'})) { |
|
if ($ENV{'form.recalc'} eq 'ilovewastingtime') { |
|
&Apache::lonnet::logthis('ilovewastingtime'); |
|
# expire ALL spreadsheets |
|
&Apache::lonnet::expirespread('','','studentcalc'); |
|
&Apache::lonnet::expirespread('','','assesscalc'); |
|
} elsif ($ENV{'form.recalc'} =~ /^symb:/) { |
|
# expire for all students on this symb |
|
my ($symb) = ($ENV{'form.recalc'} =~ /^symb:(.*)$/); |
|
&Apache::lonnet::logthis('symb = '.$symb); |
|
&Apache::lonnet::expirespread('','','assesscalc',$symb); |
|
&Apache::lonnet::expirespread('','','studentcalc'); |
|
} elsif ($ENV{'form.recalc'} =~ /^student:/) { |
|
# expire all assessment spreadsheets for this user |
|
my ($sname,$sdom) = ($ENV{'form.recalc'}=~/^student:(.*):(.*)$/); |
|
&Apache::lonnet::logthis('student = '.$sname.':'.$sdom); |
|
if (defined($sname) && defined($sdom)) { |
|
&Apache::lonnet::expirespread($sname,$sdom,'assesscalc'); |
|
&Apache::lonnet::expirespread($sname,$sdom,'studentcalc'); |
|
} |
|
} |
|
} |
|
## |
## Make the spreadsheet |
## Make the spreadsheet |
&Apache::Spreadsheet::initialize_spreadsheet_package(); |
&Apache::Spreadsheet::initialize_spreadsheet_package(); |
my $spreadsheet = undef; |
my $spreadsheet = undef; |
Line 422 END
|
Line 455 END
|
} |
} |
$r->rflush(); |
$r->rflush(); |
# |
# |
|
$r->print("<table><tr>"); |
if ($sheettype eq 'classcalc') { |
if ($sheettype eq 'classcalc') { |
$r->print('<input type="submit" value="Generate Spreadsheet" /><br />'); |
$r->print('<td><input type="submit" value="Generate Spreadsheet" />'. |
|
'</td>'); |
|
} |
|
if ($allowed_to_view) { |
|
$r->print('<td>'. |
|
&Apache::loncommon::help_open_topic("Spreadsheet_About", |
|
'Spreadsheet Help'). |
|
'</td>'); |
|
} |
|
if ($allowed_to_edit) { |
|
$r->print('<td>'. |
|
&Apache::loncommon::help_open_topic("Spreadsheet_Editing", |
|
'Editing Help'). |
|
'</td>'); |
} |
} |
|
$r->print('</tr></table>'); |
# |
# |
# Keep track of the filename |
# Keep track of the filename |
$r->print(&hiddenfield('filename',$filename)); |
$r->print(&hiddenfield('filename',$filename)); |