--- rat/lonambiguous.pm 2004/12/17 22:40:24 1.11 +++ rat/lonambiguous.pm 2004/12/20 20:13:03 1.12 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to resolve ambiguous file locations # -# $Id: lonambiguous.pm,v 1.11 2004/12/17 22:40:24 albertel Exp $ +# $Id: lonambiguous.pm,v 1.12 2004/12/20 20:13:03 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -149,7 +149,6 @@ sub handler { return OK; } } - # ------------------------------------------------ Would be standalone resource if (tie(%bighash,'GDBM_File',$ENV{'request.course.fn'}.'.db', @@ -173,6 +172,17 @@ sub handler { } if ($couldbe) { @possibilities=split(/\,/,$couldbe); + if ($#possibilities==0) { + my $id=$possibilities[0]; + my $resurl=$bighash{'src_'.$id}; + my $mapurl=$bighash{'map_id_'.(split(/\./,$id))[0]}; + my $symb=&make_symb($id); + $r->content_type('text/html'); + &Apache::lonnet::logthis('http://'.$ENV{'HTTP_HOST'}.$resurl.'?symb='.$symb); + $r->header_out(Location => + 'http://'.$ENV{'HTTP_HOST'}.$resurl.'?symb='.$symb); + return REDIRECT; + } if ($#possibilities>0) { # ----------------------------------------------- Okay, really multiple choices $r->content_type('text/html');