Diff for /loncom/interface/statistics/lonstudentassessment.pm between versions 1.124 and 1.125

version 1.124, 2005/04/19 01:28:25 version 1.125, 2005/08/26 21:53:23
Line 622  Return a line of the chart for a student Line 622  Return a line of the chart for a student
     my @sequences;      my @sequences;
     my $navmap; # Have to keep this around since weakref is a bit zealous      my $navmap; # Have to keep this around since weakref is a bit zealous
   
   sub html_cleanup {
       undef(%prog_state);
       undef(%width);
       #
       undef($navmap);
       undef(@sequences);
   }
   
 sub html_initialize {  sub html_initialize {
     my ($r) = @_;      my ($r) = @_;
     #      #
     $padding = ' 'x3;      $padding = ' 'x3;
     $count = 0;      $count = 0;
     $nodata_count = 0;      $nodata_count = 0;
     undef(%prog_state);      &html_cleanup();
     undef(%width);  
     #  
     undef($navmap);  
     undef(@sequences);  
     ($navmap,@sequences) =       ($navmap,@sequences) = 
         &Apache::lonstatistics::selected_sequences_with_assessments();          &Apache::lonstatistics::selected_sequences_with_assessments();
     if (! ref($navmap)) {      if (! ref($navmap)) {
Line 856  sub html_finish { Line 860  sub html_finish {
     }      }
     $r->rflush();      $r->rflush();
     &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);      &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
     undef($navmap);      &html_cleanup();
     return;      return;
 }  }
   
Line 963  my %formula_data; Line 967  my %formula_data;
 my $navmap;  my $navmap;
 my @sequences;  my @sequences;
   
 sub excel_initialize {  sub excel_cleanup {
     my ($r) = @_;  
     #      #
     undef ($excel_sheet);      undef ($excel_sheet);
     undef ($excel_workbook);      undef ($excel_workbook);
Line 980  sub excel_initialize { Line 983  sub excel_initialize {
     #      #
     undef($navmap);      undef($navmap);
     undef(@sequences);      undef(@sequences);
   }
   
   sub excel_initialize {
       my ($r) = @_;
   
       &excel_cleanup();
     ($navmap,@sequences) =       ($navmap,@sequences) = 
         &Apache::lonstatistics::selected_sequences_with_assessments();          &Apache::lonstatistics::selected_sequences_with_assessments();
     if (! ref($navmap)) {      if (! ref($navmap)) {
Line 1465  sub excel_outputstudent { Line 1474  sub excel_outputstudent {
 sub excel_finish {  sub excel_finish {
     my ($r) = @_;      my ($r) = @_;
     if ($request_aborted || ! defined($navmap) || ! defined($excel_sheet)) {      if ($request_aborted || ! defined($navmap) || ! defined($excel_sheet)) {
    &excel_cleanup();
         return;          return;
     }      }
     #      #
     # Write the excel file      # Write the excel file
     $excel_workbook->close();      $excel_workbook->close();
     my $c = $r->connection();  
     #  
     return if($c->aborted());  
     #      #
     # Close the progress window      # Close the progress window
     &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);      &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
Line 1481  sub excel_finish { Line 1488  sub excel_finish {
     $r->print('<br />'.      $r->print('<br />'.
               '<a href="'.$filename.'">Your Excel spreadsheet.</a>'."\n");                '<a href="'.$filename.'">Your Excel spreadsheet.</a>'."\n");
     $r->rflush();      $r->rflush();
       &excel_cleanup();
     return;      return;
 }  }
   
Line 1511  my %prog_state; # progress window state Line 1519  my %prog_state; # progress window state
 my $navmap;  my $navmap;
 my @sequences;  my @sequences;
   
 sub csv_initialize{  sub csv_cleanup {
     my ($r) = @_;  
     #   
     # Clean up  
     undef($outputfile);      undef($outputfile);
     undef($filename);      undef($filename);
     undef($request_aborted);      undef($request_aborted);
Line 1522  sub csv_initialize{ Line 1527  sub csv_initialize{
     #      #
     undef($navmap);      undef($navmap);
     undef(@sequences);      undef(@sequences);
   }
   
   sub csv_initialize{
       my ($r) = @_;
   
       &csv_cleanup();
     ($navmap,@sequences) =       ($navmap,@sequences) = 
         &Apache::lonstatistics::selected_sequences_with_assessments();          &Apache::lonstatistics::selected_sequences_with_assessments();
     if (! ref($navmap)) {      if (! ref($navmap)) {
Line 1707  sub csv_outputstudent { Line 1718  sub csv_outputstudent {
 sub csv_finish {  sub csv_finish {
     my ($r) = @_;      my ($r) = @_;
     if ($request_aborted || ! defined($navmap) || ! defined($outputfile)) {      if ($request_aborted || ! defined($navmap) || ! defined($outputfile)) {
    &csv_cleanup();
         return;          return;
     }      }
     close($outputfile);      close($outputfile);
     #      #
     my $c = $r->connection();  
     return if ($c->aborted());  
     #  
     # Close the progress window      # Close the progress window
     &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);      &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
     #      #
Line 1721  sub csv_finish { Line 1730  sub csv_finish {
     $r->print('<br />'.      $r->print('<br />'.
               '<a href="'.$filename.'">'.&mt('Your csv file.').'</a>'."\n");                '<a href="'.$filename.'">'.&mt('Your csv file.').'</a>'."\n");
     $r->rflush();      $r->rflush();
       &csv_cleanup();
     return;      return;
           
 }  }

Removed from v.1.124  
changed lines
  Added in v.1.125


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