--- rat/lonuserstate.pm 2005/11/09 11:39:57 1.97 +++ rat/lonuserstate.pm 2006/02/10 22:33:42 1.100 @@ -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.97 2005/11/09 11:39:57 www Exp $ +# $Id: lonuserstate.pm,v 1.100 2006/02/10 22:33:42 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,7 +31,6 @@ package Apache::lonuserstate; # ------------------------------------------------- modules used by this module use strict; -use Apache::Constants qw(:common :http); use HTML::TokeParser; use Apache::lonnet; use Apache::loncommon(); @@ -104,7 +103,7 @@ sub processversionfile { sub loadmap { my $uri=shift; - if ($hash{'map_pc_'.$uri}) { return OK; } + if ($hash{'map_pc_'.$uri}) { return; } $pc++; my $lpc=$pc; @@ -119,7 +118,7 @@ sub loadmap { unless (($fn=~/\.sequence$/) || ($fn=~/\.page$/)) { $errtext.="Invalid map: $fn\n"; - return OK; + return; } my $instr=&Apache::lonnet::getfile($fn); @@ -167,8 +166,7 @@ sub loadmap { } elsif ($turi=~/^\/*uploaded\//) { # uploaded if (($embstyle eq 'img') || ($embstyle eq 'emb') - || ($embstyle eq 'ign') - || ($embstyle eq 'unk')) { + || ($embstyle eq 'wrp')) { $turi='/adm/wrapper'.$turi; } elsif ($embstyle eq 'ssi') { #do nothing with these @@ -179,7 +177,9 @@ sub loadmap { my $mapdir=$uri; $mapdir=~s/[^\/]+$//; $turi=&Apache::lonnet::hreflocation($mapdir,$turi); - if (($embstyle eq 'img') || ($embstyle eq 'emb')) { + if (($embstyle eq 'img') + || ($embstyle eq 'emb') + || ($embstyle eq 'wrp')) { $turi='/adm/wrapper'.$turi; } } @@ -443,12 +443,8 @@ sub accinit { foreach (split(/\,/,$hash{$_})) { my $resid=$_; my $uri=$hash{'src_'.$resid}; - $uri=~s/^\/adm\/wrapper//; - $uri=&Apache::lonnet::declutter($uri); - my @uriparts=split(/\//,$uri); - my $urifile=$uriparts[$#uriparts]; - $#uriparts--; - my $uripath=join('/',@uriparts); + my ($uripath,$urifile) = + &Apache::lonnet::split_uri_for_cond($uri); if ($uripath) { my $uricond='0'; if (defined($hash{'conditions_'.$resid})) {