[LON-CAPA-cvs] cvs: loncom /publisher publisher.html

sakharuk lon-capa-cvs@mail.lon-capa.org
Wed, 07 Apr 2004 18:02:47 -0000


sakharuk		Wed Apr  7 14:02:47 2004 EDT

  Modified files:              
    /loncom/publisher	publisher.html 
  Log:
  CHanges to print problem from the construction space as an exam one. It works but may be looks not so good. Trying to simplify.
  
  
Index: loncom/publisher/publisher.html
diff -u loncom/publisher/publisher.html:1.36 loncom/publisher/publisher.html:1.37
--- loncom/publisher/publisher.html:1.36	Tue Mar  2 11:55:01 2004
+++ loncom/publisher/publisher.html	Wed Apr  7 14:02:47 2004
@@ -81,9 +81,27 @@
   return 0;
 }
 
+function getproblemtype() {
+  if (parent.LONCAPAToBePublished.document.lonhomework) {
+     var optionelement;
+     var valueIndex=0;
+     for (var optionIndex=0;
+          optionIndex < parent.LONCAPAToBePublished.document.lonhomework.problemtype.options.length;
+	  optionIndex++)
+     {
+         optionElement=parent.LONCAPAToBePublished.document.lonhomework.problemtype.options[optionIndex];
+	 if (optionElement.selected) {
+	    return optionElement.value;
+         }	  
+     } 	  
+  }
+  return 0;
+}
+
 function getpostdata() {
   document.printout.postdata.value=frameloc();
   document.printout.curseed.value=getcurseed();
+  document.printout.problemtype.value=getproblemtype();
   document.printout.submit();
 }
 </script>
@@ -116,6 +134,7 @@
 		    <td rowspan="2" bgcolor="#ccddaa" align="center">
 		      <input type="hidden" name="postdata" value="" />
 		      <input type="hidden" name="curseed" value="" />
+		      <input type="hidden" name="problemtype" value="" />
 		      <input type="button" value="MT{Print}" onClick="getpostdata();" />
 		    </td>
 		  </form>