--- loncom/homework/chemresponse.pm 2006/06/27 14:15:26 1.67 +++ loncom/homework/chemresponse.pm 2006/07/27 20:34:40 1.69 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # chemical equation style response # -# $Id: chemresponse.pm,v 1.67 2006/06/27 14:15:26 albertel Exp $ +# $Id: chemresponse.pm,v 1.69 2006/07/27 20:34:40 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -110,14 +110,15 @@ function substituent(r) {document.applet CHEMJS my $start_page = - &Apache::loncommon::start_page('Molecule Editor',$js, + &Apache::loncommon::start_page('Molecule Editor',undef, {'only_body' => 1, + 'js_ready' => 1, 'bgcolor' => '#FFFFFF',}); - my $end_page = - &Apache::loncommon::end_page(); - + my $end_page = + &Apache::loncommon::end_page({'js_ready' => 1,}); + my $body=<
@@ -155,17 +156,26 @@ $insert_answer -$end_page CHEMPAGE - $body=&HTML::Entities::encode($body,'<>&"'); - $body=~s/\n/ /g; + $body=&Apache::loncommon::js_ready($body); my $nothing=&Apache::lonhtmlcommon::javascript_nothing(); my $docopen=&Apache::lonhtmlcommon::javascript_docopen(); my $display=&mt('Draw Molecule'); if (defined($shown_text)) { $display=&mt($shown_text); } + my $function = + 'LONCAPA_draw_molecule_'.&Apache::lonhtmlcommon::get_uniq_name(); my $result=< + + CHEMINPUT return $result; } @@ -414,7 +424,7 @@ sub edit_reaction_button { {'frameset' => 1, 'js_ready' => 1, 'add_entries' => { - 'rows' => "30%", + 'rows' => "30%,*", 'border' => "0",}},); my $end_page = &Apache::loncommon::end_page({'frameset' => 1, @@ -426,6 +436,7 @@ sub edit_reaction_button { editor=window.open('','','width=500,height=270,scrollbars=no,resizable=yes'); editor.$docopen; editor.document.writeln('$start_page $end_page'); + editor.document.close(); } // -->