/*
jm.evers 9/2010
Applet for simple adding, subtracting,dividing and multiplying by pupils.
The result can be checked by WIMS.
************************************************************************************
* *
* This is all amateur scriblings... So no copyrights. *
* This source code file, and compiled classes derived from it, *
* can be used and distributed without restriction, including for commercial use... *
* No warrenty whatsoever. *
* *
************************************************************************************
*/
<script type="text/javascript">
function ReadThis(){
var wims_reply = document.getElementById('InvulGrid').ReadApplet("0");
alert("this can send to wims for correction:\n"+wims_reply);
var js_alert_show= document.getElementById('InvulGrid').ReadApplet("1");
alert("this can be the confirmbox for the pupil:\n"+js_alert_show);
var html_show= document.getElementById('InvulGrid').ReadApplet("2");
document.getElementById('html_reply').innerHTML="this is a html-table representation
"+html_show;
var latex_show= document.getElementById('InvulGrid').ReadApplet("3");
alert("this is an latex array of the answer:\n Usable via !insmath\n"+latex_show);
}
</script>
<applet id="InvulGrid" name="InvulGrid" code="InvulGrid.class" width="400" height="400">
<param name="fontsize" value="50"><!-- optional: actual fontsize will be determined according xlines/ylines -- xsize/ysize -->
<param name="pencolor" value="0,0,255,125"><!-- optional: typing color -->
<param name="bgcolor" value="245,240,240"><!-- optional: canvas bgolor;default white ; R,G,B,alpha -->
<param name="markcolor" value="10,255,10,100"><!-- optional: active field color -->
<param name="linecolor" value="255,10,100"><!-- optional: user drawn lines in applet -->
<param name="linewidth" value="6"><!-- linewidth of user drawn lines -->
<param name="xlines" value="10"><!-- default 10 ; number of vertical lines : determines fontsize -->
<param name="ylines" value="10"><!-- default 10 ; number of horizontal lines -->
<param name="showgrid" value="true"><!-- show xlines and ylines as grid in gridcolor -->
<param name="gridcolor" value="0,0,255,100"><!-- color of grid -->
<param name="language" value="nl"><!-- default en ; nl , fr -->
<param name="reverse" value="yes"><!-- default false ; force editing from right to left -->
<!-- optional: is an itemlist, spaces matter .Optional horizontal lines: ---|x|-|+|: -->
<!-- bug in java plugin's stringtokenizer: first token blancspace is stripped off... -->
<!-- in applet viewer this works fine -->
<!-- to produce an space before the first number, add a "," like-->
<param name="exercise" value=", 1234, 5678, 456, ---|+">
<!-- use first row of grid for user scribbling:.will not be send to wims -->
<param name="scribling_pencolor" value="255,10,0,200"><!-- optional -->
<param name="exercisecolor" value="0,255,100,120">
<!-- left upper corner UNDER SCRIBLING LINE of grid is 0:0 -->
<!-- right under corner of grid is xlines:ylines -->
<param name="segment1" value="2,1,6,1"><!-- draw a segment x1,y1--x2,y2 -->
<param name="color1" value="255,0,0,250"><!-- color for segment 1 -->
<param name="segment2" value="2,1,2,6"><!-- draw a segment x1,y1--x2,y2 -->
<param name="color2" value="0,255,0,100"><!-- color for segment 2 -->
<param name="segment3" value="2,6,6,6"><!-- draw a segment x1,y1--x2,y2 -->
<param name="color3" value="0,120,155,100"><!-- color for segment 3 -->
<param name="segment4" value="6,6,6,1"><!-- draw a segment x1,y1--x2,y2 -->
<param name="color4" value="130,120,155,100"><!-- color for segment 4 -->
<!-- if param buttons is empty or not set : only a 'clear all; button will be shown -->
<param name="buttons" value="+,x"><!-- user draws lines with +,-,x,÷ symbols ; do not use too many! -->
</applet
<br>
<input type="button" name="InvulGrid" value="Read " onclick="javascript:ReadThis();">