version 1.148.2.1, 2011/09/16 23:14:28
|
version 1.149, 2011/06/07 17:27:37
|
Line 555 sub whichfoils {
|
Line 555 sub whichfoils {
|
$dosplice=0; |
$dosplice=0; |
} else { |
} else { |
if ($topcount>0 || $bottomcount>0) { |
if ($topcount>0 || $bottomcount>0) { |
my $inc = 1; |
$answer = int(&Math::Random::random_uniform() * ($#whichfalse+1)) |
if (($bottomcount > 0) && ($Apache::lonhomework::type ne 'exam')) { |
+ $topcount; |
$inc = 2; |
|
} |
|
$answer=int(&Math::Random::random_uniform() * ($#whichfalse+$inc)) |
|
+ $topcount; |
|
|
|
} |
} |
} |
} |
&Apache::lonxml::debug("Answer now wants $answer"); |
&Apache::lonxml::debug("Answer now wants $answer"); |
Line 820 sub end_foil {
|
Line 815 sub end_foil {
|
&Apache::lonxml::warning(&mt('Foils without names exist. This can cause problems to malfunction.')); |
&Apache::lonxml::warning(&mt('Foils without names exist. This can cause problems to malfunction.')); |
$name=$Apache::lonxml::curdepth; |
$name=$Apache::lonxml::curdepth; |
} |
} |
|
if ($name eq "0") { |
|
&Apache::lonxml::error(&mt('Foil name [_1] is not supported. Please choose another name.','<b><tt>'.$name.'</tt></b>')); |
|
} |
if (defined($Apache::response::foilnames{$name})) { |
if (defined($Apache::response::foilnames{$name})) { |
&Apache::lonxml::error(&mt('Foil name [_1] appears more than once. Foil names need to be unique.','<b><tt>'.$name.'</tt></b>')); |
&Apache::lonxml::error(&mt('Foil name [_1] appears more than once. Foil names need to be unique.','<b><tt>'.$name.'</tt></b>')); |
} |
} |