 5.8 Maple-graded Questions - Maple T.A. 2016 Help Instructor
Select your version: Maple T.A. 2017 | Maple T.A. 2016 | Maple T.A. 10

### Description

The Maple-graded question type uses the Maple computer algebra system to generate algorithmic variables in questions, plots, and evaluate student responses. The Maple-graded question type gives you access to the computational power of Maple. It includes facilities for algebra, calculus, differential equations, discrete mathematics, graphics, numerical computation, and many other areas of mathematics.

Question Designer

### Maple-graded Question Type - Overview

The Maple-graded question type uses the Maple computer algebra system to generate algorithmic variables in questions, generate plots and evaluate student responses. The Maple-graded question type gives you access to the computational power and plotting capabilities of Maple. It includes facilities for algebra, calculus, differential equations, discrete mathematics, graphics, numerical computation, and many other areas of mathematics. Using the Maple-graded question type you have access to many different kinds of mathematical objects, not just simple expressions. You can use Maple to create questions whose responses require sets, differential equations, unevaluated integrals, groups and many other types of mathematical data. Moreover, you can use functions and routines that are contained in a separate Maple Repository (Maple Library). You can access your personal Maple library archives from within your Maple questions.

Since the Maple engine is used when grading student's responses, Maple T.A. will give credit for any response that is mathematically equivalent to the correct answer. You can also assign partial grades, allowing you to find common errors and reward partial credit.

#### Maple-graded Formula & Maple Syntax Subtypes

The Maple-graded question type has two subtypes:

• Maple Syntax

Both the Maple-graded Formula and Maple Syntax subtypes allow you to use Maple functions and expressions, for example, trigonometric functions, log10, ln, abs, sqrt, diff, int, and LinearAlgebra[Determinant]. In addition to the full range of Maple functions, you can use programming constructs to evaluate responses.

##### Difference Between Maple Formula and Formula Question Types

Formula questions are very useful when the correct response is a straightforward mathematical expression using standard common functions, and when the correct answer is easy to describe and easy to evaluate.

The Maple-graded Formula subtype differs from the Formula question type.

• When writing a Maple-graded Formula question, you can use Maple functions and expressions in the evaluation of the student response.
• When writing a Formula question type, you cannot use Maple code in the evaluation of the student response.

Viewing your source code reveals that for Maple-graded questions (both Maple Formula and Maple Syntax subtypes) mode=Maple@, while for Formula question types mode=formula@.

 Note: There is no difference for the student in syntax or range of expressions.
##### Difference Between Maple-graded Formula and Maple Syntax with Text Entry Mode in Student Response

These two subtypes are distinguished by a student's response.

• A student should not use Maple commands and expressions in a response to a question generated using Maple-graded Formula. For details, see Maple-graded Formula. The student responds using other Maple T.A. formula question syntax.
• A student is required to use Maple commands and expressions in a response to a question generated using Maple Syntax with the Text entry response option. For details, see Maple Syntax.

##### Difference Between Maple-graded Formula and Maple Syntax with Text Entry Mode in Syntax Checking

These two subtypes are distinguished by syntax checking of the student response.

• The system verifies the syntax of a student response for a Maple-graded Formula question using a basic syntax checker. For details, see Maple-graded Formula.
• The system does not verify the syntax of a student response for a Maple Syntax question. As the author, you can verify whether the student is using a Maple command to calculate the answer. For details, see Maple Syntax.
##### Difference Between Text Entry and Symbolic Entry for Student Response in Maple Syntax Questions

With a Maple Syntax question, you can choose whether the students enter responses using Text mode or Symbol mode. In both cases, the response is sent to Maple, where you can apply sophisticated grading methods to evaluate the student response.

• A student can enter math expressions, including Matrices, in a natural way using Symbol mode. For example, a student can enter a Matrix using a palette.
• A student is required to use Maple commands and expressions in a response to a question generated using Maple Syntax with the Text entry response option.

For details, see Maple Syntax.

#### Guidelines for Using Maple Code for Maple-graded Questions

• A Maple-graded question must use valid Maple code to evaluate the answer. Complete each line of code with a semicolon.
• The last line of your question code must evaluate to a Boolean value (true or false) or a floating-point number between 0.0 and 1.1 for partial grading. In many cases, it is recommended that you use the Maple evalb command.
• Use the long form name for all package functions, for example, VectorCalculus[ArcLength].

#### Providing Feedback to Students

• To display the correct answer as feedback for a student response, you must enter the correct answer in the Enter Maple code that evaluates to the correct answer field.
• For open-ended questions, such as "Give an example of an increasing function on the interval [0, 10]", it is recommended that you include a comment for a graded response. Otherwise, no comment is displayed as feedback to the student if the response is incorrect. Feedback is entered in the Question Designer screen. For more details, see Adding and Editing Feedback.

The Algorithm Designer

Using a Maple Repository

Mathematical Formula Question Types Comparison Table

Using Maple Code to Prevent Cheating in Maple Syntax Questions

Plotting a Student Response

Displaying a Maple Plot

Mathematical Functions & Operations

Tutorial: Maple-based Algorithmic Question Authoring

#### Guidelines

• The student should not use Maple commands in the response. For an explanation, see Syntax and Student Responses below.
• The instructor must write code such that the student does not have to use a trailing semicolon in the response.

For example, evalb(\$RESPONSE=factor(x^2-1)); as a single line of code allows the student to respond with (x+1)(x-1) omitting the trailing semicolon. This is especially important, as questions created using the Maple-graded Formula question subtype are not obvious Maple questions from the student's perspective. A non-Maple student user can answer a Maple-graded Formula question type without knowing Maple syntax.

#### Syntax

Maple T.A. verifies the student response using a basic syntax checker.

• If the answer is entered in Text mode, the formula syntax checker assesses the response, changes expressions to Maple syntax, for example, 2x becomes 2*x, and reports errors if the expression is not a formula. It then generates a Maple statement.
• If the answer is created using the Equation Editor ( ), a MathML expression is parsed, the syntax checker is run to ensure the answer is of type formula, and then a Maple statement is generated.

##### Student Responses

You do not need to explicitly check that the student response is a formula. For example, you do not need to check whether factor(expr)is a command that calculates the expression for the student. However, a student response like factor(x^2-1) would be interpreted as implicit multiplication and converted to f*a*c*t*o*r*(x^2-1). As such, the student response will be marked as wrong.

You may need to write Maple code for responses that are interpreted as formulas by Maple T.A., but are Maple commands. For example, if you ask for the value of sin(Pi/4), you must use code to ensure that the student does not simply enter sin(Pi/4), which the Maple T.A. syntax checker accepts and passes to Maple. The correct response is, for example, sqrt(2)/2, which is also a Maple T.A. formula and a Maple command.

#### Variables

The variable e should not be assigned as a global variable in Maple code. It can be used, however, as a local variable.

### Maple Syntax

#### Introduction

Maple Syntax is a subtype of the Maple-graded question type.

In this subtype, the student is required to: UsingtheCommentFieldinaMapleQuestion

• Respond using Maple commands and expressions
• Enter syntactically correct Maple expressions

In a Maple Syntax question, you must specify whether the response area is a text-entry area or a symbolic-entry area.

#### Maple Syntax with Text Entry Response Option

```qu.x.y.mode=Maple@
type=maple@
allow2d=0```

##### Guidelines
###### Student Use of Unevaluated Forms of Maple Commands

Some Maple commands take unevaluated forms. For example, Diff is the inert form of diff. In Maple T.A., students are directed to answer questions using the unevaluated forms of Maple commands. Your code should accept these forms.

###### Semicolon Usage

The instructor should specify to the student (in the question text) whether a trailing semicolon is required, or alternatively, write code such that the presence or absence of a trailing semicolon has no bearing on the evaluation of the response.

For example, evalb(\$RESPONSE=factor(x^2-1); as one line of question code does not allow a student response with a semicolon, such as (x-1)*(x+1); The response is marked as incorrect.

If the question code contains two lines, completed with semicolons, such as:

```A:= \$RESPONSE;
evalb(A=factor(x^2-1);```

the student can answer with or without a semicolon and the response is marked as correct.

##### Syntax

Maple T.A. does not check the syntax of the student response.

• If the answer is entered in Text mode, it is sent directly to Maple for parsing. The student is expected to enter syntactically correct Maple expressions. Shortcuts such as 2x are marked incorrect.

As the author, you can verify whether the student is using a Maple command to calculate the answer. For more information, see Using Maple Code to Prevent Cheating in Maple Syntax Questions.

#### Maple Syntax with Symbolic Entry Response Option

```qu.x.y.mode=Maple@
type=maple@
allow2d=2```

##### Syntax

Maple T.A. parses the student response entered in Symbol mode to convert the entered expression into Maple syntax, which is sent to Maple.

Note that, 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. This technique is only recommended for Maple Syntax questions with the Text entry response option.

#### Variables

The variable e should not be assigned as a global variable in Maple code. It can be used, however, as a local variable.

The Maple-graded question type allows for questions with complicated answers, questions with different possible answers, and questions requiring a powerful answer-equivalence checker. You can also modify them to allow for grading between 0.0 and 1.0 for partial credit.

Note: Grading must be done using a floating-point number. Rational numbers are not accepted. Table 5.4 shows a simple application of the partial credit feature.

Table 5.4: Maple-graded Question with Partial Credit

 Text for the question Solve for x in the following equation: 3x+6=12 Maple code that evaluates to the correct answer solve(3*x+6=12,x); Maple code to grade the student response if (\$RESPONSE=6) then 0.5 else evalb(\$RESPONSE-\$ANSWER=0) end if;

### Instructions

1. From the Class Homepage, click Content Repository in the top menu.
1. From the Create New drop-down menu, select Question/Text.
1. The Question Designer screen appears:
• Enter a title for the question under the Question Name panel.
• Enter the question in the Question Text. To include complicated mathematical expressions, click the Equation Editor icon ( ) in the toolbar.
1. Click Response Area ( ).
1. Under Choose Question Type, select Maple-graded.
1. On the Edit Response Area screen,
1. Weighting: specify the weight of this response area in the overall question. The default Weighting is set to 1.
1. In the Answer field, you must enter the correct response to the question. Keep in mind the following details:
• The last line of code must evaluate to an expression that is stored to the variable \$ANSWER.
• Complete each line of code with a semicolon.
• Add parentheses when appropriate, for example, (x + y) / 2.
• Use the long form name for all package functions, for example, VectorCalculus[ArcLength].
• A Maple-graded question must use valid Maple code to evaluate the answer. For example, if the question is find the indefinite integral of sin(x), then the Answer field must contain the Maple code int(sin(x),x);
1. In the Grading Code region,
• A Maple-graded question must use valid Maple code to evaluate the answer.
• The last line of your question code must evaluate to a Boolean value (true or false) or a floating-point number between 0.0 and 1.0 for partial grading. By default, use the Maple command evalb((\$ANSWER)-(\$RESPONSE)=0); as indicated, where \$RESPONSE represents the student response and \$ANSWER represents the correct answer.
• If you choose to alter the default grading syntax, complete each line of code with a semicolon.
• Use the long form name for all package functions, for example, VectorCalculus[ArcLength].
• Use \$RESPONSE to represent the student response in your code. Before your code is processed by Maple, \$RESPONSE is replaced by the student response.
• Use \$ANSWER to represent the correct answer, as you have provided in the previous field.
1. From the drop-down menu, select an Expression Type: Formula or Maple Syntax. To learn about the differences between Formula and Maple Syntax expression types, see Maple-graded Question Type - Overview.
1. If you selected Maple syntax, from the Text/Symbolic entry field, select Text entry only if you want students to type their response in a text region, or Symbolic entry only if you want students to use the Equation Editor to enter their response. For more information on this option and the advantages of each entry mode, see Maple-graded Question Type - Overview.
1. (Optional) Upload a Maple Repository. For further instructions, see Using a Maple Repository.
1. (Optional) Enter Plotting Code to enable plotting of the student response. Use \$RESPONSE to represent the student response in your code. Before your code is processed by Maple, \$RESPONSE is replaced by the student response. The last line must be a Maple plot command. For example, for a student response in the variable x, you might use the following Maple plotting code: plot(\$RESPONSE, x=0..10);
1. (Optional) Enter Custom Previewing Code to change how a student's response is displayed when they choose to preview it. Before your code is processed by Maple, \$RESPONSE is replaced by the student response.

Note: You can copy content from a Maple worksheet or a Maple code text file to be used in a Maple-graded question, see Copying Content from Maple.

1. (Optional) To edit Hints and question details, see Adding and Editing Hints and Editing Question Details for more details.
1. Click Save to save the question.

For specific examples using the Maple-graded question type, see the examples provided: Maple-graded Example 1A:Formula.

### Copying Content from the Maple Worksheet to Maple T.A.

1. From a Maple worksheet, select the code to be copied.
1. From the Maple menu, select Copy.
1. In Maple T.A., right-click (Control-click on Mac®) and paste the contents into the appropriate box.
1. Rename the response value to \$RESPONSE.
1. Add \$ to all algorithmic variables.

1. From the Class Homepage, click the Content Repository.
1. From the Create New drop-down menu, select Question/Text.
1. On the Edit Response Area screen,
• Enter the following for Question Name: Differentiation - Product Rule
• Enter the following for Question Text: Differentiate with respect to 1. Click Response Area ( ).
1. Under Choose Question Type, select Maple-graded.
1. Weighting: specify the weight of this response area in the overall question. (By default, the Weighting is set to 1).
1. Enter the following for the Answer: diff(sin(x)*x,x);

Important: Do not change the default Grading Code: \$RESPONSE is a system variable that corresponds to the response the student entered, and \$ANSWER refers to the correct answer entered in step 5.

1. Ensure that the Expression Type is Formula.
1. Select Student can choose for Text/Symbolic entry.
1. Click OK to save and end the question authoring process, or Preview to view the question, as shown in Figure 5.24. Figure 5.24: Maple-graded Example 1A: Formula

### Example 1B: Maple-graded, Formula and Plotting

Note: This question is a modification of Maple-graded Example 1A:Formula

1. On the Question Designer screen, double-click the Maple response area.
1. We are going to plot the student's response, as well as the correct derivative. If the student is correct, the plot region will display a plot with a single curve.
1. Enter the following for Plotting Code: plot([\$RESPONSE, diff(sin(x)*x,x)],x=-10..10);
1. Click OK.
1. Click Save to save the question.
1. Then, click Preview to view the question.
1. Enter sin(x) in the student response area.
1. Click the Plot icon ( ) next to the student response area, to see: Figure 5.25. Figure 5.25: Maple-graded Example 1B: Formula and Plotting

### Example 2: Maple-graded, Maple Syntax Option

1. From the Class Homepage, click Content Repository in the top menu.
1. From the Create New drop-down menu, select Question/Text.
1. On the Edit Response Area screen,
• Enter the following for Question Name: Intersection
• Enter the following for Question Text: What is the intersection of the sets Enclose your response in braces, ({}).
1. Click Response Area ( ).
1. Under Choose Question Type, select Maple-graded.
1. Weighting: specify the weight of this response area in the overall question. (By default, the Weighting is set to 1).
1. In the Answer field, enter {b,c}.
1. Enter the following for Grading Code: evalb(\$RESPONSE={a,b,c} intersect {b,c,d,e});
1. Ensure that the Expression Type is Maple syntax.
1. Under Text/Symbolic entry, choose Text entry only.
1. Click OK.
1. Click Save to save the question, or Preview to view it, as shown in Figure 5.26. Figure 5.26: Maple-graded Example 2: Maple Syntax Option

### Example 3: Designing a Maple-graded Question to Accept Mathematically Equivalent Responses

This example will create a question that asks for  . It should accept , , or anything equivalent as correct.

1. From the Class Homepage, click Content Repository in the top menu.
1. From the Create New drop-down menu, select Question/Text.
1. On the Edit Response Area screen,
• Enter the following for Question Name: Derivative of Secant.
• Enter the following for Question Text: Compute the derivative of 1. Click Response Area ( ).
1. Under Choose Question Type, select Maple-graded
1. Weighting: specify the weight of this response area in the overall question. (By default, the Weighting is set to 1).
1. Enter the following for the Answer: diff(sec(x),x);

Important: The default grading code, evalb((\$ANSWER)-(\$RESPONSE)=0;, would only give credit for and reject all other responses. This is because the evalb command does not perform simplification. It is strongly recommended that you test your Maple code in a Maple worksheet for any Maple-graded questions.

1. Ensure that the Expression Type is Formula.
1. Under Text/Symbolic entry, choose Student can choose.
1. Click OK.
1. Click Save to save the question, or Preview to view it, as shown in Figure 5.27. Figure 5.27: Maple-graded Example 3: Designing a Maple-graded Question to Accept Mathematically Equivalent Responses

### Example 4: Maple-graded, Determinant of a Matrix

This example will create a question that generates a random matrix and asks students to find the determinant.

1. From the Class Homepage, click Content Repository in the top menu.
1. From the Create New drop-down menu, select Question/Text.
1. On the Edit Response Area screen,
• Enter the following for Question Name: Determinant.
• Enter the following for Question Text: Calculate the determinant of \$m.
1. At the bottom of the page, click the add icon ( ) and enter the following Algorithm:

\$n=int(rand(2,4));

\$matrix=maple("randomize(): LinearAlgebra[RandomMatrix](\$n,\$n,generator=rand(-9..10))");

\$m=maple("printf(MathML[ExportPresentation](\$matrix))");

Note: For more details on adding an Algorithm, see Adding and Editing Algorithms.

1. Click Refresh algorithm preview to preview the variables you defined, as shown in Figure 5.28. Figure 5.28: Maple-graded Example 4 Algorithm

1. Click Response Area ( ).
1. Under Choose Question Type, select Maple-graded.
1. Weighting: specify the weight of this response area in the overall question. (By default, the Weighting is set to 1).
1. Enter the following for the Answer: LinearAlgebra[Determinant](\$matrix);
1. Ensure that the Expression Type is Formula.
1. Under Text/Symbolic entry, choose Student can choose.
1. Click OK.
1. Click Save to save the question, or Preview to view it, as shown in Figure 5.29. Figure 5.29: Maple-graded Example 4: Determinant of a Matrix

### Example 5: Maple-graded, Coefficient Matrix

This example will create a question that asks for the coefficient matrix of a linear system of equations. Students will use the Equation Editor to construct their response.

1. From the Class Homepage, click Content Repository in the top menu.
1. From the Create New drop-down menu, select Question/Text.
1. On the Edit Response Area screen,
• Enter the following for Question Name: Coefficient matrix.
• Enter the following for Question Text:

Give the coefficient matrix of the following system:  To enter the system of equations, click the Equation Editor ( ) icon in the toolbar, and enter the expressions.

1. At the bottom of the page, click the add icon ( ) and enter the following Algorithm:

\$ans=maple("Matrix([[1,2,-3],[7,-1,2]])");

Note: For more details on adding an Algorithm, see Adding and Editing Algorithms.

1. Click Refresh algorithm preview to preview the variables you defined, as shown in Figure 5.30. Figure 5.30: Maple-graded Example 5 Algorithm

1. Click Response Area ( ).
1. Under Choose Question Type, select Maple-graded.
1. Weighting: specify the weight of this response area in the overall question. (By default, the Weighting is set to 1).
1. Enter the following for the Answer: printf(MathML[ExportPresentation](\$ans));

Note: This generates MathML for the matrix, presenting it in a nice format for students. For the purpose of grading the student response, however, you must use the variable, not the MathML expression.

1. Enter the following for Grading Code: LinearAlgebra[Equal](\$RESPONSE,\$ans);

Important: The default Grading Code, evalb((\$ans)-(\$RESPONSE)=0);, is not sufficient when working with matrices. To check for matrix equality, use the command: LinearAlgebra[Equal].

1. Ensure that the Expression Type is Maple syntax.
1. Under Text/Symbolic entry, choose Symbolic entry only.
1. Click OK.
1. Click Save to save the question, or Preview to view it, as shown in Figure 5.31. Figure 5.31: Maple-graded Example 5: Coefficient Matrix

### Example 6: Maple-graded, Matrix Question with Infinitely Many Correct Responses

This example describes how to create a question that asks for an invertible matrix. The grading of the student response checks whether the determinant of the student's matrix is non-zero.

1. From the Class Homepage, click Content Repository in the top menu.
1. From the Create New drop-down menu, select Question/Text.
1. On the Edit Response Area screen,
• Enter the following for Question Name: Invertible Matrix.
• Enter the following for Question Text: Give an invertible matrix.
1. Click Response Area ( ).
1. Under Choose Question Type, select Maple-graded.
1. Weighting: specify the weight of this response area in the overall question. (By default, the Weighting is set to 1).
1. Enter the following for the Answer:

M:=Matrix([[1,2],[3,4]]):

printf(MathML[ExportPresentation](M));

1. Enter the following for Grading Code:

x:=LinearAlgebra[Determinant](\$RESPONSE):

evalb(type(x,numeric) and x<>0);

1. Ensure that the Expression Type is Matrix Syntax.
1. Under Text/Symbolic entry, choose Symbolic entry only.
1. Click OK.
1. Click Save to save the question, or Preview to view it, as shown in Figure 5.32. Figure 5.32: Maple-graded Example 6: Matrix Question with Infinitely Many Correct Responses

Mathematical Functions & Operations

Editing with the Equation Editor

Plotting a Student Response

### Example 7: Maple-graded, Using the InertForm Package to Avoid Simplification

1. From the Class Homepage, click Content Repository in the top menu.
1. From the Create New drop-down menu, select Question/Text.
1. On the Edit Response Area screen,
• Enter the following for Question Name: Fraction Addition (without simplification)
• Enter the following for Question Text: What is 3/8 + 1/8? (Do not simplify)
1. Click Response Area ( ).
1. Under Choose Question Type, select Maple-graded.
1. Weighting: specify the weight of this response area in the overall question. (By default, the Weighting is set to 1).
1. In the Answer field, enter 4/8.
1. Enter the following for Grading Code: evalb(`%/`(4,8) = InertForm:-Parse("\$RESPONSE"));
1. From the Expression Type drop-down menu, select Formula.
1. Under Text/Symbolic entry, select Student can choose.
1. Click OK.
1. Then, click Save to save the question, or Preview to view it, as shown in Figure 5.33 below. Figure 5.33: Maple-graded Example 7: Using the InertForm Package to Avoid Simplification

### Next Steps

To edit further details in the Content Repository, see Editing Question Details