--- loncom/interface/spreadsheet/lonspreadsheet.pm 2004/03/01 16:40:44 1.36 +++ loncom/interface/spreadsheet/lonspreadsheet.pm 2004/10/12 20:51:54 1.39 @@ -1,5 +1,5 @@ # -# $Id: lonspreadsheet.pm,v 1.36 2004/03/01 16:40:44 matthew Exp $ +# $Id: lonspreadsheet.pm,v 1.39 2004/10/12 20:51:54 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -240,7 +240,8 @@ sub handler { # Get query string for limited number of parameters # &Apache::loncommon::get_unprocessed_cgi - ($ENV{'QUERY_STRING'},['sname','sdomain','usymb','filename','recalc']); + ($ENV{'QUERY_STRING'},['sname','sdomain','usymb','filename','recalc', + 'output_format','not_first_run']); # # Deal with restricted student permissions # @@ -292,8 +293,8 @@ sub handler { # Check that the student is in their section? if (exists($ENV{'request.course.sec'}) && $ENV{'request.course.sec'} ne '' ) { - my $stu_sec = &Apache::lonnet::usection($domain,$name, - $ENV{'request.course.id'}); + my $stu_sec = &Apache::lonnet::getsection($domain,$name, + $ENV{'request.course.id'}); if ($stu_sec ne $ENV{'request.course.sec'}) { $ENV{'user.error.msg'}= $r->uri.":vgr:0:0:Requested student not in your section."; @@ -399,23 +400,35 @@ ENDSCRIPT &Apache::loncoursedata::delete_caches($ENV{'requres.course.id'}); } if ($ENV{'form.recalc'} eq 'ilovewastingtime') { - &Apache::lonnet::logthis('ilovewastingtime'); + &Apache::lonnet::logthis('spreadsheet expired: entire course'); # expire ALL spreadsheets &Apache::lonnet::expirespread('','','studentcalc'); &Apache::lonnet::expirespread('','','assesscalc'); + $r->print('

'. + &mt('Expired spreadsheet caches for all students'). + '

'); } 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::logthis('spreadsheet expired: symb = '.$symb); &Apache::lonnet::expirespread('','','assesscalc',$symb); &Apache::lonnet::expirespread('','','studentcalc'); + $r->print('

'. + &mt('Expired spreadsheet caches for all students for symb [_1]', + $symb). + '

'); } 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); + &Apache::lonnet::logthis('spreadsheet expired: student = '. + $sname.'@'.$sdom); if (defined($sname) && defined($sdom)) { &Apache::lonnet::expirespread($sname,$sdom,'assesscalc'); &Apache::lonnet::expirespread($sname,$sdom,'studentcalc'); + $r->print('

'. + &mt('Expired spreadsheet caches for student [_1]', + $sname.'@'.$sdom). + '

'); } } } @@ -460,8 +473,10 @@ ENDSCRIPT } $action_message .= '.'; } - $r->print(''. - '
'.$spreadsheet->html_header().''.$html."
\n"); + $r->print(''. + '
'. + $spreadsheet->html_header(). + ''.$html."
\n"); if ($action_message ne '') { $r->print(<