version 1.80, 2004/01/14 22:08:22
|
version 1.82, 2004/03/05 19:44:18
|
Line 160 sub end_foilgroup {
|
Line 160 sub end_foilgroup {
|
$target eq 'tex' || $target eq 'analyze') { |
$target eq 'tex' || $target eq 'analyze') { |
my $style = $Apache::lonhomework::type; |
my $style = $Apache::lonhomework::type; |
if ( $style eq 'survey' && $target ne 'analyze') { |
if ( $style eq 'survey' && $target ne 'analyze') { |
if ($target eq 'web' || $target eq 'answer' || $target eq 'tex') { |
if ($target eq 'web' || $target eq 'tex') { |
$result=&displayallfoils(); |
$result=&displayallfoils(); |
} elsif ( $target eq 'grade' ) { |
} elsif ( $target eq 'answer' ) { |
$result=&storesurvey(); |
$result=&displayallanswers(); |
} |
} elsif ( $target eq 'grade' ) { |
|
$result=&storesurvey(); |
|
} |
} else { |
} else { |
my $name; |
my $name; |
my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2'); |
my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2'); |
Line 333 sub whichfoils {
|
Line 335 sub whichfoils {
|
&Apache::lonxml::debug("Answer wants $answer"); |
&Apache::lonxml::debug("Answer wants $answer"); |
my $truename=$truelist[$whichtrue]; |
my $truename=$truelist[$whichtrue]; |
my $dosplice=1; |
my $dosplice=1; |
if ($notrue) { |
if ($notrue && $Apache::lonhomework::type ne 'survey') { |
$dosplice=0; |
$dosplice=0; |
&Apache::lonxml::error("There are no true statements available.<br />"); |
&Apache::lonxml::error("There are no true statements available.<br />"); |
} |
} |
Line 433 sub displayfoils {
|
Line 435 sub displayfoils {
|
return $result; |
return $result; |
} |
} |
|
|
|
sub displayallanswers { |
|
my @names = @{ $Apache::response::foilgroup{'names'} }; |
|
|
|
my $result=&Apache::response::answer_header('radiobuttonresponse'); |
|
foreach my $name (@names) { |
|
$result.=&Apache::response::answer_part('radiobuttonresponse', |
|
$Apache::response::foilgroup{$name.'.value'}); |
|
} |
|
$result.=&Apache::response::answer_footer('radiobuttonresponse'); |
|
return $result; |
|
} |
|
|
sub displayanswers { |
sub displayanswers { |
my ($max,$randomize)=@_; |
my ($max,$randomize)=@_; |
my ($answer,@whichopt) = &whichfoils($max,$randomize); |
my ($answer,@whichopt) = &whichfoils($max,$randomize); |