Diff for /loncom/homework/chemresponse.pm between versions 1.4 and 1.5

version 1.4, 2003/05/05 20:43:46 version 1.5, 2003/05/05 21:14:10
Line 215  sub end_chemstructure { Line 215  sub end_chemstructure {
 }  }
   
 sub reaction_javascript {  sub reaction_javascript {
       my $rightarrow;
       if ($ENV{'browser.unicode'}) {
    $rightarrow=" → "
       } else {
    $rightarrow=" <font face=symbol>&reg;</font> ";
       }
     my $result=<<REACTIONJAVASCRIPT;      my $result=<<REACTIONJAVASCRIPT;
     <SCRIPT language="JavaScript">      <script language="JavaScript">
   
 var level;  var level;
 var reactants;  var reactants;
Line 312  function to_html(string) { Line 318  function to_html(string) {
     reaction += html_component(reactants[i]);      reaction += html_component(reactants[i]);
   
   if (products.length > 0) {    if (products.length > 0) {
     reaction += " <font face=symbol>&reg;</font> ";      reaction += " $rightarrow ";
     for (i = 0; i < products.length-1; i++) {      for (i = 0; i < products.length-1; i++) {
       reaction += html_component(products[i]);        reaction += html_component(products[i]);
       reaction += " + ";        reaction += " + ";
Line 394  function submitReaction() { Line 400  function submitReaction() {
     parent.opener.document.CAPA.submit();      parent.opener.document.CAPA.submit();
   }    }
 }  }
 </SCRIPT>  </script>
 REACTIONJAVASCRIPT  REACTIONJAVASCRIPT
     return $result;      return $result;
 }  }
Line 406  sub start_reactionresponse { Line 412  sub start_reactionresponse {
     if ($target eq 'web') {      if ($target eq 'web') {
  $result.=&reaction_javascript();   $result.=&reaction_javascript();
 # $result.='<iframe name="REACTION_'.$id.'" width="200" height="100" src="/adm/jme/reaction_viewer.html"></iframe>';  # $result.='<iframe name="REACTION_'.$id.'" width="200" height="100" src="/adm/jme/reaction_viewer.html"></iframe>';
  $result.='<input type="button" value="Check" onClick = "javascript:newWindow=open(\'\',\'new_W\',\'width=500,height=200,scrollbars=1\');newWindow.document.open(\'text/html\',\'replace\');newWindow.document.writeln(\'<center><br />\'+to_html(document.lonhomework.HWVAL_'.$id.'.value)+\'</center><input type="button" value="  Close  " onClick = "parent.window.close()" />\');newWindow.document.close()" />'   $result.='<input type="button" value="Check" onClick = "javascript:newWindow=open(\'\',\'new_W\',\'width=500,height=200,scrollbars=1\');newWindow.document.open(\'text/html\',\'replace\');newWindow.document.writeln(\'<center><br />\'+to_html(document.lonhomework.HWVAL_'.$id.'.value)+\'</center><input type=&quot;button&quot; value=&quot;  Close  &quot; onClick = &quot;parent.window.close()&quot; />\');newWindow.document.close()" />'
     } elsif ($target eq "edit") {      } elsif ($target eq "edit") {
     }      }
     return $result;      return $result;

Removed from v.1.4  
changed lines
  Added in v.1.5


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