--- loncom/homework/optionresponse.pm 2004/05/06 07:31:32 1.109
+++ 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.109 2004/05/06 07:31:32 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);
@@ -92,7 +92,7 @@ sub start_foilgroup {
my $result='';
%Apache::response::foilgroup=();
$Apache::optionresponse::conceptgroup=0;
- &Apache::response::setrandomnumber();
+ &Apache::response::pushrandomnumber();
if ($target eq 'edit') {
my $optionlist="\n";
my $option;
@@ -257,6 +257,7 @@ sub end_foilgroup {
if ($target eq 'tex' and $Apache::lonhomework::type ne 'exam') {
$result .= '\end{enumerate}';
}
+ &Apache::response::poprandomnumber();
return $result;
}
@@ -337,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|