Subversion Repositories wimsdev

Rev

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

  1. !set n=$counter
  2. <link rel="stylesheet" type="text/css" href="$htmldir/schaersvoorde.css" />
  3. <script  src="$jsdir/../lang/remarks.$taal.js"></script>
  4. <script  src="$jsdir/precheck.js"></script>
  5. <script>
  6. //<![CDATA[
  7.     function exitMathView(){
  8.         document.getElementById("MathView").destroy();window.close();
  9.     }
  10.  
  11.     var URL;
  12.     var applet=0;
  13.     function sendanswer(){
  14.         var v;var input;var reply=new Array ;var total=new Array;
  15.         var ml;var t1;var t2;
  16.         if(document.getElementById("MathView")){
  17.             applet=1;
  18.             input=document.getElementById("MathView").getLinear();
  19.             input=input+'';
  20.             if(input.indexOf('error')!=-1){setAlarm(input);return;}  
  21.             input=nthroot(input);if(input=="error"){return;}
  22.             if(input.indexOf(',')!=-1){setAlarm(r4);return;}
  23.             v=input.length;if(v==0){setAlarm(r1 + "$counter");return;}if(v>100){setAlarm(r2); return;}if(v==0){setAlarm(r1);return;}
  24.             if(check_f(input)==0){return;}
  25.             if(check_o(input)==0){return;}
  26.             input=science(input);if(input=="error"){return;}
  27.             input=arrows(input,2,"","");if(input=="error"){return;}
  28.             if(check_x(input)==0){return;}
  29.             if(check_log_NaN(input)==0){return;}if(check_sqrt_NaN(input)==0){return;}
  30.             reply[0]=input;
  31.             t1=input.indexOf("[");
  32.             if(t1 !=- 1){
  33.                 if(input.indexOf("sqrt[")!=-1){input=specialroot(input);if(input=="error"){return;}}
  34.                 if(input.indexOf("log[")!=-1){input=speciallog(input);if(input=="error"){return;}}
  35.                 t1=input.indexOf("[");
  36.                 if(t1!=-1){setAlarm(r13);return;}
  37.             }
  38.             input=input.replace(/#/g,' ');
  39.             total[0]=input;
  40.             t=confirm(r0+"\n"+reply);
  41.             if(t==true){
  42.                 total=encodeURIComponent(total);
  43.                 URL = '$wims_ref_name?session=$myvar4&+module=$module&+cmd=reply&+reply$n='+total ;
  44.                 opener.location.href = URL;
  45.                 document.getElementById("MathView").destroy();
  46.                 window.close();
  47.             }
  48.         }
  49.     }
  50. //]]>
  51. </script>
  52. <table class="exercise">
  53.     <tr>
  54.     <td class="exercise_c">
  55.         <table class="exercise">
  56.             <tr>
  57.             <td class="exercise_c">
  58.                 <input type="button" id="schaersvoorde_nok_button" value="EXIT" onclick="javascript:exitMathView();" />
  59.             </td>
  60. !!          !if $inputs=1
  61.                 <td class="exercise_c">
  62.                 <input type="button" id="schaersvoorde_ok_button" value="$send" onclick="javascript:sendanswer();" />
  63.                 </td>
  64. !!          !endif
  65.             </tr>
  66.         </table>
  67.     </td>
  68.     </tr><tr>
  69.     <td class="exercise_c">
  70.         <table class="exercise">
  71.             <tr>
  72.             <td class="exercise_c">
  73.              <div id="alarmtext" name="alarmtext"  style="position:absolute;top:0px;left:0px;z-index:100;display:none;background-color:orange;font-size:16px;border:2px solid red"></div>
  74.             </td>
  75.             </tr>
  76.             <tr>
  77.             <td class="exercise_m">
  78.                 <object classid="java:MathView.class" id="MathView" width="580" height="260" type="application/x-java-applet;jpi-version=1.4" >
  79.                     <param name="java_codebase" value="$appletdir" />
  80.                     <param name="java_archive" value="MathView.jar" />
  81.                     <param name="java_code" value="MathView" />
  82.                     !! will default to background color of html-page/element
  83.                     <script>
  84.                         var thisbackground=document.bgColor;
  85.                         if(thisbackground){var obj="\<param name=bgcolor value="+thisbackground+"\>"}else{var obj="\<param name=bgcolor value=#ffffff\>"}
  86.                         document.write(obj.toString());
  87.                     </script>  
  88.                     <param name="largefont" value="$largefont" />
  89.                 !if $wims_user=supervisor
  90.                     <param name="oldreply" value="
  91.                     !nospace $(answer$n)
  92.                     ">
  93.                 !else
  94.                     <param name="oldreply" value="
  95.                     !nospace $(reply$n)
  96.                     ">
  97.                 !endif
  98.                     <param name="mayscript" value="true" />
  99.                     <param name="smallfont" value="$smallfont" />
  100.                     <param name="helptext" value="$applettext" />
  101.                     !! helptext : can display "exercise" math in the applet applettext=!nospace 1 / ( 1 + x ) =
  102.                     <param name="wimsvars" value="$varlist" />
  103.                     !! declare varlist=x,y,z,s or varlist=x y z s
  104.                     <param name="special_fraction" value="$special_fraction" />
  105.                 !if $mathviewpanel=$empty
  106.                     <param name="my_panel" value="$module_title:and:or:sqrt():+:-:*:/" />
  107.                 !else
  108.                     <param name="my_panel" value="$mathviewpanel" />
  109.                 !endif
  110.                 !! syntax $mathviewpanel:
  111.                 !! value=" title : specialbutton1 : specialbutton2 : specialbutton3 : specialbutton4"
  112.                 !! no unicode allowed
  113.                 !! the applet can identify: and,or,inf,sqrt,isin,notin,-> (arrow)
  114.                 !! maximum number of functions=6?
  115.                     $nojava
  116.                 </object>
  117.             </td>
  118.             </tr>
  119.         </table>
  120.     </td>
  121.     </tr>
  122. </table>
  123. !exit
  124.  
  125.