Diff for /rat/lonuserstate.pm between versions 1.54 and 1.58

version 1.54, 2003/03/01 15:13:59 version 1.58, 2003/04/30 21:13:57
Line 97  sub loadmap { Line 97  sub loadmap {
   
     my $instr=&Apache::lonnet::getfile($fn);      my $instr=&Apache::lonnet::getfile($fn);
   
     unless ($instr == -1) {      unless ($instr eq -1) {
   
 # Successfully got file, parse it  # Successfully got file, parse it
   
Line 377  sub accinit { Line 377  sub accinit {
     my $resid=$_;      my $resid=$_;
             my $uri=$hash{'src_'.$resid};              my $uri=$hash{'src_'.$resid};
             $uri=~s/^\/adm\/wrapper//;              $uri=~s/^\/adm\/wrapper//;
               $uri=&Apache::lonnet::declutter($uri);
             my @uriparts=split(/\//,$uri);              my @uriparts=split(/\//,$uri);
             my $urifile=$uriparts[$#uriparts];              my $urifile=$uriparts[$#uriparts];
             $#uriparts--;              $#uriparts--;
             my $uripath=join('/',@uriparts);              my $uripath=join('/',@uriparts);
             $uripath=&Apache::lonnet::declutter($uripath);  
            if ($uripath) {             if ($uripath) {
             my $uricond='0';              my $uricond='0';
             if (defined($hash{'conditions_'.$resid})) {              if (defined($hash{'conditions_'.$resid})) {
Line 389  sub accinit { Line 389  sub accinit {
             }              }
             if (defined($acchash{'acc.res.'.$short.'.'.$uripath})) {              if (defined($acchash{'acc.res.'.$short.'.'.$uripath})) {
                 if ($acchash{'acc.res.'.$short.'.'.$uripath}=~                  if ($acchash{'acc.res.'.$short.'.'.$uripath}=~
                    /(\&$urifile\:[^\&]*)/) {                     /(\&\Q$urifile\E\:[^\&]*)/) {
     my $replace=$1;      my $replace=$1;
                     my $regexp=$replace;                      my $regexp=$replace;
                     $regexp=~s/\|/\\\|/g;                      $regexp=~s/\|/\\\|/g;
Line 443  sub pickrandom { Line 443  sub pickrandom {
  my (undef,$id)=split(/\./,$rid);   my (undef,$id)=split(/\./,$rid);
         if ($randompickseed{$rid}) { $id=$randompickseed{$rid}; }          if ($randompickseed{$rid}) { $id=$randompickseed{$rid}; }
  my $rndseed=&Apache::lonnet::rndseed($id); # use id instead of symb   my $rndseed=&Apache::lonnet::rndseed($id); # use id instead of symb
  &Math::Random::random_set_seed_from_phrase($rndseed);   &Apache::lonnet::setup_random_from_rndseed($rndseed);
  my @whichids=&Math::Random::random_permuted_index($#currentrids+1);   my @whichids=&Math::Random::random_permuted_index($#currentrids+1);
         for (my $i=1;$i<=$rndpick;$i++) { $currentrids[$whichids[$i]]=''; }          for (my $i=1;$i<=$rndpick;$i++) { $currentrids[$whichids[$i]]=''; }
  #&Apache::lonnet::logthis("$id,$rndseed,".join(':',@whichids));   #&Apache::lonnet::logthis("$id,$rndseed,".join(':',@whichids));

Removed from v.1.54  
changed lines
  Added in v.1.58


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