version 1.146, 2013/06/26 21:22:55
|
version 1.149, 2014/12/15 01:10:19
|
Line 184 sub loadmap {
|
Line 184 sub loadmap {
|
# We can only nest sequences or pages. Anything else is an illegal nest. |
# We can only nest sequences or pages. Anything else is an illegal nest. |
|
|
unless (($fn=~/\.sequence$/) || $ispage) { |
unless (($fn=~/\.sequence$/) || $ispage) { |
$errtext.=&mt("<br />Invalid map: <tt>[_1]</tt>",$fn); |
$errtext.='<br />'.&mt('Invalid map: [_1]',"<tt>$fn</tt>"); |
return; |
return; |
} |
} |
|
|
Line 193 sub loadmap {
|
Line 193 sub loadmap {
|
my $instr=&Apache::lonnet::getfile($fn); |
my $instr=&Apache::lonnet::getfile($fn); |
|
|
if ($instr eq -1) { |
if ($instr eq -1) { |
$errtext.=&mt('<br />Map not loaded: The file <tt>[_1]</tt> does not exist.',$fn); |
$errtext.= '<br />' |
|
.&mt('Map not loaded: The file [_1] does not exist.', |
|
"<tt>$fn</tt>"); |
return; |
return; |
} |
} |
|
|
Line 280 sub loadmap {
|
Line 282 sub loadmap {
|
# Handle randomization and random selection |
# Handle randomization and random selection |
|
|
if ($randomize) { |
if ($randomize) { |
if (!$env{'request.role.adv'}) { |
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'} = ''; |
|
} |
|
unless ($advanced) { |
|
# Order of resources is not randomized if user has and advanced role in the course. |
my $seed; |
my $seed; |
|
|
# In the advanced role, the map's random seed |
# If the map's random seed parameter has been specified |
# parameter is used as the basis for computing the |
# it is used as the basis for computing the seed ... |
# seed ... if it has been specified: |
|
|
|
if (defined($randompickseed{$parent_rid})) { |
if (defined($randompickseed{$parent_rid})) { |
$seed = $randompickseed{$parent_rid}; |
$seed = $randompickseed{$parent_rid}; |
Line 325 sub loadmap {
|
Line 335 sub loadmap {
|
# processing the randomorder parameter if it is set, not |
# processing the randomorder parameter if it is set, not |
# randompick. |
# randompick. |
|
|
@map_ids=&Math::Random::random_permutation(@map_ids); |
@map_ids=&Math::Random::random_permutation(@map_ids); |
} |
} |
|
|
|
|
Line 938 sub traceroute {
|
Line 948 sub traceroute {
|
$further=simplify('('.'_'.$rid.')&('. |
$further=simplify('('.'_'.$rid.')&('. |
$hash{'condid_'.$hash{'undercond_'.$id}}.')'); |
$hash{'condid_'.$hash{'undercond_'.$id}}.')'); |
} else { |
} else { |
$errtext.=&mt('<br />Undefined condition ID: [_1]',$hash{'undercond_'.$id}); |
$errtext.= '<br />'. |
|
&mt('Undefined condition ID: [_1]', |
|
$hash{'undercond_'.$id}); |
} |
} |
} |
} |
# Recurse to resoruces that have to's to us. |
# Recurse to resoruces that have to's to us. |
Line 1060 sub accinit {
|
Line 1072 sub accinit {
|
|
|
sub hiddenurls { |
sub hiddenurls { |
my $randomoutentry=''; |
my $randomoutentry=''; |
foreach my $rid (keys %randompick) { |
foreach my $rid (keys(%randompick)) { |
my $rndpick=$randompick{$rid}; |
my $rndpick=$randompick{$rid}; |
my $mpc=$hash{'map_pc_'.$hash{'src_'.$rid}}; |
my $mpc=$hash{'map_pc_'.$hash{'src_'.$rid}}; |
# ------------------------------------------- put existing resources into array |
# ------------------------------------------- put existing resources into array |
Line 1111 sub hiddenurls {
|
Line 1123 sub hiddenurls {
|
} |
} |
} |
} |
# ------------------------------ take care of explicitly hidden urls or folders |
# ------------------------------ take care of explicitly hidden urls or folders |
foreach my $rid (keys %hiddenurl) { |
foreach my $rid (keys(%hiddenurl)) { |
$hash{'randomout_'.$rid}=1; |
$hash{'randomout_'.$rid}=1; |
my ($mapid,$resid)=split(/\./,$rid); |
my ($mapid,$resid)=split(/\./,$rid); |
$randomoutentry.='&'. |
$randomoutentry.='&'. |
Line 1548 sub evalstate {
|
Line 1560 sub evalstate {
|
$count++; |
$count++; |
} |
} |
my ($mapid) = split(/\./,$id); |
my ($mapid) = split(/\./,$id); |
&mt('Resource "[_1]" <br /> in Map "[_2]"', |
&mt('Resource [_1][_2]in Map [_3]', |
$hash{'title_'.$id}, |
$hash{'title_'.$id},'<br />', |
$hash{'title_'.$hash{'ids_'.$hash{'map_id_'.$mapid}}}); |
$hash{'title_'.$hash{'ids_'.$hash{'map_id_'.$mapid}}}); |
} (@{ $mapalias_cache{$mapalias} })); |
} (@{ $mapalias_cache{$mapalias} })); |
next if ($count < 2); |
next if ($count < 2); |