Diff for /loncom/interface/spreadsheet/classcalc.pm between versions 1.10 and 1.13

version 1.10, 2003/06/23 19:58:18 version 1.13, 2003/09/10 14:47:42
Line 46  classcalc Line 46  classcalc
 package Apache::classcalc;  package Apache::classcalc;
   
 use strict;  use strict;
   use warnings FATAL=>'all';
   no warnings 'uninitialized';
 use Apache::Constants qw(:common :http);  use Apache::Constants qw(:common :http);
 use Apache::loncoursedata();  use Apache::loncoursedata();
 use Apache::lonhtmlcommon();  use Apache::lonhtmlcommon();
Line 71  sub initialize { Line 73  sub initialize {
     return;      return;
 }  }
   
   sub clear_package {
       undef(@Students);
       &Apache::studentcalc::clear_package();
   }
   
 sub html_header {  sub html_header {
     my $self = shift;      my $self = shift;
     my ($toprow,$bottomrow);      my ($toprow,$bottomrow);
Line 195  sub excel_rows { Line 202  sub excel_rows {
     # writes the meat of the spreadsheet to an excel worksheet.  Called      # writes the meat of the spreadsheet to an excel worksheet.  Called
     # by Spreadsheet::outsheet_excel;      # by Spreadsheet::outsheet_excel;
     my $self = shift;      my $self = shift;
     my ($worksheet,$cols_output,$rows_output) = @_;      my ($connection,$worksheet,$cols_output,$rows_output) = @_;
     #      #
     # Write a header row      # Write a header row
     $cols_output = 0;      $cols_output = 0;
     foreach my $value ('fullname','username','domain','section','status') {      foreach my $value ('fullname','username','domain','section','status','id') {
         $worksheet->write($rows_output,$cols_output++,$value);          $worksheet->write($rows_output,$cols_output++,$value);
     }      }
     $rows_output++;          $rows_output++;    
Line 214  sub excel_rows { Line 221  sub excel_rows {
                            $student->{'username'},                             $student->{'username'},
                            $student->{'domain'},                             $student->{'domain'},
                            $student->{'section'},                             $student->{'section'},
                            $student->{'status'});                             $student->{'status'},
                              $student->{'id'});
         $self->excel_output_row($worksheet,$rownum,$rows_output++,          $self->excel_output_row($worksheet,$rownum,$rows_output++,
                                 @studentdata);                                  @studentdata);
     }      }
Line 225  sub csv_rows { Line 233  sub csv_rows {
     # writes the meat of the spreadsheet to an excel worksheet.  Called      # writes the meat of the spreadsheet to an excel worksheet.  Called
     # by Spreadsheet::outsheet_excel;      # by Spreadsheet::outsheet_excel;
     my $self = shift;      my $self = shift;
     my ($filehandle) = @_;      my ($connection,$filehandle) = @_;
     #      #
     # Write a header row      # Write a header row
   
     $self->csv_output_row($filehandle,undef,      $self->csv_output_row($filehandle,undef,
                           ('fullname','username','domain','section','status'));                     ('fullname','username','domain','section','status','id'));
     #      #
     # Write each students row      # Write each students row
     foreach my $student (@Students) {      foreach my $student (@Students) {
Line 241  sub csv_rows { Line 249  sub csv_rows {
                            $student->{'username'},                             $student->{'username'},
                            $student->{'domain'},                             $student->{'domain'},
                            $student->{'section'},                             $student->{'section'},
                            $student->{'status'});                             $student->{'status'},
                              $student->{'id'});
         $self->csv_output_row($filehandle,$rownum,@studentdata);          $self->csv_output_row($filehandle,$rownum,@studentdata);
     }      }
     return;      return;
Line 255  sub outsheet_recursive_excel { Line 264  sub outsheet_recursive_excel {
 sub compute {  sub compute {
     my $self = shift;      my $self = shift;
     my ($r) = @_;      my ($r) = @_;
       my $connection = $r->connection();
       if ($connection->aborted()) { $self->cleanup(); return; }
     $self->initialize_safe_space();      $self->initialize_safe_space();
     my %c = $self->constants();      my %c = $self->constants();
     my %f = $self->formulas();      my %f = $self->formulas();
Line 267  sub compute { Line 278  sub compute {
     &Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,      &Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state,
                                           'Processing first student');                                            'Processing first student');
     foreach my $student (@Students) {      foreach my $student (@Students) {
           if ($connection->aborted()) { $self->cleanup(); return; }
         my $sname = $student->{'username'}.':'.$student->{'domain'};          my $sname = $student->{'username'}.':'.$student->{'domain'};
  my $studentsheet = Apache::studentcalc->new   my $studentsheet = Apache::studentcalc->new
     ($student->{'username'},$student->{'domain'},undef);      ($student->{'username'},$student->{'domain'},undef);
  my @exportdata = $studentsheet->export_data();          if ($connection->aborted()) { $self->cleanup(); return; }
    my @exportdata = $studentsheet->export_data($r);
           if ($connection->aborted()) { $self->cleanup(); return; }
  my $rownum = $self->get_row_number_from_key($sname);   my $rownum = $self->get_row_number_from_key($sname);
         $f{'A'.$rownum} = $sname;          $f{'A'.$rownum} = $sname;
         $self->{'row_source'}->{$rownum} = $sname;          $self->{'row_source'}->{$rownum} = $sname;

Removed from v.1.10  
changed lines
  Added in v.1.13


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