[LON-CAPA-cvs] cvs: loncom /interface/spreadsheet classcalc.pm

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 10 Sep 2003 14:47:42 -0000


matthew		Wed Sep 10 10:47:42 2003 EDT

  Modified files:              
    /loncom/interface/spreadsheet	classcalc.pm 
  Log:
  Added student id to excel and csv output.  Fixed bug with new parameters being
  passed in to csv_rows and excel_rows methods.
  
  
Index: loncom/interface/spreadsheet/classcalc.pm
diff -u loncom/interface/spreadsheet/classcalc.pm:1.12 loncom/interface/spreadsheet/classcalc.pm:1.13
--- loncom/interface/spreadsheet/classcalc.pm:1.12	Thu Sep  4 21:57:54 2003
+++ loncom/interface/spreadsheet/classcalc.pm	Wed Sep 10 10:47:42 2003
@@ -1,5 +1,5 @@
 #
-# $Id: classcalc.pm,v 1.12 2003/09/05 01:57:54 matthew Exp $
+# $Id: classcalc.pm,v 1.13 2003/09/10 14:47:42 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -202,11 +202,11 @@
     # writes the meat of the spreadsheet to an excel worksheet.  Called
     # by Spreadsheet::outsheet_excel;
     my $self = shift;
-    my ($worksheet,$cols_output,$rows_output) = @_;
+    my ($connection,$worksheet,$cols_output,$rows_output) = @_;
     #
     # Write a header row
     $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);
     }
     $rows_output++;    
@@ -221,7 +221,8 @@
                            $student->{'username'},
                            $student->{'domain'},
                            $student->{'section'},
-                           $student->{'status'});
+                           $student->{'status'},
+                           $student->{'id'});
         $self->excel_output_row($worksheet,$rownum,$rows_output++,
                                 @studentdata);
     }
@@ -232,12 +233,12 @@
     # writes the meat of the spreadsheet to an excel worksheet.  Called
     # by Spreadsheet::outsheet_excel;
     my $self = shift;
-    my ($filehandle) = @_;
+    my ($connection,$filehandle) = @_;
     #
     # Write a header row
 
     $self->csv_output_row($filehandle,undef,
-                          ('fullname','username','domain','section','status'));
+                   ('fullname','username','domain','section','status','id'));
     #
     # Write each students row
     foreach my $student (@Students) {
@@ -248,7 +249,8 @@
                            $student->{'username'},
                            $student->{'domain'},
                            $student->{'section'},
-                           $student->{'status'});
+                           $student->{'status'},
+                           $student->{'id'});
         $self->csv_output_row($filehandle,$rownum,@studentdata);
     }
     return;