--- loncom/homework/radiobuttonresponse.pm 2011/05/27 18:40:37 1.148 +++ loncom/homework/radiobuttonresponse.pm 2011/09/16 23:14:28 1.148.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # mutliple choice style responses # -# $Id: radiobuttonresponse.pm,v 1.148 2011/05/27 18:40:37 raeburn Exp $ +# $Id: radiobuttonresponse.pm,v 1.148.2.1 2011/09/16 23:14:28 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -555,8 +555,13 @@ sub whichfoils { $dosplice=0; } else { if ($topcount>0 || $bottomcount>0) { - $answer = int(&Math::Random::random_uniform() * ($#whichfalse+1)) - + $topcount; + my $inc = 1; + if (($bottomcount > 0) && ($Apache::lonhomework::type ne 'exam')) { + $inc = 2; + } + $answer=int(&Math::Random::random_uniform() * ($#whichfalse+$inc)) + + $topcount; + } } &Apache::lonxml::debug("Answer now wants $answer");