Diff for /rat/lonuserstate.pm between versions 1.149.2.3 and 1.154

version 1.149.2.3, 2020/03/05 22:39:57 version 1.154, 2017/11/16 12:44:48
Line 42  use Safe::Hole; Line 42  use Safe::Hole;
 use Opcode;  use Opcode;
 use Apache::lonenc;  use Apache::lonenc;
 use Fcntl qw(:flock);  use Fcntl qw(:flock);
 use LONCAPA;  use LONCAPA qw(:DEFAULT :match);
 use File::Basename;  use File::Basename;
   
     
Line 255  sub loadmap { Line 255  sub loadmap {
  push(@map_ids, $resource_id);   push(@map_ids, $resource_id);
                 if ($hash{'src_'.$lpc.'.'.$resource_id}) {                  if ($hash{'src_'.$lpc.'.'.$resource_id}) {
                     $rescount{$lpc} ++;                      $rescount{$lpc} ++;
                     if (($hash{'src_'.$lpc.'.'.$resource_id}=~/\.sequence$/) ||                      if (($hash{'src_'.$lpc.'.'.$resource_id}=~/\.sequence$/) || 
                         ($hash{'src_'.$lpc.'.'.$resource_id}=~/\.page$/)) {                          ($hash{'src_'.$lpc.'.'.$resource_id}=~/\.page$/)) {
                         $mapcount{$lpc} ++;                          $mapcount{$lpc} ++; 
                     }                      }
                 }                  }
                 unless ($codechecked) {                  unless ($codechecked) {
Line 469  sub parse_resource { Line 469  sub parse_resource {
     # is not a page.  If the resource is a page then it must be      # is not a page.  If the resource is a page then it must be
     # assembled (at fetch time?).      # assembled (at fetch time?).
   
     if ($ispage) {      unless ($ispage) {
         if ($token->[2]->{'external'} eq 'true') { # external  
             $turi=~s{^http\://}{/ext/};  
         }  
     } else {  
  $turi=~/\.(\w+)$/;   $turi=~/\.(\w+)$/;
  my $embstyle=&Apache::loncommon::fileembstyle($1);   my $embstyle=&Apache::loncommon::fileembstyle($1);
  if ($token->[2]->{'external'} eq 'true') { # external   if ($token->[2]->{'external'} eq 'true') { # external
Line 488  sub parse_resource { Line 484  sub parse_resource {
     } elsif ($turi!~/\.(sequence|page)$/) {      } elsif ($turi!~/\.(sequence|page)$/) {
  $turi='/adm/coursedocs/showdoc'.$turi;   $turi='/adm/coursedocs/showdoc'.$turi;
     }      }
           } elsif ($turi=~ m{^/adm/$match_domain/$match_courseid/\d+/ext\.tool$}) {
               $turi='/adm/wrapper'.$turi;
  } elsif ($turi=~/\S/) { # normal non-empty internal resource   } elsif ($turi=~/\S/) { # normal non-empty internal resource
     my $mapdir=$uri;      my $mapdir=$uri;
     $mapdir=~s/[^\/]+$//;      $mapdir=~s/[^\/]+$//;
Line 1229  sub readmap { Line 1227  sub readmap {
         &unlink_tmpfiles($fn);          &unlink_tmpfiles($fn);
     }      }
     undef %randompick;      undef %randompick;
     undef %randompickseed;  
     undef %randomorder;  
     undef %randomizationcode;  
     undef %hiddenurl;      undef %hiddenurl;
     undef %encurl;      undef %encurl;
     undef %rescount;  
     undef %mapcount;  
     $retfrid='';      $retfrid='';
     $errtext='';      $errtext='';
     my ($untiedhash,$untiedparmhash,$tiedhash,$tiedparmhash); # More state flags.      my ($untiedhash,$untiedparmhash,$tiedhash,$tiedparmhash); # More state flags.
Line 1377  sub readmap { Line 1370  sub readmap {
             $lock=1;              $lock=1;
         }          }
         undef %randompick;          undef %randompick;
         undef %randompickseed;  
         undef %randomorder;  
         undef %randomizationcode;  
         undef %hiddenurl;          undef %hiddenurl;
         undef %encurl;          undef %encurl;
         undef %rescount;  
         undef %mapcount;  
         $errtext='';          $errtext='';
         $retfrid='';          $retfrid='';
  #   #

Removed from v.1.149.2.3  
changed lines
  Added in v.1.154


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