--- loncom/homework/chemresponse.pm 2004/08/10 18:05:12 1.37 +++ loncom/homework/chemresponse.pm 2005/01/08 03:54:32 1.43 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # chemical equation style response # -# $Id: chemresponse.pm,v 1.37 2004/08/10 18:05:12 albertel Exp $ +# $Id: chemresponse.pm,v 1.43 2005/01/08 03:54:32 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -121,8 +121,9 @@ $molecule CHEMPAGE $body=&HTML::Entities::encode($body,'<>&"'); $body=~s/\n/ /g; + my $docopen=&Apache::lonhtmlcommon::javascript_docopen(); my $result=< + CHEMINPUT return $result; } @@ -210,6 +211,9 @@ sub end_organicresponse { $ad='INCORRECT'; } } + if ($ad && $Apache::lonhomework::type eq 'survey') { + $ad='SUBMITTED'; + } &Apache::response::handle_previous(\%previous,$ad); $Apache::lonhomework::results{"resource.$partid.$id.awarddetail"}=$ad; $Apache::lonhomework::results{"resource.$partid.$id.molecule"}=$ENV{"form.MOLECULE_$id"}; @@ -245,7 +249,7 @@ sub start_organicstructure { 'cgi.'.$id.'.PNG' => 1, 'cgi.'.$id.'.WIDTH' => $width ); } elsif ($target eq 'tex') { - my $texwidth=&Apache::lonxml::get_param('texwidth',$parstack,$safeeval,1); + my $texwidth=&Apache::lonxml::get_param('texwidth',$parstack,$safeeval,undef,1); if (!$texwidth) { $texwidth='90'; } my $molecule=&Apache::lonxml::get_param('molecule',$parstack,$safeeval); my $options=&Apache::lonxml::get_param('options',$parstack,$safeeval); @@ -308,11 +312,12 @@ sub edit_reaction_button { my $id_es=&Apache::lonnet::escape($id); my $field_es=&Apache::lonnet::escape($field); my $reaction_es=&Apache::lonnet::escape($reaction); + my $docopen=&Apache::lonhtmlcommon::javascript_docopen(); my $result=< function create_reaction_window_${id}_${field} () { editor=window.open('','','width=500,height=270,scrollbars=no,resizable=yes'); - editor.document.open('text/html','replace'); + editor.$docopen; editor.document.writeln(' LON-CAPA Reaction Editor '); } @@ -350,7 +355,7 @@ sub start_reactionresponse { $result .=&edit_reaction_button($id,&Apache::edit::html_element_name('answer'),$answer).''; my $initial=&Apache::lonxml::get_param('initial',$parstack,$safeeval); $result.=''. - &Apache::edit::text_arg('Initial Reation:','initial',$token,40); + &Apache::edit::text_arg('Initial Reaction:','initial',$token,40); $result .=&edit_reaction_button($id,&Apache::edit::html_element_name('initial'),$initial).''; $result .=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); @@ -385,6 +390,9 @@ sub end_reactionresponse { $ad='INCORRECT'; } } + if ($ad && $Apache::lonhomework::type eq 'survey') { + $ad='SUBMITTED'; + } &Apache::response::handle_previous(\%previous,$ad); $Apache::lonhomework::results{"resource.$partid.$id.awarddetail"}=$ad; }