Subversion Repositories wimsdev

Rev

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

  1. <script type="text/javascript">
  2. //<![CDATA[
  3. <!-- no validator  -->
  4. !if $goback=1
  5.     !set r=!nospace $(reply$n)
  6.     !!! 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]
  7.     function refill(){var hi="$r";if(hi.length !=0){hi=hi.split(',');for(var i=0;i<hi.length;i++){document.getElementById("myinput"+i).value=hi[i];}}}
  8. !endif
  9.     <!-- do not use "' in description -->
  10.    var descr_list="$description";
  11.    var descr_cnt = 30;
  12.    var description = make_description(descr_list,descr_cnt);
  13.  
  14.    function dontknow(){
  15.         myConfirm('$dontknow','?','$wims_ref_name','$session','$module','$counter','$nok_send_color');
  16.    }
  17. //]]>
  18. </script>
  19.  
  20. <!-- standard the drag & drop library is included: images (static;fly;gnuplot [id=image$$n]) may be added by setting the "dhtml" variable -->
  21. <script type="text/javascript" src="$jsdir/wz_dragdrop.js"></script>
  22. <table id="exercise" class="exercise" ><!-- begin table id="exercise" -->
  23.    <tr>
  24.    <td class="exercise_t">
  25.    !if $(question$n) != $empty
  26.         $(question$n)
  27.    !endif
  28.    !if $(formula$n) != $empty
  29.         <table class="exercise">
  30.             <tr>
  31.             <td class="exercise_m">
  32.             !if $display=1234
  33.                 !insmath $$$$ $(formula$n) $$$$
  34.             !else
  35.                 !insmath $(formula$n)
  36.             !endif
  37.             </td>
  38.         !if $embed=1
  39.             <td class="exercise_m">
  40.             <!-- to read these inputfields use document.getElementById('myinput0') in tailormade javascript.js -->
  41.                 !if $wims_user=supervisor
  42.                     <textarea id="myinput0" class="schaersvoorde_textarea" cols="$cols" rows="$rows">$(answer$n)</textarea>
  43.                 !else
  44.                     <textarea id="myinput0" class="schaersvoorde_textarea" cols="$cols" rows="$rows">$(reply$n)</textarea>
  45.                 !endif
  46.             </td>
  47.         !endif
  48.             </tr>
  49.         </table>
  50.    !endif
  51.    !if $exotext != $empty
  52.         $exotext
  53.    !endif
  54.    </td>
  55.    !if $image=1
  56.        !if $make_tr=1
  57.             </tr>
  58.             <tr>
  59.        !endif
  60.         <td class="exercise_t">
  61.         !if $draw=1
  62.             !set ins_attr= id="myimage"
  63.             !set insdraw_size=$xsize,$ysize
  64.             !insdraw $(image$n)
  65.         !else
  66.             !if $plot=1
  67.                 !set ins_attr= id="myimage"
  68.                 !set insplot_set=$(image_settings$n)
  69.                 !insplot $(image$n)
  70.             !else
  71.                 !if $svg=1
  72.                     !exec svgdraw $(image$n)
  73.                 !else
  74.                     <span style="schaersvoorde_alarm">set variable draw/plot/svg ---&gt; 1</span>
  75.                 !endif
  76.             !endif
  77.         !endif
  78.         </td>
  79.    !else
  80.         !if $applet=1
  81.             !if $make_tr=1
  82.                 </tr>
  83.                 <tr>
  84.              !endif
  85.         <td class="exercise_t">
  86.             $(object$n)
  87.         </td>
  88.         !endif
  89.    !endif
  90.    !if $make_tr=1
  91.         </tr>
  92.         <tr>
  93.    !endif
  94.    <td class="exercise_c"><!-- begin module_dir/js/*.js -->
  95.         !read $javascript
  96.    </td><!-- end module_dir/js/*.js -->
  97.    </tr>
  98. </table><!-- end table id="exercise" -->
  99.  
  100. !if $inputs=yes
  101.    <div id="send_buttons" class="embedded_central">
  102.         <input type="button" id="schaersvoorde_ok_button" onclick="javascript:sendanswer();" value="$send" />
  103.         <input type="button" id="schaersvoorde_nok_button" onclick="javascript:dontknow();"  value="$dontknow" />
  104.    </div>
  105. !else
  106.    !if $inputs=no
  107.         <div id="send_buttons" class="embedded_central">
  108.             <input type="button" id="schaersvoorde_nok_button" onclick="javascript:dontknow();"  value="$dontknow" />
  109.         </div>
  110.    !endif
  111. !endif
  112. $dhtml
  113. !if $goback=1
  114.    !!! after the inputelements are in the DOM-tree: fill-in the previous answers
  115.    <script type="text/javascript">
  116.    //<![CDATA[
  117.         <!-- no validator  -->
  118.         try{document.onload=refill();}catch(e){}
  119.    //]]>
  120.    </script>
  121. !endif
  122. !exit
  123.