--- rat/lonuserstate.pm 2020/04/07 20:57:02 1.149.4.1 +++ rat/lonuserstate.pm 2016/01/26 14:30:40 1.150 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Construct and maintain state and binary representation of course for user # -# $Id: lonuserstate.pm,v 1.149.4.1 2020/04/07 20:57:02 raeburn Exp $ +# $Id: lonuserstate.pm,v 1.150 2016/01/26 14:30:40 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -278,6 +278,7 @@ sub loadmap { } undef($codechecked); + # Handle randomization and random selection if ($randomize) { @@ -337,6 +338,7 @@ sub loadmap { @map_ids=&Math::Random::random_permutation(@map_ids); } + my $from = shift(@map_ids); my $from_rid = $lpc.'.'.$from; $hash{'map_start_'.$uri} = $from_rid; @@ -361,7 +363,7 @@ sub loadmap { $parser = HTML::TokeParser->new(\$instr); $parser->attr_encoded(1); - # last parse out the mapalias params. These provide mnemonic + # last parse out the mapalias params. Thes provide mnemonic # tags to resources that can be used in conditions while (my $token = $parser->get_token) { @@ -473,7 +475,7 @@ sub parse_resource { } elsif ($turi!~/\.(sequence|page)$/) { $turi='/adm/coursedocs/showdoc'.$turi; } - } elsif ($turi=~ m{^/adm/$match_domain/$match_courseid/\d+/ext\.tool$}) { + } elsif ($turi=~ m{^/adm/$match_domain/$match_courseid/\d+/exttools?$}) { $turi='/adm/wrapper'.$turi; } elsif ($turi=~/\S/) { # normal non-empty internal resource my $mapdir=$uri; @@ -706,7 +708,7 @@ sub parse_condition { # Typical attributes: # to=n - Number of the resource the parameter applies to. # type=xx - Type of parameter value (e.g. string_yesno or int_pos). -# name=xxx - Name of parameter (e.g. parameter_randompick or parameter_randomorder). +# name=xxx - Name ofr parameter (e.g. parameter_randompick or parameter_randomorder). # value=xxx - value of the parameter. sub parse_param { @@ -1174,9 +1176,6 @@ sub readmap { &unlink_tmpfiles($fn); } undef %randompick; - undef %randompickseed; - undef %randomorder; - undef %randomizationcode; undef %hiddenurl; undef %encurl; $retfrid=''; @@ -1320,12 +1319,8 @@ sub readmap { $lock=1; } undef %randompick; - undef %randompickseed; - undef %randomorder; - undef %randomizationcode; undef %hiddenurl; undef %encurl; - $errtext=''; $retfrid=''; #