Subversion Repositories wimsdev

Rev

Rev 8260 | Blame | Compare with Previous | Last modification | View Log | RSS feed

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