Diff for /loncom/interface/lonquickgrades.pm between versions 1.101 and 1.102

version 1.101, 2011/06/04 19:49:28 version 1.102, 2011/06/25 20:12:56
Line 38  use Apache::grades; Line 38  use Apache::grades;
 use Apache::loncoursedata;  use Apache::loncoursedata;
 use Apache::lonstudentassessment;  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 {  sub handler {
     my $r = shift;      my $r = shift;
     return real_handler($r);      return real_handler($r);
Line 259  sub endGradeScreen { Line 275  sub endGradeScreen {
    $r->print('</div></div></div>'.&Apache::loncommon::end_page());     $r->print('</div></div></div>'.&Apache::loncommon::end_page());
 }  }
   
   # -----------
   
   
   sub excel_cleanup {
       undef ($excel_sheet);
       undef ($excel_workbook);
       undef ($filename);
       undef ($format);
   }
   
   
   sub excel_initialize {
       my ($r) = @_;
   
       &excel_cleanup();
   
       # Create sheet
       ($excel_workbook,$filename,$format)=
           &Apache::loncommon::create_workbook($r);
       return if (! defined($excel_workbook));
      #
      # Add a worksheet
       my $sheetname = $env{'course.'.$env{'request.course.id'}.'.description'};
       $sheetname = &Apache::loncommon::clean_excel_name($sheetname);
       $excel_sheet = $excel_workbook->addworksheet($sheetname);
      #
      # Put the course description in the header
       $excel_sheet->write($header_row,$cols_output++,
                      $env{'course.'.$env{'request.course.id'}.'.description'},
                           $format->{'h1'});
   } 
   
   sub excel_finish {
       my ($r) = @_;
       if ($request_aborted || ! defined($excel_sheet)) {
           &excel_cleanup();
           return;
       }
       #
       # Write the excel file
       $excel_workbook->close();
       #
       # Close the progress window
       &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
       #
       # Tell the user where to get their excel file
       $r->print('<br />'.
                 '<a href="'.$filename.'">'.&mt('Your Excel spreadsheet').'</a>'."\n");
       $r->rflush();
       &excel_cleanup();
       return;
   }
   
   
   #
   # CSV data
   #
   # -----------
   
   #
   # Go through the complete course and collect data
   #
   
 sub getData {  sub getData {
   

Removed from v.1.101  
changed lines
  Added in v.1.102


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>