Consider the following plain-text script question definition, which asks a student to enter an anti-derivative of **x^3**.

**qu.1.1.question=Enter an anti-derivative of x^3.@
qu.1.1.maple=evalb(diff($RESPONSE,x)=x^3)@
qu.1.1.type=formula@
qu.1.1.mode=Maple@
qu.1.1.allow2d=1@
qu.1.1.name=Maple AntiDerivative@
qu.1.1.comment=Any function of the form x^4/4 + C, where C is a constant, is an anti-derivative of x^3.@
qu.1.1.editing=useHTML@**

**Notes:**

- This question uses Maple to verify that the derivative of the student response is equal to
**x^3**. This is recommended in place of comparing the student response, which can have an additive constant, with the integral of **x^3**, that is evalb($RESPONSE=int(x^3,x)).

- If the student enters an incorrect response, the system display the value in the
**comment** field. In Maple-graded questions, if there is no **comment** field, the system returns the message **Comment: No feedback is provided with this question**.

To change this question to an algorithmic question, use the following plain-text script question definition.

**qu.1.2.question=Enter an anti-derivative of x^$exponent + ${coeff}x.@
qu.1.2.maple=evalb(diff($RESPONSE,x)=x^$exponent+$coeff*x)@
qu.1.2.type=formula@
qu.1.2.mode=Maple@
qu.1.1.allow2d=1@
qu.1.2.name=Maple AntiDerivative@
qu.1.2.comment=Any function of the form $answer + C, where C is a constant, is an anti-derivative of x^$exponent + ${coeff}x.@
qu.1.2.editing=useHTML@
qu.1.2.algorithm=$exponent=maple("randomize():rand(2..5)()");
$coeff=maple("randomize():rand(2..9)()");
$answer=maple("int(x^$exponent+$coeff*x,x)");
@**

**Notes:**

- You must follow the variable naming conventions.

- The variable
**$exponent** is assigned a value calculated by Maple using the **rand** function.**
rand()** returns a random **12**-digit positive integer**
rand(a)()** returns a random integer in the range **0 ... a-1** (inclusive)**
rand(a..b)()** returns a random integer in the range **a ... b** (inclusive)
For information on other Maple commands, see your Maple documentation.

- The Maple command:
**
randomize():**
is included so that a different value is generated for each question instantiation. You must include the **randomize():** command in every Maple-based variable definition. That is, it is required in the definition of **$exponent** and **$coeff**.

- The Maple command:
**
int(x^$exponent,x)**
calculates the correct answer, which is displayed using the **comment** statement if the student response is incorrect.

- The examples in
**Tutorial 1** can be converted to **Maple Syntax** questions by changing the type field value from **formula** to **maple**, and changing allow2d to 0 for text-entry mode. For **Maple Syntax** questions, it is recommended that you attempt to prevent a student from calculating the correct answer using Maple commands. For more information, see *Using Maple Code to Prevent Cheating in Maple Syntax Questions*.

For an example plain-text script that defines a Maple question with Maple plotting of the student response, see *Plotting a Student Response*.