version 1.34, 2004/06/07 21:56:24
|
version 1.39, 2004/09/27 20:59:21
|
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 $result=<<CHEMINPUT; |
my $result=<<CHEMINPUT; |
<input type="button" value="Draw Molecule" onClick="javascript:editor=window.open('','','width=500,height=500,scrollbars=no,resizable=yes');editor.document.open('text/html','replace');editor.document.writeln('$body')" /> |
<input type="button" value="Draw Molecule" onClick="javascript:editor=window.open('','','width=500,height=500,scrollbars=no,resizable=yes');editor.document.open($nothing,'replace');editor.document.writeln('$body')" /> |
CHEMINPUT |
CHEMINPUT |
return $result; |
return $result; |
} |
} |
Line 245 sub start_organicstructure {
|
Line 246 sub start_organicstructure {
|
'cgi.'.$id.'.PNG' => 1, |
'cgi.'.$id.'.PNG' => 1, |
'cgi.'.$id.'.WIDTH' => $width ); |
'cgi.'.$id.'.WIDTH' => $width ); |
} elsif ($target eq 'tex') { |
} 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'; } |
if (!$texwidth) { $texwidth='90'; } |
my $molecule=&Apache::lonxml::get_param('molecule',$parstack,$safeeval); |
my $molecule=&Apache::lonxml::get_param('molecule',$parstack,$safeeval); |
my $options=&Apache::lonxml::get_param('options',$parstack,$safeeval); |
my $options=&Apache::lonxml::get_param('options',$parstack,$safeeval); |
Line 308 sub edit_reaction_button {
|
Line 309 sub edit_reaction_button {
|
my $id_es=&Apache::lonnet::escape($id); |
my $id_es=&Apache::lonnet::escape($id); |
my $field_es=&Apache::lonnet::escape($field); |
my $field_es=&Apache::lonnet::escape($field); |
my $reaction_es=&Apache::lonnet::escape($reaction); |
my $reaction_es=&Apache::lonnet::escape($reaction); |
|
my $nothing= &Apache::lonhtmlcommon::javascript_nothing(); |
my $result=<<EDITREACTION; |
my $result=<<EDITREACTION; |
<script type="text/javascript"> |
<script type="text/javascript"> |
function create_reaction_window_${id}_${field} () { |
function create_reaction_window_${id}_${field} () { |
editor=window.open('','','width=500,height=270,scrollbars=no,resizable=yes'); |
editor=window.open('','','width=500,height=270,scrollbars=no,resizable=yes'); |
editor.document.open('text/html','replace'); |
editor.document.open($nothing,'replace'); |
editor.document.writeln('<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><html> <head><title>LON-CAPA Reaction Editor</title></head><frameset rows="30%,*" border="0"> <frame src="/res/adm/pages/reactionresponse/reaction_viewer.html" name="viewer" scrolling="no" /> <frame src="/res/adm/pages/reactionresponse/reaction_editor.html?reaction=$reaction_es&id=$id_es&field=$field_es" name="editor" scrolling="no" /> </frameset> </html>'); |
editor.document.writeln('<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><html> <head><title>LON-CAPA Reaction Editor</title></head><frameset rows="30%,*" border="0"> <frame src="/res/adm/pages/reactionresponse/reaction_viewer.html?inhibitmenu=yes" name="viewer" scrolling="no" /> <frame src="/res/adm/pages/reactionresponse/reaction_editor.html?inhibitmenu=yes&reaction=$reaction_es&id=$id_es&field=$field_es" name="editor" scrolling="no" /> </frameset> </html>'); |
} |
} |
</script> |
</script> |
<input type='button' value='Edit Reaction' onClick="javascript:create_reaction_window_${id}_${field}();void(0);" /> |
<input type='button' value='Edit Answer' onClick="javascript:create_reaction_window_${id}_${field}();void(0);" /> |
EDITREACTION |
EDITREACTION |
return $result; |
return $result; |
} |
} |
Line 331 sub start_reactionresponse {
|
Line 333 sub start_reactionresponse {
|
my $partid = $Apache::inputtags::part; |
my $partid = $Apache::inputtags::part; |
my $id = $Apache::inputtags::response['-1']; |
my $id = $Apache::inputtags::response['-1']; |
my $reaction=$Apache::lonhomework::history{"resource.$partid.$id.submission"}; |
my $reaction=$Apache::lonhomework::history{"resource.$partid.$id.submission"}; |
|
if ($reaction eq '') { $reaction=&Apache::lonxml::get_param('initial',$parstack,$safeeval); } |
my $status=$Apache::inputtags::status['-1']; |
my $status=$Apache::inputtags::status['-1']; |
if ($status eq 'CAN_ANSWER') { |
if ($status eq 'CAN_ANSWER') { |
$result.=&edit_reaction_button($id,"HWVAL_$id",$reaction); |
$result.=&edit_reaction_button($id,"HWVAL_$id",$reaction); |
Line 347 sub start_reactionresponse {
|
Line 350 sub start_reactionresponse {
|
$result .='<nobr>'. |
$result .='<nobr>'. |
&Apache::edit::text_arg('Answer:','answer',$token,40); |
&Apache::edit::text_arg('Answer:','answer',$token,40); |
$result .=&edit_reaction_button($id,&Apache::edit::html_element_name('answer'),$answer).'</nobr>'; |
$result .=&edit_reaction_button($id,&Apache::edit::html_element_name('answer'),$answer).'</nobr>'; |
|
my $initial=&Apache::lonxml::get_param('initial',$parstack,$safeeval); |
|
$result.='<nobr>'. |
|
&Apache::edit::text_arg('Initial Reation:','initial',$token,40); |
|
$result .=&edit_reaction_button($id,&Apache::edit::html_element_name('initial'),$initial).'</nobr>'; |
|
|
$result .=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); |
$result .=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); |
} elsif ($target eq 'modified') { |
} elsif ($target eq 'modified') { |
my $constructtag=&Apache::edit::get_new_args($token,$parstack, |
my $constructtag=&Apache::edit::get_new_args($token,$parstack, |
$safeeval,'answer'); |
$safeeval,'answer', |
|
'initial'); |
if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); } |
if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); } |
} |
} |
return $result; |
return $result; |