version 1.39, 2002/04/03 19:32:36
|
version 1.40, 2002/05/03 19:44:13
|
Line 213 sub whichfoils {
|
Line 213 sub whichfoils {
|
push (@falselist,$name); |
push (@falselist,$name); |
} elsif ($Apache::response::foilgroup{$name.'.value'} eq 'unused') { |
} elsif ($Apache::response::foilgroup{$name.'.value'} eq 'unused') { |
} else { |
} else { |
&Apache::lonxml::error("Unknown state $Apache::response::foilgroup{$name.'.value'} for $name in <foilgroup>"); |
&Apache::lonxml::error(&HTML::Entites::encode("No valid value assigned ($Apache::response::foilgroup{$name.'.value'}) for foil $name in <foilgroup>")); |
} |
} |
} |
} |
my $whichtrue = int(rand($#truelist+1)); |
my $whichtrue = int(rand($#truelist+1)); |
&Apache::lonxml::debug("Max is $max, From $#truelist elms, picking $whichtrue"); |
&Apache::lonxml::debug("Max is $max, From $#truelist elms, picking $whichtrue"); |
my @whichfalse =(); |
my @whichfalse =(); |
while ((($#whichfalse+1) < $max) && ($#falselist > -1)) { |
while ((($#whichfalse+1) < $max-1) && ($#falselist > -1)) { |
&Apache::lonxml::debug("Have $#whichfalse max is $max"); |
&Apache::lonxml::debug("Have $#whichfalse max is $max"); |
my $afalse=int(rand($#falselist+1)); |
my $afalse=int(rand($#falselist+1)); |
&Apache::lonxml::debug("From $#falselist elms, picking $afalse"); |
&Apache::lonxml::debug("From $#falselist elms, picking $afalse"); |