--- loncom/homework/optionresponse.pm 2003/07/25 18:46:19 1.80
+++ loncom/homework/optionresponse.pm 2003/10/03 15:23:53 1.88
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: optionresponse.pm,v 1.80 2003/07/25 18:46:19 sakharuk Exp $
+# $Id: optionresponse.pm,v 1.88 2003/10/03 15:23:53 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -152,11 +152,11 @@ sub end_foilgroup {
my $result;
if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || $target eq 'tex' || $target eq 'analyze') {
- my $tex_option_switch=&Apache::lonxml::get_param('texout',$parstack,$safeeval);
+ my $tex_option_switch=&Apache::lonxml::get_param('texoptions',$parstack,$safeeval);
my $name;
my @opt;
eval '@opt ='.&Apache::lonxml::get_param('options',$parstack,$safeeval);
- if ($target eq 'tex' && $tex_option_switch eq 'nooptions') {@opt=();}
+ if ($target eq 'tex' && $tex_option_switch eq 'nochoice') {@opt=();}
&Apache::lonxml::debug("Options are $#opt");
my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2');
my $randomize = &Apache::lonxml::get_param('randomize',$parstack,
@@ -303,9 +303,8 @@ sub displayfoils {
my $break;
my $solved=$Apache::lonhomework::history{"resource.$part.solved"};
my $status=$Apache::inputtags::status[-1];
- if (
- ($target ne 'tex') &&
- (($solved =~ /^correct/) || ($status eq 'SHOW_ANSWER')) ) {
+ if ( ($target ne 'tex') &&
+ &Apache::response::show_answer() ) {
foreach $name (@whichopt) {
my $text=$Apache::response::foilgroup{$name.'.text'};
if ($text!~/^\s*$/) {
@@ -328,7 +327,8 @@ sub displayfoils {
$result.=$text."\n";
} elsif ($target eq 'tex') {
$Apache::response::foilgroup{$name.'.text'}=~s/\\item//;
- $result .='\item \textit{'.$Apache::response::foilgroup{$name.'.value'}.'}'.
+ if ($max>1) {$result .='\item ';}
+ $result .=' \textit{'.$Apache::response::foilgroup{$name.'.value'}.'}'.
":".$Apache::response::foilgroup{$name.'.text'}."\n";
}
if ($Apache::lonhomework::type eq 'exam') {
@@ -436,8 +436,8 @@ sub displayfoils {
sub optionlist_correction {
my $texoptionlist = shift;
- if ($texoptionlist=~/