Grading - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim

The Grading Package


The new Grading package in Maple 18 features new and improved tools for creating interactive quizzes and applications. With the Quiz command, you can generate interactive questions in Maple that ask a question and grade a student's response, making it easy to provide students with the opportunity to practice, explore and reinforce concepts.

The Grading package also features a robust toolkit of commands that can be used to build interactive applications. For example, say we have created an application that asks students to describe an expression, such as an arbitrary linear, quadratic, or absolute value function, by interactively graphing it. They can enter this graph in several ways, including by specifying particular points, such as the vertex of a parabola or the roots of an equation. The GradePlot command can then be used to grade the plot to a customizable margin of error by comparing the student's graph with the actual graph of the function.



Generating a Quiz

Grading a Plotted Function

Working with Constructed Functions

Creating Grading Applications

Generating a Quiz

The Quiz command generates a simple interactive tool that displays a question, accepts a response, and grades the response.


The simplest forms of a quiz take two arguments, a question and an answer:

QuizWhat is 1 + 1?, 2 

What is 1 + 1?

It is also possible to generate multiple choice or true false questions:

QuizWhat is 1 + 1?, 3, 0,1,2,3,4, 'style'='multiplechoice' 

What is 1 + 1?



You can generate algorithmic questions:

QuizIs the following number prime?, true,                 proc nextprimerand2..20 end,                 'style'=truefalse 

Is the following number prime?

You can also grade plotting questions:

QuizWhich of the following could be portions of the plot of sin(x)?, 1,2,       plotsinx,x=0..rand2..3,       plotsinx,x=rand2..3..5,       plot2 sinx,x=rand2..3..rand4..7,          style=multipleselect,         gradebyindex=true,         size=250,150

Which of the following could be portions of the plot of sin(x)?





The Quiz Example Worksheet provides additional examples.

Grading a Plotted Function

The GradePlot command allows you to construct representations of simple mathematical functions and then grade them.


In the following examples, an object representing a quadratic function can be created by the QuadraticFunction constructor in one of two ways:


An expression in a single variable can be provided.


Alternatively, two points, the first representing the vertex and the second another point on the function, can be given.


The solution as set by the instructor:

correctquadratic QuadraticFunctionx^24*x+4;

correctquadratic:=<< QuadraticFunction: x^2-4*x+4>>


A correct answer:

answer1 QuadraticFunction2&comma; 0&comma; 0&comma; 4&semi;

answer1:=<< QuadraticFunction: v^2-4*v+4>>


A correct answer, if small errors were considered acceptable. In the context of plotted functions, it is more likely that points with a certain amount of error would be provided:

answer2  QuadraticFunction2.0001&comma; 0.0023&comma; 0.0126&comma; 4.0108&semi;

answer2:=<< QuadraticFunction: 1.015934496*v^2-4.063941171*v+4.061844369>>


An incorrect answer.

answer3  QuadraticFunction3&comma; 0&comma; 0&comma; 4&semi;

answer3:=<< QuadraticFunction: 4/9*v^2-8/3*v+4>>



The GradePlot command compares the desired solution to the provided answer and returns a grade of 0 or 1. Since the grading is in the context of plotting, the plot ranges must be provided. Note that the second answer is considered incorrect if a tighter error tolerance is specified.

pview10..10&comma; 10..10&colon;

GradePlotcorrectquadratic&comma; answer1&comma; pview&semi;



GradePlotcorrectquadratic&comma; answer2&comma; pview&semi;



GradePlotcorrectquadratic&comma; answer2&comma; pview&comma; &apos;tolerance&apos;&equals;0.0001&semi;



GradePlotcorrectquadratic&comma; answer3&comma; pview&semi;




Working with Constructed Functions

There are several commands available for getting more details on the functions created using the Grading package's constructors. A few examples are shown below:

a1 AbsoluteValueFunction2&ast;absx3&plus;1&semi;

a1:=<< AbsoluteValueFunction: 2*abs(x-3)+1>>


a2  AbsoluteValueFunction2.5&comma; 0.8&comma; 2&comma; 2&semi;

a2:=<< AbsoluteValueFunction: 2.400000000*abs(v-2.5)+.8>>


To get the expression associated with the object, we can use the GetExpression command:

GetExpressiona1&comma; GetExpressiona2&semi;



Get the original data used to construct the object using the GetData command:


<< GridPoint: [2.5, .8]>>&comma;<< GridPoint: [2, 2]>>


Draw an object using the Draw command:

plots:-displayDrawa1&comma; 0..10&comma; 0 ..10&comma; &apos;color&apos;&equals;Blue&comma; Drawa2&comma; 0..10&comma; 0..10&comma; &apos;color&apos;&equals;Green&semi;

Creating Grading Applications

The Grading  package can be used effectively with embedded components to create grading applications. Normally, the components below would be placed in a single document and the code would be placed in the start-up code region, but it is shown here to illustrate a simple use of the Grading commands.

Execute the code in the following code-edit region before using the components below. The example below allows a user to click on two points to draw the given line.

A more complete version of this application is available here: DrawLine - MathApp.



Draw the graph of 2x5