--- rat/lonuserstate.pm 2003/11/01 16:37:22 1.66 +++ rat/lonuserstate.pm 2004/04/05 18:25:08 1.72 @@ -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.66 2003/11/01 16:37:22 www Exp $ +# $Id: lonuserstate.pm,v 1.72 2004/04/05 18:25:08 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -77,8 +77,6 @@ sub putinversion { if ($version eq &Apache::lonnet::getversion( &Apache::lonnet::filelocation('',$uri))) { return $uri; } - &Apache::lonnet::logthis($uri.' '.$version.' '. &Apache::lonnet::getversion( - &Apache::lonnet::filelocation('',$uri))); $uri=~s/\.(\w+)$/\.$version\.$1/; } return $uri; @@ -161,21 +159,28 @@ sub loadmap { } elsif ($turi=~/^\/*uploaded\//) { # uploaded if (($embstyle eq 'img') || ($embstyle eq 'emb') || ($embstyle eq 'ssi')) { - $turi='/adm/wrapper'.$turi; + unless ($turi =~/\.page$/) { + $turi='/adm/wrapper'.$turi; + } } elsif ($turi!~/\.(sequence|page)$/) { $turi='/adm/coursedocs/showdoc'.$turi; } - } else { # normal internal resource - if (($embstyle eq 'img') || ($embstyle eq 'emb')) { - $turi='/adm/wrapper'.$turi; - } + } elsif ($turi=~/\S/) { # normal non-empty internal resource + my $mapdir=$uri; + $mapdir=~s/[^\/]+$//; + $turi=&Apache::lonnet::hreflocation($mapdir,$turi); + if (($embstyle eq 'img') || ($embstyle eq 'emb')) { + $turi='/adm/wrapper'.$turi; + } } } - - if (defined($hash{'ids_'.$turi})) { - $hash{'ids_'.$turi}.=','.$rid; +# Store reverse lookup, remove query string + my $idsuri=$turi; + $idsuri=~s/\?.+$//; + if (defined($hash{'ids_'.$idsuri})) { + $hash{'ids_'.$idsuri}.=','.$rid; } else { - $hash{'ids_'.$turi}=''.$rid; + $hash{'ids_'.$idsuri}=''.$rid; } if