--- loncom/homework/radiobuttonresponse.pm 2002/04/03 16:54:37 1.38 +++ loncom/homework/radiobuttonresponse.pm 2002/05/03 19:44:13 1.40 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # mutliple choice style responses # -# $Id: radiobuttonresponse.pm,v 1.38 2002/04/03 16:54:37 sakharuk Exp $ +# $Id: radiobuttonresponse.pm,v 1.40 2002/05/03 19:44:13 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -213,13 +213,13 @@ sub whichfoils { push (@falselist,$name); } elsif ($Apache::response::foilgroup{$name.'.value'} eq 'unused') { } else { - &Apache::lonxml::error("Unknown state $Apache::response::foilgroup{$name.'.value'} for $name in "); + &Apache::lonxml::error(&HTML::Entites::encode("No valid value assigned ($Apache::response::foilgroup{$name.'.value'}) for foil $name in ")); } } my $whichtrue = int(rand($#truelist+1)); &Apache::lonxml::debug("Max is $max, From $#truelist elms, picking $whichtrue"); my @whichfalse =(); - while ((($#whichfalse+1) < $max) && ($#falselist > -1)) { + while ((($#whichfalse+1) < $max-1) && ($#falselist > -1)) { &Apache::lonxml::debug("Have $#whichfalse max is $max"); my $afalse=int(rand($#falselist+1)); &Apache::lonxml::debug("From $#falselist elms, picking $afalse"); @@ -266,11 +266,8 @@ sub displayfoils { $temp++; } } - if ($target ne 'tex') { - return $result."
"; - } else { - return $result; - } + if ($target ne 'tex') { $result.="
"; } + return $result; } sub displayanswers {