Diff for /loncom/interface/spreadsheet/assesscalc.pm between versions 1.38 and 1.39

version 1.38, 2005/03/10 17:33:57 version 1.39, 2005/04/07 06:56:23
Line 125  sub clear_package { Line 125  sub clear_package {
     if (defined($current_name) &&      if (defined($current_name) &&
         defined($current_domain) &&          defined($current_domain) &&
         defined($current_course) &&          defined($current_course) &&
         $current_course eq $ENV{'request.course.id'} &&          $current_course eq $env{'request.course.id'} &&
         %newExportrows) {          %newExportrows) {
         &save_cached_export_rows($current_name,$current_domain);          &save_cached_export_rows($current_name,$current_domain);
     }      }
Line 143  sub clear_package { Line 143  sub clear_package {
 sub save_cached_export_rows {  sub save_cached_export_rows {
     my ($sname,$sdomain) = @_;      my ($sname,$sdomain) = @_;
     my $result = &Apache::lonnet::put      my $result = &Apache::lonnet::put
         ('nohist_calculatedsheets_'.$ENV{'request.course.id'},          ('nohist_calculatedsheets_'.$env{'request.course.id'},
          $newExportrows{$sname.':'.$sdomain},           $newExportrows{$sname.':'.$sdomain},
          $sdomain,$sname);           $sdomain,$sname);
     delete($newExportrows{$sname.':'.$sdomain});      delete($newExportrows{$sname.':'.$sdomain});
Line 180  sub initialize_package { Line 180  sub initialize_package {
     $navmap = $in_navmap;      $navmap = $in_navmap;
     undef(%useropt);      undef(%useropt);
     undef(%userdata);      undef(%userdata);
     if ($current_course ne $ENV{'request.course.id'}) {      if ($current_course ne $env{'request.course.id'}) {
         $current_course = $ENV{'request.course.id'};          $current_course = $env{'request.course.id'};
         undef(%courseopt);          undef(%courseopt);
     }      }
     &load_cached_export_rows();      &load_cached_export_rows();
Line 207  sub load_parameter_caches { Line 207  sub load_parameter_caches {
     #      #
     # Course Parameters Cache      # Course Parameters Cache
     if (! %courseopt) {      if (! %courseopt) {
         $current_course = $ENV{'request.course.id'};          $current_course = $env{'request.course.id'};
         undef(%courseopt);          undef(%courseopt);
         if (! defined($current_name) || ! defined($current_domain)) {          if (! defined($current_name) || ! defined($current_domain)) {
             return;              return;
         }          }
         my $dom = $ENV{'course.'.$ENV{'request.course.id'}.'.domain'};          my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
         my $id  = $ENV{'course.'.$ENV{'request.course.id'}.'.num'};          my $id  = $env{'course.'.$env{'request.course.id'}.'.num'};
         my %Tmp = &Apache::lonnet::dump('resourcedata',$dom,$id);          my %Tmp = &Apache::lonnet::dump('resourcedata',$dom,$id);
         while (my ($name,$value) = each(%Tmp)) {          while (my ($name,$value) = each(%Tmp)) {
             $courseopt{$name}=$value;              $courseopt{$name}=$value;
Line 256  sub ensure_current_caches { Line 256  sub ensure_current_caches {
     ## Check for a modified parameters      ## Check for a modified parameters
     ##      ##
     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'};
         undef(%courseopt);           undef(%courseopt); 
         undef(%useropt);          undef(%useropt);
         undef(%userdata);          undef(%userdata);
Line 769  sub compute { Line 769  sub compute {
     my %c;      my %c;
     #      #
     # Check for blackout requirements      # Check for blackout requirements
     if ((!exists($ENV{'request.role.adv'}) || !$ENV{'request.role.adv'})) {      if ((!exists($env{'request.role.adv'}) || !$env{'request.role.adv'})) {
         while (my ($parm,$value) = each(%parameters)) {          while (my ($parm,$value) = each(%parameters)) {
             last if ($self->blackout());              last if ($self->blackout());
             next if ($parm !~ /^(parameter_.*)_problemstatus$/);              next if ($parm !~ /^(parameter_.*)_problemstatus$/);
Line 875  These rows are saved in the students dir Line 875  These rows are saved in the students dir
 sub load_cached_export_rows {  sub load_cached_export_rows {
     undef(%Exportrows);      undef(%Exportrows);
     my @tmp = &Apache::lonnet::dump('nohist_calculatedsheets_'.      my @tmp = &Apache::lonnet::dump('nohist_calculatedsheets_'.
                                     $ENV{'request.course.id'},                                      $env{'request.course.id'},
                                     $current_domain,$current_name,undef);                                      $current_domain,$current_name,undef);
     if ($tmp[0]!~/^error/) {      if ($tmp[0]!~/^error/) {
         my %tmp = @tmp;          my %tmp = @tmp;
         my $default_filename =  $ENV{'course.'.$ENV{'request.course.id'}.          my $default_filename =  $env{'course.'.$env{'request.course.id'}.
                                          '.spreadsheet_default_assesscalc'};                                           '.spreadsheet_default_assesscalc'};
         # We only got one key, so we will access it directly.          # We only got one key, so we will access it directly.
         while (my ($key,$sheetdata) = each(%tmp)) {          while (my ($key,$sheetdata) = each(%tmp)) {
Line 921  sub export_data { Line 921  sub export_data {
     my ($r) = @_;      my ($r) = @_;
     my $connection = $r->connection();      my $connection = $r->connection();
     my $symb = $self->{'symb'};      my $symb = $self->{'symb'};
     if (! exists($ENV{'request.role.adv'}) || ! $ENV{'request.role.adv'} ||      if (! exists($env{'request.role.adv'}) || ! $env{'request.role.adv'} ||
         ! exists($Exportrows{$symb}) || ! defined($Exportrows{$symb})  ||          ! exists($Exportrows{$symb}) || ! defined($Exportrows{$symb})  ||
         ! $self->check_expiration_time($Exportrows{$symb}->{'time'}) ||          ! $self->check_expiration_time($Exportrows{$symb}->{'time'}) ||
         ! exists($Exportrows{$symb}->{$self->{'filename'}}) ||          ! exists($Exportrows{$symb}->{$self->{'filename'}}) ||

Removed from v.1.38  
changed lines
  Added in v.1.39


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