The following example script returns feedback to an algorithmic Maple question using a comment in a Maple Syntax question. The system calculates the displayed correct answer using a maple statement in the algorithm statement.
Note: By default, all Maple question subtypes do not return feedback if a student response is incorrect.
qu.1.topic=Maple Algorithmic Comment Field Example Script@
qu.1.1.question=$a+$b@
qu.1.1.maple=evalb($RESPONSE=$a+$b);@
qu.1.1.type=maple@
qu.1.1.mode=Maple@
qu.1.1.name=Using Random Variables@
qu.1.1.comment=The answer is $c.@
qu.1.1.editing=useHTML@
qu.1.1.algorithm=$a=maple("randomize():rand(0..10)()");
$b=rint(8);
$c=maple("$a+$b");@
For variable $a, the Maple randomize command generates a random number between 0 and 10.
For variable $b, the rint(8) function generates a random integer in the range 0, ..., 7.
$c holds the value of the sum
See Also:
Maple-graded questions in the Question Bank Editor
Maple-graded Question Type - Overview