Diff for /loncom/homework/chemresponse.pm between versions 1.56 and 1.63

version 1.56, 2005/05/26 21:26:25 version 1.63, 2006/03/09 00:48:47
Line 81  JMESECTION Line 81  JMESECTION
     }      }
   
     if ($molecule) { $molecule='<param name="jme" value="'.$molecule.'" />'; }      if ($molecule) { $molecule='<param name="jme" value="'.$molecule.'" />'; }
       my $insert_answer;
       if ($shown_text eq '') { 
    $insert_answer=
       '<input type="button" name="submit" value="Insert Answer" onclick="javascript:submitSmiles();" />';
       }
   
     my $body=<<CHEMPAGE;      my $body=<<CHEMPAGE;
 <html>  <html>
 <head>  <head>
Line 99  function submitSmiles() { Line 105  function submitSmiles() {
 function openHelpWindow() {  function openHelpWindow() {
     window.open("/adm/jme/jme_help.html","","scrollbars=yes,resizable=yes,width=500,height=600");      window.open("/adm/jme/jme_help.html","","scrollbars=yes,resizable=yes,width=500,height=600");
 }  }
   function substituent(r) {document.applets.JME.setSubstituent(r);}
 </script>  </script>
 </head>  </head>
 <body bgcolor="#ffffff">  <body bgcolor="#ffffff">
 <center>  <center>
 <applet code="JME.class" name="JME" archive="/adm/jme/JME.jar" width="440" height="390">  <form>
     <table width="440"><tr>
       <td></td>
       <td align="right">
         <select onchange="javascript:substituent(options[selectedIndex].text)">
           <option>Select substituent</option>
           <option>-C(=O)OH</option>
           <option>-C(=O)OMe</option>
           <option>-OC(=O)Me</option>
           <option>-CMe3</option>
           <option>-CF3</option>
           <option>-CCl3</option>
           <option>-NO2</option>
           <option>-SO2-NH2</option>
           <option>-NH-SO2-Me</option>
           <option>-NMe2</option>
           <option>-C#N</option>
           <option>-C#C-Me</option>
           <option>-C#CH</option>
         </select>
       </td></tr>
     </table>
   <applet code="JME.class" name="JME" archive="/adm/jme/JME.jar" width="440" height="390" mayscript>
 You have to enable Java and JavaScript on your machine.  You have to enable Java and JavaScript on your machine.
 $molecule  $molecule
 <param name="options" value="$options" />  <param name="options" value="$options" />
 </applet><br />  </applet><br />
 <font face="arial,helvetica,sans-serif" size="-1"><a href="http://www.molinspiration.com/jme/index.html">JME Editor</a> courtesy of Peter Ertl, Novartis</font>  <font face="arial,helvetica,sans-serif" size="-1"><a href="http://www.molinspiration.com/jme/index.html">JME Editor</a> courtesy of Peter Ertl, Novartis</font>
 <form>  
 <input type="button" name="submit" value="Insert Answer" onclick = "submitSmiles();" />  
 <br />  <br />
 <input type="button" value="  Close  " onclick = "window.close()" />  $insert_answer
   <br />
   <input type="button" value="  Close  " onclick = "javascript:window.close()" />
 &nbsp;&nbsp;  &nbsp;&nbsp;
 <input type="button" value="  Help  " onclick = "openHelpWindow()" />  <input type="button" value="  Help  " onclick = "javascript:openHelpWindow()" />
 </form>  </form>
 </center>  </center>
 </body>  </body>
Line 127  CHEMPAGE Line 156  CHEMPAGE
     my $display=&mt('Draw Molecule');      my $display=&mt('Draw Molecule');
     if (defined($shown_text)) { $display=&mt($shown_text); }      if (defined($shown_text)) { $display=&mt($shown_text); }
     my $result=<<CHEMINPUT;      my $result=<<CHEMINPUT;
 <input type="button" value="$display" 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()" />  <input type="button" value="$display" onclick="javascript:editor=window.open($nothing,'jmeedit','width=500,height=500,menubar=no,scrollbars=no,resizable=yes');editor.$docopen;editor.document.write('$body');editor.document.close();editor.focus()" />
 CHEMINPUT  CHEMINPUT
     return $result;      return $result;
 }  }
Line 222  sub start_organicresponse { Line 251  sub start_organicresponse {
      'options','width');       'options','width');
  if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }   if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
     }      }
   
     return $result;      return $result;
 }  }
   
Line 265  sub end_organicresponse { Line 295  sub end_organicresponse {
  }   }
  $result.=&Apache::response::answer_footer('organicresponse');   $result.=&Apache::response::answer_footer('organicresponse');
     }      }
     &Apache::response::end_response;  
       if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || 
    $target eq 'tex' || $target eq 'analyze') {
    &Apache::lonxml::increment_counter(&Apache::response::repetition());
       }
       &Apache::response::end_response();
     return $result;      return $result;
 }  }
   
Line 286  sub start_organicstructure { Line 321  sub start_organicstructure {
     '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,undef,1);   my $texwidth=&Apache::lonxml::get_param('texwidth',$parstack,$safeeval,undef,1);
    my $webwidth=&Apache::lonxml::get_param('width', $parstack, $safeeval);
    my $webheight=&Apache::lonxml::get_param('height', $parstack, $safeeval);
    if (!$webheight) { $webheight = $webwidth; }
  if (!$texwidth) { $texwidth='90'; }   if (!$texwidth) { $texwidth='90'; }
    $result = "%DYNAMICIMAGE:$webwidth:$webheight:$texwidth\n";
  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);
  my $filename = $env{'user.name'}.'_'.$env{'user.domain'}.   my $filename = $env{'user.name'}.'_'.$env{'user.domain'}.
Line 449  sub end_reactionresponse { Line 488  sub end_reactionresponse {
  }   }
  $result.=&Apache::response::answer_footer('reactionresponse');   $result.=&Apache::response::answer_footer('reactionresponse');
     }      }
     &Apache::response::end_response;  
       if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || 
    $target eq 'tex' || $target eq 'analyze') {
    &Apache::lonxml::increment_counter(&Apache::response::repetition());
       }
       &Apache::response::end_response();
     return $result;      return $result;
 }  }
   

Removed from v.1.56  
changed lines
  Added in v.1.63


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>