--- loncom/interface/spreadsheet/lonspreadsheet.pm 2003/08/01 13:31:41 1.18 +++ loncom/interface/spreadsheet/lonspreadsheet.pm 2003/08/06 19:54:36 1.19 @@ -1,5 +1,5 @@ # -# $Id: lonspreadsheet.pm,v 1.18 2003/08/01 13:31:41 matthew Exp $ +# $Id: lonspreadsheet.pm,v 1.19 2003/08/06 19:54:36 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -226,7 +226,7 @@ sub handler { # Get query string for limited number of parameters # &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 # @@ -363,6 +363,30 @@ 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 &Apache::Spreadsheet::initialize_spreadsheet_package(); my $spreadsheet = undef; @@ -422,9 +446,24 @@ END } $r->rflush(); # + $r->print(""); if ($sheettype eq 'classcalc') { - $r->print('
'); + $r->print(''); + } + if ($allowed_to_view) { + $r->print(''); + } + if ($allowed_to_edit) { + $r->print(''); } + $r->print('
'. + ''. + &Apache::loncommon::help_open_topic("Spreadsheet_About", + 'Spreadsheet Help'). + ''. + &Apache::loncommon::help_open_topic("Spreadsheet_Editing", + 'Editing Help'). + '
'); # # Keep track of the filename $r->print(&hiddenfield('filename',$filename));