--- rat/lonuserstate.pm 2005/05/06 19:11:49 1.91 +++ rat/lonuserstate.pm 2005/07/15 12:29:07 1.95 @@ -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.91 2005/05/06 19:11:49 albertel Exp $ +# $Id: lonuserstate.pm,v 1.95 2005/07/15 12:29:07 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -73,6 +73,7 @@ sub versiontrack { sub putinversion { my $uri=shift; + my $key=$env{'request.course.id'}.'_'.&Apache::lonnet::clutter($uri); if ($hash{'version_'.$uri}) { my $version=$hash{'version_'.$uri}; if ($version eq 'mostrecent') { return $uri; } @@ -81,6 +82,7 @@ sub putinversion { { return $uri; } $uri=~s/\.(\w+)$/\.$version\.$1/; } + &Apache::lonnet::do_cache_new('courseresversion',$key,&Apache::lonnet::declutter($uri),600); return $uri; } @@ -126,6 +128,7 @@ sub loadmap { # Successfully got file, parse it my $parser = HTML::TokeParser->new(\$instr); + $parser->attr_encoded(1); my $token; my $linkpc=0; @@ -138,7 +141,7 @@ sub loadmap { if ($token->[0] eq 'S') { if ($token->[1] eq 'resource') { # -------------------------------------------------------------------- Resource - + if ($token->[2]->{'type'} eq 'zombie') { next; } my $rid=$lpc.'.'.$token->[2]->{'id'}; $hash{'kind_'.$rid}='res'; @@ -588,6 +591,7 @@ sub readmap { } # ----------------------------------------------- Close hashes to finally store # --------------------------------- Routine must pass this point, no early outs + $hash{'first_url'}=$retfurl; unless ((untie(%hash)) && (untie(%parmhash))) { &Apache::lonnet::logthis("WARNING: ". "Could not untie coursemap $fn for $uri.");