--- loncom/homework/structuretags.pm 2004/05/20 23:11:12 1.249 +++ loncom/homework/structuretags.pm 2004/05/27 04:32:19 1.251 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.249 2004/05/20 23:11:12 albertel Exp $ +# $Id: structuretags.pm,v 1.251 2004/05/27 04:32:19 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -178,7 +178,7 @@ sub setup_rndseed { } if ($safeeval) { &Apache::lonxml::debug("Setting rndseed to $rndseed"); - &Apache::run::run('$external::randomseed='.$rndseed.';',$safeeval); + &Apache::run::run('$external::randomseed="'.$rndseed.'";',$safeeval); } } return $rndseed; @@ -983,12 +983,13 @@ sub shuffle { my $a=shift; my $i; if (defined(@$a)) { - &Apache::response::setrandomnumber(); + &Apache::response::pushrandomnumber(); for($i=@$a;--$i;) { my $j=int(&Math::Random::random_uniform() * ($i+1)); next if $i == $j; @$a[$i,$j] = @$a[$j,$i]; } + &Apache::response::poprandomnumber(); } }