--- loncom/homework/optionresponse.pm 2002/04/25 21:35:30 1.38 +++ loncom/homework/optionresponse.pm 2002/05/03 19:32:57 1.39 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # option list style responses # -# $Id: optionresponse.pm,v 1.38 2002/04/25 21:35:30 sakharuk Exp $ +# $Id: optionresponse.pm,v 1.39 2002/05/03 19:32:57 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -229,6 +229,7 @@ sub getfoilcounts { my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2'); # +1 since instructors will count from 1 my $count = $#{ $Apache::response::foilgroup{'names'} }+1; + if (&Apache::response::showallfoils()) { $max=$count; } return ($count,$max); } @@ -238,7 +239,12 @@ sub whichfoils { my @whichopt =(); while ((($#whichopt+1) < $max) && ($#names > -1)) { &Apache::lonxml::debug("Have $#whichopt max is $max"); - my $aopt=int(rand($#names+1)); + my $aopt; + if (&Apache::response::showallfoils()) { + $aopt=0; + } else { + $aopt=int(rand($#names+1)); + } &Apache::lonxml::debug("From $#whichopt $max $#names elms, picking $aopt"); $aopt=splice(@names,$aopt,1); &Apache::lonxml::debug("Picked $aopt"); @@ -424,7 +430,8 @@ sub end_foil { &Apache::lonxml::debug("Got a name of :$name:"); if (!$name) { $name=$Apache::lonxml::curdepth; } &Apache::lonxml::debug("Using a name of :$name:"); - if ( $Apache::optionresponse::conceptgroup ) { + if ( $Apache::optionresponse::conceptgroup + && !&Apache::response::showallfoils() ) { push @{ $Apache::response::conceptgroup{'names'} }, $name; $Apache::response::conceptgroup{"$name.value"} = $value; $Apache::response::conceptgroup{"$name.text"} = $text;