--- loncom/homework/optionresponse.pm 2004/07/02 08:21:39 1.111 +++ loncom/homework/optionresponse.pm 2004/07/06 14:53:00 1.112 @@ -1,7 +1,7 @@ # LearningOnline Network with CAPA # option list style responses # -# $Id: optionresponse.pm,v 1.111 2004/07/02 08:21:39 albertel Exp $ +# $Id: optionresponse.pm,v 1.112 2004/07/06 14:53:00 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -38,7 +38,7 @@ sub start_optionresponse { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $result=''; #when in a option response use these - &Apache::lonxml::register('Apache::optionresponse',('foilgroup','foil','conceptgroup')); + &Apache::lonxml::register('Apache::optionresponse',('foilgroup','foil','conceptgroup','drawoptionlist')); push (@Apache::lonxml::namespace,'optionresponse'); my $id = &Apache::response::start_response($parstack,$safeeval); %Apache::hint::option=(); @@ -78,7 +78,7 @@ sub end_optionresponse { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; &Apache::response::end_response; pop @Apache::lonxml::namespace; - &Apache::lonxml::deregister('Apache::optionresponse',('foilgroup','foil','conceptgroup')); + &Apache::lonxml::deregister('Apache::optionresponse',('foilgroup','foil','conceptgroup','drawoptionlist')); my $result; if ($target eq 'edit') { $result=&Apache::edit::end_table(); } undef(%Apache::response::foilnames); @@ -338,7 +338,7 @@ sub displayfoils { my $lastopt=$lastresponse{$name}; if ($text!~/^\s*$/) { $break='
'; } $result.=$break; - if ($target eq 'web') { + if ($target eq 'web' || $target eq 'tex') { my $value=$Apache::response::foilgroup{$name.'.value'}; if (!($text=~s||$value|)) { if ($text=~/^\s*$/) { @@ -350,7 +350,7 @@ sub displayfoils { $text='•'.$text; } $result.=$text."\n"; - } + } if ($Apache::lonhomework::type eq 'exam') { $result.=&webbubbles(\@opt,\@alphabet,$temp,$lastopt); } @@ -603,7 +603,6 @@ sub end_foil { my $result = ''; if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') { $text=&Apache::lonxml::endredirection; - $text=~/(\w)/; if (($target eq 'tex') and ($Apache::lonhomework::type ne 'exam') and ($text=~/\S/)) {$text = '\vspace*{-2 mm}\item '.$text;} } if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' @@ -647,6 +646,16 @@ sub end_foil { return $result; } +sub start_drawoptionlist { + my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; + return $token->[4]; +} + +sub end_drawoptionlist { + my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; + return $token->[2]; +} + sub insert_foil { return '