version 1.101, 2005/06/21 21:00:55
|
version 1.104, 2005/10/11 20:02:31
|
Line 60 sub start_radiobuttonresponse {
|
Line 60 sub start_radiobuttonresponse {
|
$token,'4'). |
$token,'4'). |
&Apache::edit::select_arg('Randomize Foil Order','randomize', |
&Apache::edit::select_arg('Randomize Foil Order','randomize', |
['yes','no'],$token). |
['yes','no'],$token). |
|
&Apache::edit::select_arg('Display Direction','direction', |
|
['vertical','horizontal'],$token). |
&Apache::edit::end_row(). |
&Apache::edit::end_row(). |
&Apache::edit::start_spanning_row()."\n"; |
&Apache::edit::start_spanning_row()."\n"; |
} elsif ($target eq 'modified') { |
} elsif ($target eq 'modified') { |
my $constructtag=&Apache::edit::get_new_args($token,$parstack, |
my $constructtag=&Apache::edit::get_new_args($token,$parstack, |
$safeeval,'max', |
$safeeval,'max', |
'randomize'); |
'randomize','direction'); |
if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); } |
if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); } |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
my $type=&Apache::lonxml::get_param('TeXtype',$parstack,$safeeval, |
my $type=&Apache::lonxml::get_param('TeXtype',$parstack,$safeeval, |
Line 289 sub whichfoils {
|
Line 291 sub whichfoils {
|
my ($truecnt,$falsecnt) = &getfoilcounts(); |
my ($truecnt,$falsecnt) = &getfoilcounts(); |
my $count=0; |
my $count=0; |
# we will add in 1 of the true statements |
# we will add in 1 of the true statements |
if (($falsecnt+1)>$max) { $count=$max } else { $count=$falsecnt+1; } |
if ( $max>0 && ($falsecnt+1)>$max) { $count=$max } else { $count=$falsecnt+1; $max=$count; } |
my $answer=int(&Math::Random::random_uniform() * ($count)); |
my $answer=int(&Math::Random::random_uniform() * ($count)); |
&Apache::lonxml::debug("Count is $count, $answer is $answer"); |
&Apache::lonxml::debug("Count is $count, $answer is $answer"); |
my @names; |
my @names; |
Line 607 sub end_foil {
|
Line 609 sub end_foil {
|
my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval); |
my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval); |
if ($value ne 'unused') { |
if ($value ne 'unused') { |
my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); |
my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); |
if (!$name) { |
if ($name eq "") { |
&Apache::lonxml::warning("Foils without names exist. This can cause problems to malfunction."); |
&Apache::lonxml::warning("Foils without names exist. This can cause problems to malfunction."); |
$name=$Apache::lonxml::curdepth; |
$name=$Apache::lonxml::curdepth; |
} |
} |