--- loncom/homework/optionresponse.pm 2005/04/07 06:56:22 1.125 +++ loncom/homework/optionresponse.pm 2005/06/07 01:33:19 1.126 @@ -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.126 2005/06/07 01:33:19 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=();} @@ -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') {