--- rat/lonuserstate.pm 2007/11/30 19:14:14 1.126 +++ rat/lonuserstate.pm 2009/03/21 06:12:05 1.128.2.2 @@ -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.126 2007/11/30 19:14:14 albertel Exp $ +# $Id: lonuserstate.pm,v 1.128.2.2 2009/03/21 06:12:05 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') @@ -573,8 +573,9 @@ sub accinit { $acchash{'acc.res.'.$short.'.'}='&:0&'; my $courseuri=$uri; $courseuri=~s/^\/res\///; - &Apache::lonnet::delenv('(acc\.|httpref\.)'); - &Apache::lonnet::appenv(%acchash); + my $regexp = 1; + &Apache::lonnet::delenv('(acc\.|httpref\.)',$regexp); + &Apache::lonnet::appenv(\%acchash); } # ---------------- Selectively delete from randompick maps and hidden url parms @@ -630,7 +631,7 @@ sub hiddenurls { } # --------------------------------------- append randomout entry to environment if ($randomoutentry) { - &Apache::lonnet::appenv('acc.randomout' => $randomoutentry); + &Apache::lonnet::appenv({'acc.randomout' => $randomoutentry}); } } @@ -678,9 +679,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); @@ -751,9 +752,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; @@ -814,7 +815,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; }