Author a Maple syntax sub-type

The Maple-graded Maple syntax 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 response area.

With the Maple syntax sub-type:

  • Students must enter Maple commands in their response when the question is configured with text entry mode.
  • Student responses are parsed into proper Maple syntax when the question is configured with symbolic entry mode.
  • You, as the question author, get to decide whether the student's response requires text entry mode or symbolic entry mode.

The Maple syntax sub-type accepts equations, differential operators, integral signs, summations, vectors, matrices, differential equations, and a wide range of other advanced mathematical expressions.

IMPORTANT: This sub-type allows the student to enter Maple commands as their response to a question (Examplediff(sec(x),x);), so be cautious when authoring your correct answer.

TIP: Check out Choose a Maple-graded question sub-type for a comparison of the two Maple-graded question sub-types.

TIP: Check out Author a Maple-graded question for full question authoring instructions.

TIP: Existing knowledge of the Maple language will help you to author Maple-graded questions. Check out Maple syntax from the Maple online help site.

TIP: Check out View example Maple grading code for help with authoring custom grading code for your Maple-graded questions.

Maple syntax sub-type with text entry mode

When authoring a Maple syntax question sub-type, you can select to require the student to use text as their response entry.

Student responses must use proper Maple syntax since it's passed directly to the Maple engine without any parsing.

Here are some notes when the Text entry only mode is selected:

  • Student responses must use an asterisk (*) symbol to denote multiplication in all cases (Example — Maple syntax reads x*(x+1) as multiplication but x(x+1) as function notation).
  • Your grading code should detect if a student is using a Maple command to calculate the answer (check out Prevent cheating via entry of Maple code).
  • Your grading code should accept the unevaluated form of Maple commands (ExampleDiff is the inert form of diff).
  • If your grading code is one line of code (Exampleevalb($RESPONSE=factor(x^2-1);), a student response with a semicolon will be graded as incorrect (Example(x-1)*(x+1);).
  • You can instead write your grading code as two lines that are completed with semicolons (ExampleA:= $RESPONSE; evalb(A=factor(x^2-1);) so that a student response with a semicolon will be graded as correct.
  • Alternatively, specify in the question text whether a trailing semicolon is required.

Maple syntax sub-type with symbolic entry mode

When authoring a Maple syntax question sub-type, you can select to require the student to use symbols as their response entry.

Student symbolic responses are parsed into proper Maple syntax.

Here are some notes when the Symbolic entry only mode is selected:

  • Möbius parses the student response to convert the entered expression into Maple syntax, which is sent through the Maple engine.
  • Since a translation of the symbolic entry into a Maple Input expression takes place, the technique of using $RESPONSE to check whether students entered a specific command may not be appropriate.

Supported Maple syntax notation

Specific notation is supported while authoring a Maple syntax question sub-type:

  • Subscript
  • Greek letters

Subscripts

Subscripts are available when authoring a Maple-graded Maple syntax question sub-type.

Use square brackets (x[n]) (Exampler[0]) to denote subscript in the Answer and Grading Code fields during authoring.

NOTE: Students can use the underscore ( _ ) shortcut in both Text and Symbolic entry modes, or the built-in palette option in the Equation Editor.

NOTE: Subscripts are also available when authoring a chemistry question as a mathematical formula question. Check out Author a chemical equation sub-type.

Greek letters

Both upper-case Greek letters and lower-case Greek letters are available when authoring a Maple-graded Maple syntax question sub-type that uses the symbolic entry mode.

Use case-sensitive entry to denote the appropriate Greek letter in the Answer and Grading Code fields during authoring:

  • Example — Enter alpha for the Greek letter a.
  • Example — Enter Alpha for the Greek letter A.

TIP: Try entering the following code in the Algorithm pane of your question:

Copy this code
$a=maple("Phi[B]/cos(theta)");

Then edit the response area by replacing $ANSWER in the Grading Code field with $a.

Then enter the following code in the Answer field:

Copy this code
MathML:-ExportPresentation($a)

The student can then view a properly-formatted correct answer with case-sensitive Greek letters.

TIP: Check out Greek letters in Maple from the Maple online help for more information on each available Greek letter recognized by Maple.

NOTE: The Pi constant when entered as Pi is associated with its mathematical meaning of the constant ratio of a circle's circumference to its diameter. However, to use the Greek letter of Pi in Maple-graded questions:

  • Enter pi for π
  • Enter PI for P

Check out Greek letters in Maple from the Maple online help for additional tips on entering Greek letters.

Example: Basic

This example requires the student response to use Maple syntax and allows for a sophisticated grading code.

  • Question statement:

What is the intersection of the sets {a, b, c} and {b, c, d, e} ?

Enclose your response in braces, { }.

  • Answer field syntax:

  • Grading code syntax:
Copy this code
evalb($RESPONSE={a,b,c} intersect {b,c,d,e});

  • Expression type:
  • Maple Syntax

  • Text/Symbolic entry:
  • Text entry only

Example: Infinite number of correct answers

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.

  • Question statement:

Give an invertible matrix.

  • Answer field syntax:

No answer field value required.

NOTE: This example shows that a value isn't always required in this field, especially since there are an infinite number of correct answers.

  • Grading code syntax:
Copy this code
x:=LinearAlgebra[Determinant]($RESPONSE);
evalb(type(x,numeric) and x<>0);

  • Expression type:
  • Maple Syntax

  • Text/Symbolic entry:
  • Symbolic entry only

Example: Algorithm

This example uses an algorithm to generate multiple forms of the same question.

A complex Maple grading code allows this complicated question to be successfully graded.

  • Question statement:

Find the equation of the plane that passes through <1,0,0>, <0,1,0> and <$a,$b,$c>.

Write your answer in the form Ax+By+Cz+D=0 (using lower case x, y, and z).

  • Algorithm:
Copy this code
$a=range(1,5);
$b=range(1,5); 
$c=range(1,5);

  • Answer field syntax:
Copy this code
n := LinearAlgebra:-CrossProduct(<$a,$b,$c>-<1,0,0>, <0,1,0>-<1,0,0>);n[1]*(x-1)+n[2]*y+n[3]*z=0;

  • Grading code syntax:
Copy this code
evalb( lhs($RESPONSE)=lhs($ANSWER) or lhs($RESPONSE)=-1*(lhs($ANSWER)) );

  • Expression type:
  • Maple Syntax

IMPORTANT: If the expression type is set to Formula, Möbius won't parse the equal sign in the equation that the student enters and will grade the response as incorrect.

  • Text/Symbolic entry:
  • Symbolic entry only

Example: Formatted correct answer

This example uses the printf(MathML[ExportPresentation](a)); command so that the correct answer is properly formatted using MathML when displayed to the student.

  • Question statement:

Give the coefficient matrix of the following system:

  • Algorithm:
Copy this code
$ans=maple("Matrix([[1,2,-3],[7,-1,2]])");

  • Answer field syntax:
Copy this code
printf(MathML[ExportPresentation]($ans));

NOTE: The correct answer is displayed in proper symbolic math using MathML when displayed to the student.

  • Grading code syntax:
Copy this code
LinearAlgebra[Equal]($RESPONSE,$ans);

NOTE: The $ans variable that you've defined in the algorithm must be used for grading the student. The $ANSWER variable that contains the MathML expression from the Answer field isn't used for grading the student.

  • Expression type:
  • Maple Syntax

  • Text/Symbolic entry:
  • Symbolic entry only