Student[Basics]
PracticeSheet
generate an interactive practice sheet
Calling Sequence
Parameters
Description
Interactive
Examples
Compatibility
PracticeSheet(template,options)
template
-
{string,procedure} ; pattern to use to generate the practice sheet questions
compare
procedure; (optional) custom method for grading each result
comparebyindex
truefalse; (optional) passes index instead of expression to grading
equalsymbol
string ; (optional,default="=") text between question and answer box
height
posint ; (optional,default=40) height in pixels of the answer boxes
inert
truefalse; (optional,default=true) disables auto-simplification of responses passed to the compare procedure by keeping them in inert form
inline
truefalse; (optional,default=false) specifies whether to inject the sheet into the current document or into a new document
nrows
posint ; (optional,default=5) number of rows
ncols
posint ; (optional,default=2) number of columns
output
identical(none,table,Array) ; (optional,default=none) output from InsertContent
prefix
string ; (optional) text to the left of the answer blank
suffix
string ; (optional) text to the right of the answer blank
qprefix
string ; (optional) text to the left of the question expression
qsuffix
string ; (optional) text to the right of the question expression
solution
{name,procedure} ; (optional,default=simplify) method used to reduce the input expressions to the desired result
state
list(name) ; (optional,default=[anames(user)]) variables to initialize in the generated worksheet
title
string ; (optional,default="") title text to appear above the sheet
message
string ; (optional,default="") introductory paragraph message to appear above the sheet
width
posint ; (optional,default=130) width in pixels of the answer boxes
The PracticeSheet command generates a grid of math practice problems intended for basic drills that involve simplifying or evaluating one expression into another.
The template parameter is the only one required, and it specifies the form of the displayed expressions.
Most commonly, template is a parsable string expression involving operators, functions, and the keywords integer and variable. The integer and variable keywords are replaced by random values. For example, the template "integer+integer" creates a sheet of two term addition problems involving integers in the range -10..10, excluding 0, 1, and -1. Alternate integer ranges can supplied using the range option described in GenerateInteger.
Templates are input as strings in order to avoid Maple's automatic simplification of trivial expressions. The template accepts all options that the RandomTools:-Generate command can support.
The template can also be a procedure of the form (row,col)->expr. A template procedure accepts the row and column grid coordinates and returns an arbitrary expression.
A default algorithm is used to compare the displayed expression with the value in the response box when the "Check My Work" button is pressed. This algorithm attempts to ensure each expression pair is equivalent in value and structure. The InertForm:-SameStructure command is used by default to do the structural comparison.
In many cases the displayed expression needs to be manipulated in order to get it into "solution" form. The solution option provides a way to specify how the computer should arrive at the answer used to compare against the given response. By default, solution=simplify.
An alternate comparison procedure can be specified using the compare option to pass in a procedure that accepts two parameters, (response,question), where response is the expression in the answer box, and question is the expression adjacent to it.
The calling sequence to the custom compare procedure can be changed to (response,question_index) when comparebyindex is set to true. In this case the compare procedure will get a [row,column] pair instead of the expression in the question box.
When using a custom compare procedure, the option inert can be used to control whether the response fed to the procedure is in a special, unsimplified inert form, where it is easier to analyze the exact structure of the response expression as-entered.
The output option can be used to get the result from DocumentTools:-InsertContent when the sheet is inserted. This contains information about the names of the components used and may be useful for debugging advanced questions.
When inline = false, the practice sheet is generated as a new Maple document. If a custom template procedure or custom comparison function was used, the new sheet will need to have all dependencies injected into the new worksheet in order to work properly. For example, if custom_compare calls myfunc, then, because the new worksheet does not share the same kernel as the generating document, myfunc needs to be defined in the created document. Maple attempts to do this automatically by taking all variables currently defined and injecting them as startup code. It is possible that not all of these variables are needed, so Maple gives a warning when this happens. Use the state option to specify the names of the variables that you do want to be defined in the new document. Use state=[] to declare that you do not want any variables transcribed to the new document.
The equalsymbol option allows you to specify custom text between the expression and answer box. By default the symbol inserted is an equal sign.
For an interactive interface to construct practice sheets, see assistants/PracticeSheets.
The examples below show various ways to use the PracticeSheet command. Execute any of these examples to see and interact with the generated worksheets.
with⁡Student:-Basics:
Simple example -- two term addition problems with negative and positive integers.
Student:-Basics:-PracticeSheet⁡integer+integer,inline
=
Even simpler -- two term addition problems without negatives
Student:-Basics:-PracticeSheet⁡integer(range=1..10)+integer(range=1..10),inline
Add a title and instructions, and customize the number of rows and columns. These problems will use the variable x.
Student:-Basics:-PracticeSheet⁡integer*variable(x)+integer*variable(x),nrows=3,ncols=2,title=Addition with Variables,message=Sum the following quantities.,inline
Addition with Variables
Sum the following quantities.
Each problem in this set may use a different variable, not just x.
Student:-Basics:-PracticeSheet⁡integer*(integer*variable+integer),title=Distributive Multiplication,message=Expand each expression using the distributive property,inline
Distributive Multiplication
Expand each expression using the distributive property
Expressions in this example use the variables x and y.
Student:-Basics:-PracticeSheet⁡integer*variable(xy)+integer*variable(xy),title=Addition with Variables,message=Sum the following quantities.,inline
Note that the default check-my-work algorithm requires fully reduced fractions.
Student:-Basics:-PracticeSheet⁡integer/integer(range=2..5)+integer/integer(range=2..5),title=Addition of Fractions,message=Add and reduce each expression,inline
Addition of Fractions
Add and reduce each expression
In this example, the solution option is given the Maple command, expand, which is applied to the input in order to generate the expected solution.
Student:-Basics:-PracticeSheet⁡(variable(x)+integer)*(variable(x)+integer),title=Distributive Multiplication,message=Expand each expression using the distributive property,solution=expand,width=120,height=35,state=,inline
Reverse of the above, we need to use a procedure in order to generate expressions that are easily factorable.
Student:-Basics:-PracticeSheet⁡i,j↦expand⁡RandomTools:−Generate⁡variable⁡x+integer⁡range=−10..10,exclude=0⋅variable⁡x+integer⁡range=−10..10,title=Factor,message=Factor each expression,solution=factor,width=120,height=35,state=,inline
Factor
Factor each expression
Drill and practice for a differentiation method.
Student:-Basics:-PracticeSheet⁡%diff(variable(x)^integer(range=2..20),variable(x)),title=Differentiation - Power Rule,message=Differentiate each expression using the power rule.,solution=eval,inline
Differentiation - Power Rule
Differentiate each expression using the power rule.
Drill and practice for integration methods. Note the caveat in the message text (see the next example for a workaround).
Student:-Basics:-PracticeSheet⁡%int(variable(x)^integer(range=2..20),variable(x)),title=Integration - Power Rule,message=Integrate each expression using the power rule. \n\nDo not include a constant of integration in your solution.,inline
Integration - Power Rule
Integrate each expression using the power rule. Do not include a constant of integration in your solution.
This example provides a custom grading procedure that allows a student to put in a constant of integration or not.
Student:-Basics:-PracticeSheet("%int(variable(x)^integer(range=2..20),variable(x))", title="Integration - Power Rule", message="Integrate each expression using the power rule.", compare = proc(resp,q) local c := indets(value(resp)) minus {x}; if nops(c) = 1 then c := c[1]; else c := 0; fi; InertForm:-SameStructure(resp-c,value(q)); end proc, state=[] ,'inline');
Integrate each expression using the power rule.
This example uses custom text in front of the answer box, where the default = doesn't make sense.
Student:-Basics:-PracticeSheet⁡integer*variable(x)+integer = 0,title=Solve Linear Equations,message=Solve for x.,solution=solve,equalsymbol=; x =,inline
Solve Linear Equations
Solve for x.
; x =
This example uses a custom comparison procedure and the comparebyindex option along with state arrays that hold the question objects.
MyPerms1≔Array⁡1..5,1..1,↦Perm⁡combinat:−randperm⁡8
MyPerms1≔
MyPerms2≔Array⁡1..5,1..1,↦Perm⁡combinat:−randperm⁡8
MyPerms2≔
Student:-Basics:-PracticeSheet( (row,col)->MyPerms1[row,col] %. MyPerms2[row,col], ncols=1, comparebyindex=true, compare = proc(resp,idx) evalb(eval(MyPerms1[op(idx)] . MyPerms2[op(idx)]) = Perm(resp)); end proc, state=['MyPerms1','MyPerms2'], message="Use square brackets to input your result, for example [[1,2],[3,4]] instead of (1,2)(3,4)", width=200, inline );
Use square brackets to input your result, for example [[1,2],[3,4]] instead of (1,2)(3,4)
The Student[Basics][PracticeSheet] command was introduced in Maple 2018.
For more information on Maple 2018 changes, see Updates in Maple 2018.
The Student[Basics][PracticeSheet] command was updated in Maple 2024.
The prefix, suffix, qprefix and qsuffix parameters were introduced in Maple 2024.
For more information on Maple 2024 changes, see Updates in Maple 2024.
See Also
assistants/PracticeSheets
DocumentTools[Tabulate]
Grading[Quiz]
InertForm[SameStructure]
RandomTools[Generate]
Download Help Document