Diff for /loncom/interface/loncoursedata.pm between versions 1.4 and 1.7

version 1.4, 2002/07/24 14:52:32 version 1.7, 2002/07/26 16:22:09
Line 189  sub DownloadCourseInformation { Line 189  sub DownloadCourseInformation {
     my $modifiedTime = &GetFileTimestamp($domain, $name,      my $modifiedTime = &GetFileTimestamp($domain, $name,
                                       $courseID.'.db',                                         $courseID.'.db', 
                                       $Apache::lonnet::perlvar{'lonUsersDir'});                                        $Apache::lonnet::perlvar{'lonUsersDir'});
   
     if($lastDownloadTime >= $modifiedTime) {      if($lastDownloadTime >= $modifiedTime) {
         $courseData{'lastDownloadTime'}=time;          $courseData{'lastDownloadTime'}=time;
         $courseData{'UpToDate'} = 'true';          $courseData{'UpToDate'} = 'true';
Line 515  sub ProcessClasslist { Line 516  sub ProcessClasslist {
         $cache->{$name.':domain'}=$studentDomain;          $cache->{$name.':domain'}=$studentDomain;
         if(!defined($cache->{$name.':lastDownloadTime'})) {          if(!defined($cache->{$name.':lastDownloadTime'})) {
             $cache->{$name.':lastDownloadTime'}='Not downloaded';              $cache->{$name.':lastDownloadTime'}='Not downloaded';
               $cache->{$name.':updateTime'}=' Not updated';
         }          }
   
         my ($checkForError)=keys(%$studentInformation);          my ($checkForError)=keys(%$studentInformation);
Line 558  sub ProcessClasslist { Line 560  sub ProcessClasslist {
         }          }
         $cache->{$name.':Status'}=$status;          $cache->{$name.':Status'}=$status;
         $cache->{$name.':section'}=$sec;          $cache->{$name.':section'}=$sec;
   
           if($sec eq '' || !defined($sec) || $sec eq ' ') {
               $sec = 'none';
           }
           if(defined($cache->{'sectionList'})) {
               if($cache->{'sectionList'} !~ /(^$sec:|^$sec$|:$sec$|:$sec:)/) {
                   $cache->{'sectionList'} .= ':'.$sec;
               }
           } else {
               $cache->{'sectionList'} = $sec;
           }
     }      }
   
     $cache->{'ClasslistTimestamp'}=time;      $cache->{'ClasslistTimestamp'}=time;
Line 604  sub ProcessStudentData { Line 617  sub ProcessStudentData {
   
     if($courseData->{'UpToDate'} eq 'true') {      if($courseData->{'UpToDate'} eq 'true') {
         $cache->{$name.':lastDownloadTime'}=$courseData->{'lastDownloadTime'};          $cache->{$name.':lastDownloadTime'}=$courseData->{'lastDownloadTime'};
           if($courseData->{'lastDownloadTime'} eq 'Not downloaded') {
               $cache->{$name.':updateTime'} = ' Not updated';
           } else {
               $cache->{$name.':updateTime'}=
                   localtime($courseData->{'lastDownloadTime'});
           }
         return;          return;
     }      }
   
Line 617  sub ProcessStudentData { Line 636  sub ProcessStudentData {
     }      }
   
     $cache->{$name.':lastDownloadTime'}=$courseData->{'lastDownloadTime'};      $cache->{$name.':lastDownloadTime'}=$courseData->{'lastDownloadTime'};
       if($courseData->{'lastDownloadTime'} eq 'Not downloaded') {
           $cache->{$name.':updateTime'} = ' Not updated';
       } else {
           $cache->{$name.':updateTime'}=
               localtime($courseData->{'lastDownloadTime'});
       }
     foreach (@courseKeys) {      foreach (@courseKeys) {
         $cache->{$name.':'.$_}=$courseData->{$_};          $cache->{$name.':'.$_}=$courseData->{$_};
     }      }
Line 625  sub ProcessStudentData { Line 650  sub ProcessStudentData {
 }  }
   
 sub LoadDiscussion {  sub LoadDiscussion {
 #    my $symb=shift;      my ( $courseID)=@_;
 #    $r->print('<br>$cid ... '.$symb);      my %Discuss=();
 #    my %contrib=&Apache::lonnet::dump('msu_2964385f9033c63msul1','msu','2964385f9033c63msul1');      my %contrib=&Apache::lonnet::dump(
     my ($name, $courseID, $Discuss)=@_;                  $courseID,
     my %contrib=&DownloadCourseInformation($name, $courseID, 0);                  $ENV{'course.'.$courseID.'.domain'},
                                               $ENV{'course.'.$courseID.'.num'});
     
       #my %contrib=&DownloadCourseInformation($name, $courseID, 0);
   
     foreach my $temp(keys %contrib) {      foreach my $temp(keys %contrib) {
  if ($temp=~/^version/) {   if ($temp=~/^version/) {
     my $ver=$contrib{$temp};      my $ver=$contrib{$temp};
     my ($dummy,$prb)=split(':',$temp);      my ($dummy,$prb)=split(':',$temp);
     for (my $idx=1; $idx<=$ver; $idx++ ) {      for (my $idx=1; $idx<=$ver; $idx++ ) {
  my $name=$contrib{"$idx:$prb:sendername"};   my $name=$contrib{"$idx:$prb:sendername"};
  $Discuss->{"$name:$prb"}=$idx;   $Discuss{"$name:$prb"}=$idx;
     }      }
  }   }
     }             }       
 #   $r->print('<br>cid='.$cid);  
 #    my %contrib=&Apache::lonnet::restore($symb,$cid,      return \%Discuss;
 # $ENV{$cid.'.domain'},  
 # $ENV{'course.'.$cid.'.num'});  
   
 #    $Apache::lonxml::debug=1;  
 #    &Apache::lonhomework::showhash(%Discuss);  
 #    $Apache::lonxml::debug=0;  
 }  }
   
 # ----- END PROCESSING FUNCTIONS ---------------------------------------  # ----- END PROCESSING FUNCTIONS ---------------------------------------

Removed from v.1.4  
changed lines
  Added in v.1.7


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