Subversion Repositories wimsdev

Rev

Rev 718 | Rev 2648 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. <script type="text/javascript">
  2.     !!! this is used for filling_in the inputfields myinput[n] after a return: the inputfields are present in a variable-string and thus can "not be filled" by wims... note: if $embed=1 ... WIMS will fill in the rejected answer...see below [id=myinput]
  3.     function refill(){var hi="$(reply$n)";if(hi.length !=0){hi=hi.split(',');for(var i=0;i<hi.length;i++){document.getElementById("myinput"+i).value=hi[i];}}}
  4. </script>
  5. <script type="text/javascript" src="$jsdir/wz_dragdrop.js"></script>
  6. <p align="center">
  7. <table>
  8.     <tr>
  9.     <td>
  10.     <table bgcolor=$bgcolor1 cellpadding=$cellpadding cellspacing=$cellspacing>
  11.         <tr>
  12.         <td valign="top" align="left">
  13.             !if $(question$n) != $empty
  14.                 $(question$n)
  15.             !endif
  16.             !if $(formula$n) != $empty
  17.                 <center>
  18.                     <table>
  19.                         <tr>
  20.                         <th>
  21.                             !insmath $(formula$n)
  22.                         </th>
  23.                     !if $embed=1
  24.                         <th>
  25.                             &nbsp;&nbsp; $m_rightarrow &nbsp;&nbsp;
  26.                         </th>
  27.                         <th>
  28.                             <form name="myform1">
  29.                                 !if $wims_user=supervisor
  30.                                     <textarea id="myinput" style=$textareastyle wrap=off cols=$cols rows=$rows name="reply$n">$(answer$n)</textarea>
  31.                                 !else
  32.                                     <textarea id="myinput" style=$textareastyle wrap=off cols=$cols rows=$rows name="reply$n">$(reply$n)</textarea>
  33.                                 !endif  
  34.                             </form>
  35.                         </th>
  36.                     !endif
  37.                         </tr>
  38.                     </table>
  39.                 </center>
  40.             !endif
  41.             !if $exotext != $empty
  42.                 $exotext
  43.             !endif
  44.         </td>
  45.         !if $image=1
  46.             !if $XSIZE>450
  47.                 </tr><tr>
  48.             !endif
  49.             <td valign="top" align="center">
  50.                 !if $draw=1
  51.                     !! for fly
  52.                     !set ins_attr=name="image$n" id="image$n"
  53.                     !set insdraw_size=$XSIZE,$YSIZE
  54.                     !insdraw $(image$n)
  55.                 !else
  56.                     !if $plot=1
  57.                         !! for GNUplot
  58.                         !set ins_attr=name="image$n" id="image$n"
  59.                         !set insplot_set=$(image_settings$n)
  60.                         !insplot $(image$n)
  61.                     !endif
  62.                 !endif
  63.             </td>
  64.         !endif
  65.         !if $applet=1
  66.             !if $XSIZE>450
  67.                 </tr><tr>
  68.             !endif
  69.             <td valign="top" align="center">
  70.                 $(object$n)
  71.             </td>
  72.         !endif
  73.         !if $javascript != $empty
  74.             !if $XSIZE>450
  75.                 </tr><tr>
  76.             !endif
  77.             <td>
  78.             !! this file handles the input
  79.                 !read $javascript
  80.             </td>
  81.         !endif
  82.         </tr>
  83.     </table>
  84.     </td>
  85.     </tr>
  86.     !! sometimes a better place for the buttons....$javascript does not need to define them in this case.
  87.     !if $inputs=yes
  88.         <td align="center">
  89.             <table>
  90.                 <tr>
  91.                 <th>
  92.                     <input type=button style="$mybuttonstyle" onclick="sendanswer();" value="$send">
  93.                 </th>
  94.                 <th>
  95.                     <input type=button style="$mybuttonstyle" onclick="dontknow();" name="but2" value="$dontknow">
  96.                 </th>
  97.                 </tr>
  98.             </table>
  99.         </td>
  100.         </tr>  
  101.     !endif
  102. </table>
  103. </p>
  104. $dhtml
  105. !!! after the inputelements are in the DOM-tree: fill-in the previous answers
  106. <script type="text/javascript">
  107.     try{document.onload=refill();}catch(e){}
  108. </script>
  109.