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

Online Help

All Products    Maple    MapleSim


Grading

  

SolveFeedback

  

generate feedback for a step-by-step solution

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

SolveFeedback(solution,options)

Parameters

solution

-

solution steps {canvas-string,table,rtable,list}

options

-

(optional) equation(s) of the form option = value where option is one of variables, equations, or solutions

Options

• 

variables = list, the variable to solve for

• 

equations = list, the initial expression

• 

solutions = list, the solutions that are relevant

• 

group = integer or set of integers, restrict the elements to inspect to the specified group(s)

• 

correcteq = truefalse, indicate whether to display "correct equation" message

• 

filter = set(equation), input element filters passed to GetMath

• 

output = default, list or canvaslist, specify an output format

• 

cursorgroup = truefalse, when true consider only elements in the group containing the cursor (Maple Learn only)

Description

• 

The SolveFeedback command is the procedure behind the SolvePractice command.  It analyzes a step-by-step solution to the given problem and provides feedback for each step of the solution.  It can also be called directly, or used behind the scenes for other interactive applications of your own design.

• 

The solution argument, when part of an interactive canvas-based application, is a XML-based string representing a canvas, or a table representing the embedded component name mapping.  In this case, the returned result is a DocumentTools:-Canvas:-Script.

  

When called directly, solution can also be a list or array of expressions.  In this case, the returned result is a list of feedback strings.  The result has one extra string than the number of input steps, concluding with a (possibly empty) summary statement.

• 

The variables = [x] option is useful to provide when the expression to solve for is multivariate.  This clarifies exactly which variable is to be solved for.  

• 

The solutions = [x=0] option allows you to specify which solutions are relevant to the given problem, in order to avoid feedback that prompts to solve for more solutions.

• 

The equations = [...] option allows you to specify the initial expression, as opposed to showing it as the first expression in a canvas.  This way it is up to the user to come up with the equation themselves.

• 

When the optional argument, group=1, or group={2,3} is specified in conjunction with a canvas-based solution input, only the specified elements in the given group or groups will be considered when generating feedback.

• 

The output option can be set to default, list, or canvaslist.  When solution is a canvas, the default action is to generate a Script, which will be applied to the active Canvas.  Otherwise, when solution is an Array or list, the default output is a list of strings.

  

Use output = list to force list-of-strings output even when solution is a canvas.

  

Use output = canvaslist to return a list of [string,record] pairs, when solution is a canvas. This returns a list of lists, where the [i,1] element is a feedback comment string, and the [i,2] element is the canvas record-object that identifies the expression for which the feedback applies.  The record-object can be inspected as per any object returned by GetMath, or it can be passed as an argument to some Script commands like Annotate.

• 

By default, SolveFeedback can give messages identifying "this is a correct equation" intended for cases when the input equation is hidden and the user must provide the equation.  In cases where the equation is visible, use the option correcteq=false to show simple "Ok" messages instead.

• 

The filter option applies to canvas-based input, and will cause the canvas elements to be pruned if they match the given specified properties.  For example, 'filter'={'readonly'=true} will prune out all math containers that have their readonly property set to true.

Examples

Feedback

• 

In this section we call the SolveFeedback command directly with a list of inputs, where the second item through to the end of the list represents steps towards solving the first expression in the list.  The result returned is a list of strings.

withGrading:

SolveFeedback2x+3=4x5,2x4x=53,2x=8,x=4

,Ok,Ok,Good job, this is the correct solution,Great! You found the correct solution

(1)

SolveFeedback2x+3=4x5,2x4x=5+3,2x=2,x=1

,Check this step,Ok,Ok,Please try again. This is not the correct solution

(2)

SolveFeedback2x+y=4y,2x=3y,y=23x,variables=y

,Ok,Good job, this is the correct solution,Great! You found the correct solution

(3)

Interactive Canvas-Based Interface

• 

In this example we create an interactive canvas presenting a word problem.  The input equation is not shown.  Note that the t=-2.5 root is not part of the solutions list, as it does not make physical sense.

withGrading:

withDocumentTools:-Canvas:

cvNewCanvasTextKiera throws a ball in the air from a 11-meter tall structure. The height of the ball in meters is described by the equation %1. Her brother, Paul, catches the rock just before it hits his head. Paul is 152 cm tall and is standing on the ground. How long was the rock in the air?,st=t2+2t+12.77,ScriptButtonCheck My Work,Grading[SolveFeedback](_canvas,equations=[-t^2 + 2*t + 12.77 = 1.52],variables=[t],solutions=[t=4.5]);,position=800,90,encode=false:

ShowCanvascv,input=-t^2 + 2*t + 12.77 = 1.52,-t^2+2*t+11.25 = 0,t=2±sqrt224111.2521,t=2.5,t=4.5,t2.5

• 

The feedback can be generated directly as follows:

GradingSolveFeedback-t^2 + 2*t + 12.77 = 1.52,-t^2+2*t+11.25 = 0,t=2±sqrt224111.2521,t=2.5,t=4.5,equations=t2+2t+12.77=1.52,variables=t,solutions=t=4.5

Ok (this is the correct equation)&comma;Ok&comma;Ok&comma;Ok&comma;Good job, this is a correct solution&comma;Almost there! Remove the steps that look like invalid solutions in this situation by stating t <> ...

(4)
• 

The canvas can also be shared via Maple Learn:

ShareCanvascv

Custom Feedback

• 

In this example we create a custom canvas, where the final summary feedback will be directed to a specific spot on the canvas.  Also, as a demonstration, specific output is looked for in order to display a custom message.

withDocumentTools:-Canvas&colon;

withGrading&colon;

Check := proc( canvas )
   local feedback := SolveFeedback(canvas,'output'='canvaslist'):
   local script := Script();
   for local C in feedback do
       local msg := C[1];
       local obj := C[2];
       if msg = "Ok" and value(obj:-math) = (factor(x^2-4)=0) then
           msg := "Perfect -- you factored the expression";
       end if;
       SetActive(script,`if`(obj=[],"Summary",obj));
       Annotate(script,msg);
   end do;
   ToString(script);
end proc:

cvNewCanvasSolve this equation:&comma;x24=0&comma;Mathx2x+2=0&comma;border=true&comma;Mathx=2&comma;border=true&comma;ScriptButtonCheck My Work&comma;Check&comma;position=500&comma;90&comma;MathFeedback:&comma;custom=Summary&comma;position=500&comma;90&colon;

ShowCanvascv

Restricting input to a section of a canvas

• 

In this example we split the answer areas for a system-of-equations solution into three groups.  Group and filter options are used to grab the input from a different specific column on the canvas for each section.

withDocumentTools:-Canvas&colon;

withGrading&colon;

CheckWork := proc(canvas,sys,grp)
    Grading:-SolveFeedback(canvas,'equations'=sys,'group'=grp,'correcteq'=false,'filter'={'readonly'=true});
end proc:

cvNewCanvasSolve System&comma;Solve the system of equations 1 and 2 by first solving for x in column 1, then use that value in column 2 to solve for y, and finally find the value of x in column 3.&comma;GroupEquation 1:&comma;solve for x&comma;Mathxy=2&comma;readonly&comma;seqMath&comma;border&comma;i=1..3&comma;position=30&comma;200&comma;ScriptButtonCheck My Work 1&comma;CheckWork&comma;parameters=xy=2&comma;1&comma;position=30&comma;460&comma;GroupEquation 2:&comma;insert value of x&comma;solve for y&comma;Mathx+y=2&comma;readonly&comma;seqMath&comma;border&comma;i=1..3&comma;position=300&comma;200&comma;ScriptButtonCheck My Work 2&comma;CheckWork&comma;parameters=y+2+y=2&comma;2&comma;position=300&comma;460&comma;GroupUse the results from 1 and 2&comma;to find the value of x&comma;Mathx=NULL&comma;readonly&comma;seqMath&comma;border&comma;i=1..3&comma;position=600&comma;200&comma;ScriptButtonCheck My Work 3&comma;CheckWork&comma;parameters=x=2&comma;3&comma;position=600&comma;460&colon;

ShowCanvascv

Compatibility

• 

The Grading:-SolveFeedback command was introduced in Maple 2021.

• 

For more information on Maple 2021 changes, see Updates in Maple 2021.

• 

The Grading:-SolveFeedback command was updated in Maple 2022.

• 

The group, correcteq, filter, output and cursorgroup options were introduced in Maple 2022.

• 

For more information on Maple 2022 changes, see Updates in Maple 2022.

See Also

DocumentTools:-Canvas:-NewCanvas

DocumentTools:-Canvas:-ShareCanvas

Grading

Grading:-SolvePractice