version 1.3, 2001/02/22 01:13:43
|
version 1.4, 2001/03/01 01:19:50
|
Line 26 sub end_imageresponse {
|
Line 26 sub end_imageresponse {
|
%Apache::response::foilgroup={}; |
%Apache::response::foilgroup={}; |
sub start_foilgroup { |
sub start_foilgroup { |
%Apache::response::foilgroup={}; |
%Apache::response::foilgroup={}; |
|
$Apache::optionresponse::conceptgroup=0; |
|
&setrandomnumber(); |
return ''; |
return ''; |
} |
} |
|
|
Line 122 sub end_foilgroup {
|
Line 124 sub end_foilgroup {
|
my $result=''; |
my $result=''; |
my @whichopt; |
my @whichopt; |
if ($target eq 'web' || $target eq 'grade') { |
if ($target eq 'web' || $target eq 'grade') { |
&setrandomnumber(); |
|
my ($count,$max) = &getfoilcounts($parstack,$safeeval); |
my ($count,$max) = &getfoilcounts($parstack,$safeeval); |
if ($count>$max) { $count=$max } |
if ($count>$max) { $count=$max } |
&Apache::lonxml::debug("Count is $count from $max"); |
&Apache::lonxml::debug("Count is $count from $max"); |
Line 140 sub end_foilgroup {
|
Line 141 sub end_foilgroup {
|
} |
} |
|
|
sub start_conceptgroup { |
sub start_conceptgroup { |
|
$Apache::optionresponse::conceptgroup=1; |
|
%Apache::response::conceptgroup={}; |
|
return ''; |
} |
} |
|
|
sub end_conceptgroup { |
sub end_conceptgroup { |
|
my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; |
|
$Apache::optionresponse::conceptgroup=0; |
|
if ($target eq 'web' || $target eq 'grade') { |
|
my @names = @{ $Apache::response::conceptgroup{'names'} }; |
|
my $pick=int rand $#names+1; |
|
my $name=$names[$pick]; |
|
push @{ $Apache::response::foilgroup{'names'} }, $name; |
|
$Apache::response::foilgroup{"$name.text"} = $Apache::response::conceptgroup{"$name.text"}; |
|
$Apache::response::foilgroup{"$name.image"} = $Apache::response::conceptgroup{"$name.image"}; |
|
push(@{ $Apache::response::foilgroup{"$name.area"} }, @{ $Apache::response::conceptgroup{"$name.area"} }); |
|
my $args; |
|
if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; } |
|
my $concept = &Apache::run::run("{$args;".'return $concept}',$safeeval); |
|
$Apache::response::foilgroup{"$name.concept"} = $concept; |
|
&Apache::lonxml::debug("Selecting $name in $concept"); |
|
} |
|
return ''; |
} |
} |
|
|
$Apache::imageresponse::curname=''; |
$Apache::imageresponse::curname=''; |