--- loncom/interface/lonquickgrades.pm 2011/06/04 19:49:28 1.101 +++ loncom/interface/lonquickgrades.pm 2015/03/13 22:06:10 1.105 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Quick Student Grades Display # -# $Id: lonquickgrades.pm,v 1.101 2011/06/04 19:49:28 www Exp $ +# $Id: lonquickgrades.pm,v 1.105 2015/03/13 22:06:10 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -29,7 +29,7 @@ package Apache::lonquickgrades; use strict; -use Apache::Constants qw(:common :http); +use Apache::Constants qw(:common :http REDIRECT); use POSIX; use Apache::loncommon; use Apache::lonlocal; @@ -38,6 +38,22 @@ use Apache::grades; use Apache::loncoursedata; use Apache::lonstudentassessment; +use Time::HiRes; +use Spreadsheet::WriteExcel; +use Spreadsheet::WriteExcel::Utility(); +# +# Excel data +# +my $excel_sheet; +my $excel_workbook; +my $filename; +my $format; +my $request_aborted; +my $header_row; +my $cols_output; +my %prog_state; + + sub handler { my $r = shift; return real_handler($r); @@ -59,6 +75,14 @@ sub real_handler { return OK; } + # Check for critical messages and redirect if present. + my ($redirect,$url) = &Apache::loncommon::critical_redirect(300); + if ($redirect) { + &Apache::loncommon::content_type($r,'text/html'); + $r->header_out(Location => $url); + return REDIRECT; + } + # Send header, don't cache this page &Apache::loncommon::no_cache($r); $r->send_http_header; @@ -245,7 +269,7 @@ sub startGradeScreen { if ($env{'form.symb'}) { $r->print("\n".'