version 1.50, 2005/04/07 06:56:21
|
version 1.53, 2005/05/25 21:45:07
|
Line 121 $molecule
|
Line 121 $molecule
|
CHEMPAGE |
CHEMPAGE |
$body=&HTML::Entities::encode($body,'<>&"'); |
$body=&HTML::Entities::encode($body,'<>&"'); |
$body=~s/\n/ /g; |
$body=~s/\n/ /g; |
|
my $nothing=&Apache::lonhtmlcommon::javascript_nothing(); |
my $docopen=&Apache::lonhtmlcommon::javascript_docopen(); |
my $docopen=&Apache::lonhtmlcommon::javascript_docopen(); |
my $result=<<CHEMINPUT; |
my $result=<<CHEMINPUT; |
<input type="button" value="Draw Molecule" onclick="javascript:editor=window.open('/rat/adm/empty.html','jmeedit','width=500,height=500,menubar=yes,scrollbars=no,resizable=yes');editor.$docopen;editor.document.write('$body');editor.document.close();editor.focus()" /> |
<input type="button" value="Draw Molecule" onclick="javascript:editor=window.open('$nothing','jmeedit','width=500,height=500,menubar=yes,scrollbars=no,resizable=yes');editor.$docopen;editor.document.write('$body');editor.document.close();editor.focus()" /> |
CHEMINPUT |
CHEMINPUT |
return $result; |
return $result; |
} |
} |
Line 364 sub start_reactionresponse {
|
Line 365 sub start_reactionresponse {
|
} |
} |
if ( &Apache::response::show_answer() ) { |
if ( &Apache::response::show_answer() ) { |
my $ans=&Apache::lonxml::get_param('answer',$parstack,$safeeval); |
my $ans=&Apache::lonxml::get_param('answer',$parstack,$safeeval); |
$ans=~s/(\\|\')/\\$1/g; |
if (!$Apache::lonxml::default_homework_loaded) { |
$Apache::inputtags::answertxt{$id}=&Apache::run::run("return &chemparse('$ans');",$safeeval); |
&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") { |
} elsif ($target eq "edit") { |
$result .=&Apache::edit::tag_start($target,$token); |
$result .=&Apache::edit::tag_start($target,$token); |