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

version 1.149.2.3, 2020/03/05 22:39:57 version 1.149.2.4, 2020/05/02 21:28:08
Line 292  sub loadmap { Line 292  sub loadmap {
     # Handle randomization and random selection      # Handle randomization and random selection
   
     if ($randomize) {      if ($randomize) {
         my $advanced;          unless (&is_advanced($courseid)) {
         if ($env{'request.course.id'}) {  
             $advanced = (&Apache::lonnet::allowed('adv') eq 'F');  
         } else {  
             $env{'request.course.id'} = $courseid;  
             $advanced = (&Apache::lonnet::allowed('adv') eq 'F');  
             $env{'request.course.id'} = '';  
         }  
         unless ($advanced) {  
             # Order of resources is not randomized if user has and advanced role in the course.              # Order of resources is not randomized if user has and advanced role in the course.
     my $seed;      my $seed;
   
Line 383  sub loadmap { Line 375  sub loadmap {
     }      }
 }  }
   
   sub is_advanced {
       my ($courseid) = @_;
       my $advanced;
       if ($env{'request.course.id'}) {
           $advanced = (&Apache::lonnet::allowed('adv') eq 'F');
       } else {
           $env{'request.course.id'} = $courseid;
           $advanced = (&Apache::lonnet::allowed('adv') eq 'F');
           $env{'request.course.id'} = '';
       }
       return $advanced;
   }
   
 # -------------------------------------------------------------------- Resource  # -------------------------------------------------------------------- Resource
 #  #
Line 563  sub parse_resource { Line 567  sub parse_resource {
     if (($turi=~/\.sequence$/) ||      if (($turi=~/\.sequence$/) ||
  ($turi=~/\.page$/)) {   ($turi=~/\.page$/)) {
  $hash{'is_map_'.$rid}=1;   $hash{'is_map_'.$rid}=1;
  &loadmap($turi,$rid,$courseid);   if ((!$hiddenurl{$rid}) || (&is_advanced($courseid))) {
       &loadmap($turi,$rid,$courseid);
    }
     }       } 
     return $token->[2]->{'id'};      return $token->[2]->{'id'};
 }  }

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


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