--- rat/lonuserstate.pm 2007/08/29 00:50:50 1.124 +++ rat/lonuserstate.pm 2008/12/21 04:46:53 1.128.2.1 @@ -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.124 2007/08/29 00:50:50 albertel Exp $ +# $Id: lonuserstate.pm,v 1.128.2.1 2008/12/21 04:46:53 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -210,7 +210,7 @@ sub loadmap { $hash{'type_'.$from_rid}='finish'; } - my $parser = HTML::TokeParser->new(\$instr); + $parser = HTML::TokeParser->new(\$instr); $parser->attr_encoded(1); # last parse out the mapalias params so as to ignore anything # refering to non-existant resources @@ -247,7 +247,7 @@ sub parse_resource { $turi=~/\.(\w+)$/; my $embstyle=&Apache::loncommon::fileembstyle($1); if ($token->[2]->{'external'} eq 'true') { # external - $turi=~s/^http\:\/\//\/adm\/wrapper\/ext\//; + $turi=~s/^https?\:\/\//\/adm\/wrapper\/ext\//; } elsif ($turi=~/^\/*uploaded\//) { # uploaded if (($embstyle eq 'img') || ($embstyle eq 'emb') @@ -471,7 +471,8 @@ sub traceroute { if (defined($hash{'map_start_'.$hash{'src_'.$rid}})) { $sofar=$newsofar= &traceroute($sofar, - $hash{'map_start_'.$hash{'src_'.$rid}},'&', + $hash{'map_start_'.$hash{'src_'.$rid}}, + $beenhere, $encflag || $encurl{$rid}, $hdnflag || $hiddenurl{$rid}); } @@ -573,7 +574,7 @@ sub accinit { my $courseuri=$uri; $courseuri=~s/^\/res\///; &Apache::lonnet::delenv('(acc\.|httpref\.)'); - &Apache::lonnet::appenv(%acchash); + &Apache::lonnet::appenv(\%acchash); } # ---------------- Selectively delete from randompick maps and hidden url parms @@ -629,7 +630,7 @@ sub hiddenurls { } # --------------------------------------- append randomout entry to environment if ($randomoutentry) { - &Apache::lonnet::appenv('acc.randomout' => $randomoutentry); + &Apache::lonnet::appenv({'acc.randomout' => $randomoutentry}); } } @@ -677,9 +678,9 @@ sub readmap { $hash{'is_map_0.0'}=1; loadmap($uri,'0.0'); if (defined($hash{'map_start_'.$uri})) { - &Apache::lonnet::appenv("request.course.id" => $short, - "request.course.fn" => $fn, - "request.course.uri" => $uri); + &Apache::lonnet::appenv({"request.course.id" => $short, + "request.course.fn" => $fn, + "request.course.uri" => $uri}); $env{'request.course.id'}=$short; &traceroute('0',$hash{'map_start_'.$uri},'&'); &accinit($uri,$short,$fn); @@ -750,9 +751,9 @@ sub readmap { (tie(%hash,'GDBM_File',"$fn.db",&GDBM_READER(),0640))) { if (tie(%parmhash,'GDBM_File',$fn.'_parms.db',&GDBM_READER(),0640)) { $retfurl='/adm/navmaps'; - &Apache::lonnet::appenv("request.course.id" => $short, - "request.course.fn" => $fn, - "request.course.uri" => $uri); + &Apache::lonnet::appenv({"request.course.id" => $short, + "request.course.fn" => $fn, + "request.course.uri" => $uri}); untie(%hash); untie(%parmhash); last; @@ -813,7 +814,7 @@ sub evalstate { } } } - &Apache::lonnet::appenv('user.state.'.$env{'request.course.id'} => $state); + &Apache::lonnet::appenv({'user.state.'.$env{'request.course.id'} => $state}); return $state; } @@ -837,8 +838,8 @@ sub evalstate { $count++; } my ($mapid) = split(/\./,$id); - &mt('[_1] in [_2]', $hash{'title_'.$id}, - + &mt('Resource "[_1]"
in Map "[_2]"', + $hash{'title_'.$id}, $hash{'title_'.$hash{'ids_'.$hash{'map_id_'.$mapid}}}); } (@{ $mapalias_cache{$mapalias} })); next if ($count < 2);