--- loncom/homework/chemresponse.pm 2006/04/13 18:57:51 1.65 +++ loncom/homework/chemresponse.pm 2006/05/30 12:45:36 1.66 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # chemical equation style response # -# $Id: chemresponse.pm,v 1.65 2006/04/13 18:57:51 albertel Exp $ +# $Id: chemresponse.pm,v 1.66 2006/05/30 12:45:36 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,6 +31,9 @@ use strict; use Apache::lonxml; use Apache::lonnet; use Apache::lonlocal; +use lib '/home/httpd/lib/perl/'; +use LONCAPA; + BEGIN { &Apache::lonxml::register('Apache::chemresponse',('organicresponse','organicstructure','reactionresponse','chem')); @@ -174,7 +177,7 @@ sub jme_img { if ($options =~ /border/) { $result.= ' border="1"'; } $result.=' />'; &Apache::lonnet::appenv('cgi.'.$id.'.JME' => - &Apache::lonnet::escape($jme), + &escape($jme), 'cgi.'.$id.'.PNG' => 1, 'cgi.'.$id.'.WIDTH' => $width); return $result; @@ -333,7 +336,7 @@ sub start_organicstructure { if ($options =~ /border/) { $result.= ' border="1"'; } $result.=' />'; &Apache::lonnet::appenv( - 'cgi.'.$id.'.JME' => &Apache::lonnet::escape($molecule), + 'cgi.'.$id.'.JME' => &escape($molecule), 'cgi.'.$id.'.PNG' => 1, 'cgi.'.$id.'.WIDTH' => $width ); } elsif ($target eq 'tex') { @@ -349,10 +352,10 @@ sub start_organicstructure { '_'.time.'_'.$$.int(rand(1000)).'_organicstructure'; my $id=$filename; &Apache::lonnet::appenv( - 'cgi.'.$id.'.JME' => &Apache::lonnet::escape($molecule), + 'cgi.'.$id.'.JME' => &escape($molecule), 'cgi.'.$id.'.PS' => 1, 'cgi.'.$id.'.WIDTH' => $texwidth ); - $id=&Apache::lonnet::escape($id); + $id=&escape($id); &Apache::lonxml::register_ssi("/cgi-bin/convertjme.pl?$id"); if ($options =~ /border/) { $result.= '\fbox{'; } $result .= '\graphicspath{{/home/httpd/perl/tmp/}}\includegraphics[width='.$texwidth.' mm]{'.$filename.'.eps}'; @@ -401,9 +404,9 @@ sub end_organicstructure { sub edit_reaction_button { my ($id,$field,$reaction)=@_; - my $id_es=&Apache::lonnet::escape($id); - my $field_es=&Apache::lonnet::escape($field); - my $reaction_es=&Apache::lonnet::escape($reaction); + my $id_es=&escape($id); + my $field_es=&escape($field); + my $reaction_es=&escape($reaction); my $docopen=&Apache::lonhtmlcommon::javascript_docopen(); my $start_page = &Apache::loncommon::start_page('LON-CAPA Reaction Editor',undef,