An exercise where the student has to move geometrical objects in a JSXGraph drawing panel.
Syntax
The JSXGraph script is defined in a key jxgscript. The properties of the geometrical objects that are relevant for the evaluation of the exercise are stored in variables form_XXX.
jxgscript ==
var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-10, 10, 10, -10], axis:true});
var p = brd.create('point',[0,0]);
var form_x=p.X();
var form_y=p.Y();
==
The usual text and form keys. The JSXGraph drawing panel is inserted in the form with an element <div class="jxgbox"></div>.
text ==
Déplacer le point aux coordonnées (1,3).
==
form ==
<div id="jxgbox" class="jxgbox" style="width:300px; height:300px;"></div>
==
The usual evaluator key where the value of form_XXX is retrieved in the usual answer dictionary.
evaluator ==
x=answer['x']
y=answer['y']
from math import sqrt
if sqrt((x-1)**2+(y-3)**2)<0.1:
grade=(100,"Bonne réponse")
else:
grade=(0,"Mauvaise réponse")
==
An exercise where the student has to move geometrical objects in a JSXGraph drawing panel.
Syntax
The JSXGraph script is defined in a key
jxgscript
. The properties of the geometrical objects that are relevant for the evaluation of the exercise are stored in variablesform_XXX
.The usual
text
andform
keys. The JSXGraph drawing panel is inserted in theform
with an element<div class="jxgbox"></div>
.The usual
evaluator
key where the value of form_XXX is retrieved in the usual answer dictionary.