Diff for /loncom/interface/spreadsheet/studentcalc.pm between versions 1.14 and 1.17

version 1.14, 2003/07/16 15:57:32 version 1.17, 2003/09/05 01:06:45
Line 45  studentcalc Line 45  studentcalc
 ###################################################  ###################################################
 package Apache::studentcalc;  package Apache::studentcalc;
   
   use warnings FATAL=>'all';
   no warnings 'uninitialized';
   
 use strict;  use strict;
 use Apache::Constants qw(:common :http);  use Apache::Constants qw(:common :http);
 use Apache::lonnet;  use Apache::lonnet;
Line 98  sub initialize_sequence_cache { Line 101  sub initialize_sequence_cache {
 }  }
   
 sub clear_package {  sub clear_package {
     @Sequences = undef;      undef(@Sequences);
     %Exportrows = undef;      undef(%Exportrows);
 }  }
   
 sub get_title {  sub get_title {
Line 411  sub outsheet_recursive_excel { Line 414  sub outsheet_recursive_excel {
   
 sub compute {  sub compute {
     my $self = shift;      my $self = shift;
     $self->logthis('computing');  
     if (! defined($current_course) ||      if (! defined($current_course) ||
         $current_course ne $ENV{'request.course.id'}) {          $current_course ne $ENV{'request.course.id'}) {
         $current_course = $ENV{'request.course.id'};          $current_course = $ENV{'request.course.id'};
Line 494  sub compute { Line 496  sub compute {
 sub set_row_sources {  sub set_row_sources {
     my $self = shift;      my $self = shift;
     while (my ($cell,$value) = each(%{$self->{'formulas'}})) {      while (my ($cell,$value) = each(%{$self->{'formulas'}})) {
         next if ($cell !~ /^A(\d+)/ && $1 > 0);          next if ($cell !~ /^A(\d+)$/ || $1 < 1);
         my $row = $1;          my $row = $1;
         (undef,$value) = split('__&&&__',$value);          (undef,$value) = split('__&&&__',$value);
         $value = 'Default' if (! defined($value));          $value = 'Default' if (! defined($value));
Line 511  sub set_row_numbers { Line 513  sub set_row_numbers {
         next if ($row == 0);          next if ($row == 0);
         my ($symb,undef) = split('__&&&__',$formula);          my ($symb,undef) = split('__&&&__',$formula);
         $self->{'row_numbers'}->{$symb} = $row;          $self->{'row_numbers'}->{$symb} = $row;
         $self->{'maxrow'} = $1 if ($1 > $self->{'maxrow'});          $self->{'maxrow'} = $row if ($row > $self->{'maxrow'});
     }      }
 }  }
   
Line 541  These rows are saved in the courses dire Line 543  These rows are saved in the courses dire
 #############################################  #############################################
 #############################################  #############################################
 sub load_cached_export_rows {  sub load_cached_export_rows {
     %Exportrows = undef;      undef(%Exportrows);
     my @tmp = &Apache::lonnet::dump('nohist_calculatedsheets',      my @tmp = &Apache::lonnet::dump('nohist_calculatedsheets',
      $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},       $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
      $ENV{'course.'.$ENV{'request.course.id'}.'.num'},undef);       $ENV{'course.'.$ENV{'request.course.id'}.'.num'},undef);
Line 589  sub save_export_data { Line 591  sub save_export_data {
     my $newstore = join('___;___',      my $newstore = join('___;___',
                         @{$Exportrows{$student}->{'data'}});                          @{$Exportrows{$student}->{'data'}});
     $newstore = '___=___'.$newstore;      $newstore = '___=___'.$newstore;
     &Apache::lonnet::put('nohist_calculatedsheets',      my $result= &Apache::lonnet::put('nohist_calculatedsheets',
                          { $key     => $newstore,                           { $key     => $newstore,
                            $timekey => $Exportrows{$student}->{'time'} },                             $timekey => $Exportrows{$student}->{'time'} },
                          $self->{'cdom'},                           $self->{'cdom'},
Line 615  sub export_data { Line 617  sub export_data {
     my $self = shift;      my $self = shift;
     my $student = $self->{'name'}.':'.$self->{'domain'};      my $student = $self->{'name'}.':'.$self->{'domain'};
     if (! exists($Exportrows{$student}) ||      if (! exists($Exportrows{$student}) ||
           ! defined($Exportrows{$student}) ||
           ! exists($Exportrows{$student}->{'data'}) ||
           ! defined($Exportrows{$student}->{'data'}) ||
           ! exists($Exportrows{$student}->{'time'}) ||
           ! defined($Exportrows{$student}->{'time'}) ||
         ! $self->check_expiration_time($Exportrows{$student}->{'time'})) {          ! $self->check_expiration_time($Exportrows{$student}->{'time'})) {
         $self->compute();          $self->compute();
     }      }

Removed from v.1.14  
changed lines
  Added in v.1.17


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