--- loncom/homework/structuretags.pm 2001/08/03 22:12:07 1.51 +++ loncom/homework/structuretags.pm 2001/08/16 21:06:22 1.53 @@ -71,7 +71,14 @@ sub start_problem { $Apache::lonhomework::type=&Apache::lonnet::EXT('resource.0.type'); &Apache::lonxml::debug("Found this to be of type :$Apache::lonhomework::type:"); if ($Apache::lonhomework::type eq '') { - $Apache::lonhomework::type='homework'; + my $uri=$ENV{'request.uri'}; + if ($uri=~/\.(\w+)$/) { + $Apache::lonhomework::type=$1; + &Apache::lonxml::debug("Using type of $1"); + } else { + $Apache::lonhomework::type='problem'; + &Apache::lonxml::debug("Using default type, problem, :$uri:"); + } } #adeed vars to the scripting enviroment my $expression='$external::part='.$Apache::inputtags::part.';'; @@ -305,6 +312,7 @@ sub start_randomlist { sub shuffle { my $a=shift; my $i; + &Apache::response::setrandomnumber(); for($i=@$a;--$i;) { my $j=int rand($i+1); next if $i == $j;