--- loncom/homework/optionresponse.pm 2005/04/07 06:56:22 1.125 +++ loncom/homework/optionresponse.pm 2005/06/20 21:31:07 1.127 @@ -1,7 +1,7 @@ # LearningOnline Network with CAPA # option list style responses # -# $Id: optionresponse.pm,v 1.125 2005/04/07 06:56:22 albertel Exp $ +# $Id: optionresponse.pm,v 1.127 2005/06/20 21:31:07 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -165,6 +165,8 @@ sub end_foilgroup { my $name; my @opt; eval '@opt ='.&Apache::lonxml::get_param('options',$parstack,$safeeval); + &Apache::lonxml::debug("options:".join(':',@opt)); + my $TeXlayout=&Apache::lonxml::get_param('TeXlayout',$parstack,$safeeval, -2,0); if ($target eq 'tex' && $tex_option_switch eq 'nochoice') {@opt=();} @@ -358,7 +360,7 @@ sub displayfoils { if ($text=~/^\s*$/) { $text=$value.$text; } else { - $text=$value.': '.$text; + $text=''.$value.': '.$text; } } else { $text='•'.$text; @@ -385,13 +387,13 @@ sub displayfoils { } my $lastopt=$lastresponse{$name}; my $optionlist="\n"; - my $option; - foreach $option (@opt) { - if ($option eq $lastopt) { - $optionlist.="\n"; - } else { - $optionlist.="\n"; - } + foreach my $option (@opt) { + my $escopt=&HTML::Entities::encode($option,'\'"&<>'); + if ($option eq $lastopt) { + $optionlist.="\n"; + } else { + $optionlist.="\n"; + } } if ($target ne 'tex') { if ($Apache::lonhomework::type ne 'exam') {