[LON-CAPA-cvs] cvs: loncom /html/res/adm/pages/reactionresponse reaction_editor.html
albertel
lon-capa-cvs@mail.lon-capa.org
Tue, 01 Jul 2003 21:06:37 -0000
albertel Tue Jul 1 17:06:37 2003 EDT
Modified files:
/loncom/html/res/adm/pages/reactionresponse reaction_editor.html
Log:
- now gets the correct field name and retores and old molecule
Index: loncom/html/res/adm/pages/reactionresponse/reaction_editor.html
diff -u loncom/html/res/adm/pages/reactionresponse/reaction_editor.html:1.2 loncom/html/res/adm/pages/reactionresponse/reaction_editor.html:1.3
--- loncom/html/res/adm/pages/reactionresponse/reaction_editor.html:1.2 Mon Jun 30 16:57:16 2003
+++ loncom/html/res/adm/pages/reactionresponse/reaction_editor.html Tue Jul 1 17:06:37 2003
@@ -1,7 +1,7 @@
<!-- Chemical reaction editor developed by Guy Ashkenazi, guy@fh.huji.ac.il-->
<!--
- $Id: reaction_editor.html,v 1.2 2003/06/30 20:57:16 albertel Exp $
+ $Id: reaction_editor.html,v 1.3 2003/07/01 21:06:37 albertel Exp $
Copyright Michigan State University Board of Trustees
@@ -30,11 +30,17 @@
<head>
<script type="text/javascript">
var rightarrow;
+var id;
+var molecule;
+var field
</script>
<!-- parsed by LON-CAPA to get the correct symbol for the arrow -->
<display>
return '<script type="text/javascript">
var rightarrow=\''.&xmlparse('<m>$\rightarrow$</m>').'\';
+ var molecule=\''.&EXT('query.molecule').'\';
+ var field=\''.&EXT('query.field').'\';
+ var id=\''.&EXT('query.id').'\';
</script>';
</display>
<script language="JavaScript">
@@ -207,7 +213,7 @@
alert("Nothing to submit");
}
else {
- name = "HWVAL_" + problem;
+ name = field;
i = 0;
while (parent.opener.document.lonhomework.elements[i].name != name)
i++;
@@ -217,6 +223,17 @@
}
}
+function setup() {
+ document.form.text.value=molecule;
+ if (id != '') {
+ document.form.submit.value='Insert reaction for Part ' + id;
+ parent.document.title='LON-CAPA Part '+id+' - Reaction Editor';
+ } else {
+ document.form.submit.value='Insert reaction';
+ parent.document.title='LON-CAPA - Reaction Editor';
+ }
+}
+
function getCookie(document,name) {
var dc = document.cookie;
var prefix = name + "=";
@@ -236,7 +253,7 @@
</script>
</head>
-<body bgcolor="#ffffff" onLoad = "problem = getCookie(parent.opener.document,'problem'); document.form.submit.value='Insert reaction for Part #' + problem; parent.document.title='LON-CAPA#'+problem+' - Reaction Editor';">
+<body bgcolor="#ffffff" onLoad = "javascript:setup();">
<center>
<hr />
<form name="form">