--- rat/lonuserstate.pm 2002/06/27 13:21:04 1.31 +++ rat/lonuserstate.pm 2002/07/15 12:22:32 1.34 @@ -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.31 2002/06/27 13:21:04 www Exp $ +# $Id: lonuserstate.pm,v 1.34 2002/07/15 12:22:32 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -277,7 +277,7 @@ sub traceroute { $sofar=simplify($sofar); unless ($beenhere=~/\&$rid\&/) { $beenhere.=$rid.'&'; - if ($retfurl eq '') { + if (($retfurl eq '') && ($hash{'src_'.$rid})) { my ($mapid,$resid)=split(/\./,$rid); $retfurl=$hash{'src_'.$rid}.'?symb='. &Apache::lonnet::symbclean( @@ -423,7 +423,7 @@ sub pickrandom { next if ($#currentrids<$rndpick); # -------------------------------- randomly eliminate the ones that should stay srand(&Apache::lonnet::rndseed($rid)); # use rid instead of symb - for (my $i=1;$i<=$#currentrids+1-$rndpick;$i++) { + for (my $i=1;$i<=$rndpick;$i++) { while (1) { my $randomidx=int(rand($#currentrids+1)); if ($currentrids[$randomidx]) { @@ -436,7 +436,13 @@ sub pickrandom { for (my $k=0; $k<=$#currentrids; $k++) { if ($currentrids[$k]) { $hash{'randomout_'.$currentrids[$k]}=1; - $randomoutentry.='&'.$currentrids[$k].'&'; + my ($mapid,$resid)=split(/\./,$currentrids[$k]); + $randomoutentry.='&'. + &Apache::lonnet::symbclean( + &Apache::lonnet::declutter($hash{'map_id_'.$mapid}). + '___'.$resid.'___'. + &Apache::lonnet::declutter($hash{'src_'.$currentrids[$k]}) + ).'&'; } } }