Diff for /loncom/interface/Attic/lonspreadsheet.pm between versions 1.34 and 1.35

version 1.34, 2001/01/20 01:07:03 version 1.35, 2001/01/20 12:29:37
Line 3 Line 3
 #  #
 # 11/11,11/15,11/27,12/04,12/05,12/06,12/07,  # 11/11,11/15,11/27,12/04,12/05,12/06,12/07,
 # 12/08,12/09,12/11,12/12,12/15,12/16,12/18,12/19,12/30,  # 12/08,12/09,12/11,12/12,12/15,12/16,12/18,12/19,12/30,
 # 01/01/01,02/01,03/01,19/01 Gerd Kortemeyer  # 01/01/01,02/01,03/01,19/01,20/01 Gerd Kortemeyer
   
 package Apache::lonspreadsheet;  package Apache::lonspreadsheet;
   
Line 25  my %spreadsheets; Line 25  my %spreadsheets;
 my %courserdatas;  my %courserdatas;
 my %userrdatas;  my %userrdatas;
 my %defaultsheets;  my %defaultsheets;
   my %updatedata;
   
 #  #
 # These global hashes are dependent on user, course and resource,   # These global hashes are dependent on user, course and resource, 
Line 1060  sub updateclasssheet { Line 1061  sub updateclasssheet {
 sub updatestudentassesssheet {  sub updatestudentassesssheet {
     my $safeeval=shift;      my $safeeval=shift;
     my %bighash;      my %bighash;
       my $stype=&gettype($safeeval);
       my %current=();
       unless ($updatedata{$ENV{'request.course.fn'}.'_'.$stype}) {
 # -------------------------------------------------------------------- Tie hash  # -------------------------------------------------------------------- Tie hash
       if (tie(%bighash,'GDBM_File',$ENV{'request.course.fn'}.'.db',        if (tie(%bighash,'GDBM_File',$ENV{'request.course.fn'}.'.db',
                        &GDBM_READER,0640)) {                         &GDBM_READER,0640)) {
Line 1068  sub updatestudentassesssheet { Line 1072  sub updatestudentassesssheet {
  my %allkeys=();   my %allkeys=();
         my %allassess=();          my %allassess=();
   
         my $stype=&gettype($safeeval);  
   
         map {          map {
     if ($_=~/^src\_(\d+)\.(\d+)$/) {      if ($_=~/^src\_(\d+)\.(\d+)$/) {
        my $mapid=$1;         my $mapid=$1;
Line 1106  sub updatestudentassesssheet { Line 1108  sub updatestudentassesssheet {
 # %allkeys has a list of storage and parameter displays by unikey  # %allkeys has a list of storage and parameter displays by unikey
 # %allassess has a list of all resource displays by symb  # %allassess has a list of all resource displays by symb
 #  #
 # -------------------- Find discrepancies between the course row table and this  
 #  
         my %f=&getformulas($safeeval);  
         my $changed=0;  
   
         my %current=();  
         if ($stype eq 'assesscalc') {          if ($stype eq 'assesscalc') {
     %current=%allkeys;      %current=%allkeys;
         } elsif ($stype eq 'studentcalc') {          } elsif ($stype eq 'studentcalc') {
             %current=%allassess;              %current=%allassess;
         }          }
           $updatedata{$ENV{'request.course.fn'}.'_'.$stype}=
       join('___;___',%current);
           undef %allkeys;
           undef %allassess;
       } else {
           return 'Could not access course data';
       }
   # ------------------------------------------------------ Get current from cache
       } else {
           %current=split(/\_\_\_\;\_\_\_/,
          $updatedata{$ENV{'request.course.fn'}.'_'.$stype});
       }
   # -------------------- Find discrepancies between the course row table and this
   #
           my %f=&getformulas($safeeval);
           my $changed=0;
   
         my $maxrow=0;          my $maxrow=0;
         my %existing=();          my %existing=();
Line 1142  sub updatestudentassesssheet { Line 1155  sub updatestudentassesssheet {
                 $f{'A'.$maxrow}=$_;                  $f{'A'.$maxrow}=$_;
             }              }
         } keys %current;                  } keys %current;        
            
         if ($changed) { &setformulas($safeeval,%f); }          if ($changed) { &setformulas($safeeval,%f); }
   
         &setmaxrow($safeeval,$maxrow);          &setmaxrow($safeeval,$maxrow);
         &setrowlabels($safeeval,%current);          &setrowlabels($safeeval,%current);
    
     } else {          undef %current;
         return 'Could not access course data';          undef %existing;
     }  
 }  }
   
 # ------------------------------------------------ Load data for one assessment  # ------------------------------------------------ Load data for one assessment
Line 1194  sub loadcourse { Line 1206  sub loadcourse {
  if ($_=~/^A(\d+)/) {   if ($_=~/^A(\d+)/) {
    my $row=$1;     my $row=$1;
            unless (($f{$_}=~/^\!/)             unless (($f{$_}=~/^\!/)
   
 || ($row>200))  || ($row>200))
   
  {   {
       my @studentdata=&exportsheet(&getuname($safeeval),        my @studentdata=&exportsheet(&getuname($safeeval),
                                            &getudom($safeeval),                                             &getudom($safeeval),

Removed from v.1.34  
changed lines
  Added in v.1.35


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