--- loncom/homework/chemresponse.pm 2005/04/07 06:56:21 1.50 +++ loncom/homework/chemresponse.pm 2005/04/22 14:10:47 1.51 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # chemical equation style response # -# $Id: chemresponse.pm,v 1.50 2005/04/07 06:56:21 albertel Exp $ +# $Id: chemresponse.pm,v 1.51 2005/04/22 14:10:47 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -364,8 +364,11 @@ sub start_reactionresponse { } if ( &Apache::response::show_answer() ) { my $ans=&Apache::lonxml::get_param('answer',$parstack,$safeeval); - $ans=~s/(\\|\')/\\$1/g; - $Apache::inputtags::answertxt{$id}=&Apache::run::run("return &chemparse('$ans');",$safeeval); + if (!$Apache::lonxml::default_homework_loaded) { + &Apache::lonxml::default_homework_load($safeeval); + } + @Apache::scripttag::parser_env = @_; + $Apache::inputtags::answertxt{$id}=&Apache::run::run("return &chemparse(q\0$ans\0);",$safeeval); } } elsif ($target eq "edit") { $result .=&Apache::edit::tag_start($target,$token);