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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 06 Apr 2006 16:43:52 -0000


albertel		Thu Apr  6 12:43:52 2006 EDT

  Modified files:              
    /loncom/interface/spreadsheet	Spreadsheet.pm classcalc.pm 
                                 	lonspreadsheet.pm studentcalc.pm 
  Log:
  - #self->{'section'} never got set
  
  
Index: loncom/interface/spreadsheet/Spreadsheet.pm
diff -u loncom/interface/spreadsheet/Spreadsheet.pm:1.65 loncom/interface/spreadsheet/Spreadsheet.pm:1.66
--- loncom/interface/spreadsheet/Spreadsheet.pm:1.65	Sun Mar  5 16:38:27 2006
+++ loncom/interface/spreadsheet/Spreadsheet.pm	Thu Apr  6 12:43:49 2006
@@ -1,5 +1,5 @@
 #
-# $Id: Spreadsheet.pm,v 1.65 2006/03/05 21:38:27 bowersj2 Exp $
+# $Id: Spreadsheet.pm,v 1.66 2006/04/06 16:43:49 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -85,7 +85,7 @@
     my $class = ref($this) || $this;
     my ($stype) = ($class =~ /Apache::(.*)$/);
     #
-    my ($name,$domain,$filename,$usymb)=@_;
+    my ($name,$domain,$filename,$usymb,$section)=@_;
     if (defined($usymb) && ref($usymb)) {
         $usymb = $usymb->symb;
     }
@@ -95,10 +95,15 @@
     if (! defined($domain) || $domain eq '') {
         $domain = $env{'user.domain'};
     }
+    if (! defined($section) || $section eq '') {
+        $section = &Apache::lonnet::getsection($domain,$name,
+					       $env{'request.course.id'});
+    }
     #
     my $self = {
         name     => $name,
         domain   => $domain,
+        section  => $section,
         type     => $stype,
         symb     => $usymb,
         errorlog => '',
Index: loncom/interface/spreadsheet/classcalc.pm
diff -u loncom/interface/spreadsheet/classcalc.pm:1.24 loncom/interface/spreadsheet/classcalc.pm:1.25
--- loncom/interface/spreadsheet/classcalc.pm:1.24	Sun Feb 26 19:56:47 2006
+++ loncom/interface/spreadsheet/classcalc.pm	Thu Apr  6 12:43:49 2006
@@ -1,5 +1,5 @@
 #
-# $Id: classcalc.pm,v 1.24 2006/02/27 00:56:47 bowersj2 Exp $
+# $Id: classcalc.pm,v 1.25 2006/04/06 16:43:49 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -406,7 +406,8 @@
         if ($connection->aborted()) { $self->cleanup(); return; }
         my $sname = $student->{'username'}.':'.$student->{'domain'};
 	my $studentsheet = Apache::studentcalc->new
-	    ($student->{'username'},$student->{'domain'},undef);
+	    ($student->{'username'},$student->{'domain'},undef,undef,
+	     $student->{'section'} );
         if ($connection->aborted()) { $self->cleanup(); return; }
 	my @exportdata = $studentsheet->export_data($r);
         if ($studentsheet->badcalc()) {
Index: loncom/interface/spreadsheet/lonspreadsheet.pm
diff -u loncom/interface/spreadsheet/lonspreadsheet.pm:1.42 loncom/interface/spreadsheet/lonspreadsheet.pm:1.43
--- loncom/interface/spreadsheet/lonspreadsheet.pm:1.42	Mon Aug 29 17:04:52 2005
+++ loncom/interface/spreadsheet/lonspreadsheet.pm	Thu Apr  6 12:43:49 2006
@@ -1,5 +1,5 @@
 #
-# $Id: lonspreadsheet.pm,v 1.42 2005/08/29 21:04:52 albertel Exp $
+# $Id: lonspreadsheet.pm,v 1.43 2006/04/06 16:43:49 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -264,6 +264,8 @@
     }
     $env{'form.sname'} = $name;
     $env{'form.sdomain'} = $domain;
+    my $section = &Apache::lonnet::getsection($domain,$name,
+					      $env{'request.course.id'});
     ##
     ## Check permissions
     my $allowed_to_edit = &Apache::lonnet::allowed('mgr',
@@ -438,13 +440,16 @@
     &Apache::Spreadsheet::initialize_spreadsheet_package();
     my $spreadsheet = undef;
     if ($sheettype eq 'classcalc') {
-        $spreadsheet = Apache::classcalc->new($name,$domain,$filename,undef);
+        $spreadsheet = Apache::classcalc->new($name,$domain,$filename,undef,
+					      $section);
     } elsif ($sheettype eq 'studentcalc') {
-        $spreadsheet = Apache::studentcalc->new($name,$domain,$filename,undef);
+        $spreadsheet = Apache::studentcalc->new($name,$domain,$filename,undef,
+						$section);
     } elsif ($sheettype eq 'assesscalc' && 
              defined($symb) && 
              $allowed_to_edit) {
-        $spreadsheet = Apache::assesscalc->new($name,$domain,$filename,$symb);
+        $spreadsheet = Apache::assesscalc->new($name,$domain,$filename,$symb,
+					       $section);
     } else {
         return HTTP_NOT_ACCEPTABLE;
     }
Index: loncom/interface/spreadsheet/studentcalc.pm
diff -u loncom/interface/spreadsheet/studentcalc.pm:1.36 loncom/interface/spreadsheet/studentcalc.pm:1.37
--- loncom/interface/spreadsheet/studentcalc.pm:1.36	Sun Mar 26 17:48:34 2006
+++ loncom/interface/spreadsheet/studentcalc.pm	Thu Apr  6 12:43:49 2006
@@ -1,5 +1,5 @@
 #
-# $Id: studentcalc.pm,v 1.36 2006/03/26 22:48:34 bowersj2 Exp $
+# $Id: studentcalc.pm,v 1.37 2006/04/06 16:43:49 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -570,7 +570,8 @@
                 $assessSheet = Apache::assesscalc->new($self->{'name'},
                                                        $self->{'domain'},
                                                        $assess_filename,
-                                                       $resource->symb);
+                                                       $resource->symb,
+						       $self->{'section'});
             my @exportdata = $assessSheet->export_data($r);
             #
             if ($assessSheet->badcalc()) {