Author a formula (Maple-graded) sub-type
The Maple-graded formula question sub-type is one of the two sub-types of the Maple-graded question.
This sub-type is authored by inserting a Maple-graded component for the student response.
With the formula (Maple-graded) sub-type:
Students can't enter Maple commands as their answer for this question sub-type.
Students can choose whether they want to use text entry mode or symbolic entry mode for entering their response.
Whether the student submits a response to a formula (Maple-graded) sub-type question using text or symbolic entry, Möbius parses their algebraic expressions into proper Maple syntax so that the Maple engine can apply your Maple grading code.
A formula (Maple-graded) sub-type question can't recognize function notation unless the function is listed on Function and operator syntax (Example — sin(x+1) is the sine trigonometric function but f(x+1) is converted to f*(x+1)).
Example: Algorithm
This example includes an algorithmic matrix with the default grading code.
Question statement:
Calculate the determinant of $m.
Algorithm:
$n=int(rand(2,4)); $matrix=maple("randomize(): LinearAlgebra[RandomMatrix]($n,$n,generator=rand(-9..10))"); $m=maple("printf(MathML[ExportPresentation]($matrix))");
Answer field syntax:
LinearAlgebra[Determinant]($matrix);
Grading code syntax:
evalb(($ANSWER)-($RESPONSE)=0);
Expression type:
Formula
Text/Symbolic entry:
Student can choose
Example: Plotting code and infinite number of correct responses
This example accepts an infinite number of correct answers using the Maple grading code so that you don't need to define an explicit list of correct answers.
The Maple grading code uses the verify command, and plotting code is defined for students to visualize their response on a plot.
Question statement:
Give an example of a function f(x) that is increasing on the interval [0,1].
Click Plot to verify that your function increases.
f(x) =
Answer field syntax:
No answer field value required.
Grading code syntax:
assume(x >=0, x <= 1); verify(diff($RESPONSE, x), 0, {'greater_equal'});
Expression type:
Formula
Text/Symbolic entry:
Student can choose
Plotting code syntax:
plot($RESPONSE, x=0..1);
Example: Approximation of exact symbolic answers
This example randomly generates the radius $r of the circle and grades a student's response as correct if it's within 5% of the correct answer.
The Maple grading code will accept either the exact symbolic expression 2πr or any numeric response that is within 5% of 2πr evaluated to four significant digits.
Question statement:
Find the circumference of the circle with radius $r correct to four significant digits.
Algorithm:
$r=range(2, 5);
Answer field syntax:
exact:= 2*Pi*($r): evalf( exact, 4 );
Grading code syntax:
evalb( abs( evalf( $RESPONSE - $ANSWER ) / $ANSWER ) < .05 );
Expression type:
Formula
Text/Symbolic entry:
Student can choose
Example: Custom previewing code
This example uses custom previewing code to ensure that when the student previews their response, it's maintained in its unsimplified form.
Question statement:
What is 3/8 + 1/8? (Do not simplify your answer)
Answer field syntax:
printf(InertForm:-ToMathML(`%/`(4,8)));
Grading code syntax:
evalb(`%/`(4,8) = InertForm:-Parse("$RESPONSE"));
Expression type:
Formula
Text/Symbolic entry:
Student can choose
Custom Previewing Code:
printf(InertForm:-ToMathML(InertForm:-Parse("$RESPONSE")));
