PracticeSheet - Maple Help

Student[Basics]

 PracticeSheet
 generate an interactive practice sheet

 Calling Sequence PracticeSheet(template,options)

Parameters

 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

Description

 • 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.

Interactive

 • For an interactive interface to construct practice sheets, see assistants/PracticeSheets.

Examples

The examples below show various ways to use the PracticeSheet command.  Execute any of these examples to see and interact with the generated worksheets.

 > $\mathrm{with}\left(\mathrm{Student}:-\mathrm{Basics}\right):$

Simple example -- two term addition problems with negative and positive integers.

 > $\mathrm{Student}:-\mathrm{Basics}:-\mathrm{PracticeSheet}\left("integer+integer",'\mathrm{inline}'\right)$

 =

 =

 =

 =

 =

 =

 =

 =

 =

 =

Even simpler -- two term addition problems without negatives

 > $\mathrm{Student}:-\mathrm{Basics}:-\mathrm{PracticeSheet}\left("integer\left(range=1..10\right)+integer\left(range=1..10\right)",'\mathrm{inline}'\right)$

 =

 =

 =

 =

 =

 =

 =

 =

 =

 =

Add a title and instructions, and customize the number of rows and columns.  These problems will use the variable x.

 > $\mathrm{Student}:-\mathrm{Basics}:-\mathrm{PracticeSheet}\left("integer*variable\left(x\right)+integer*variable\left(x\right)",\mathrm{nrows}=3,\mathrm{ncols}=2,\mathrm{title}="Addition with Variables",\mathrm{message}="Sum the following quantities.",'\mathrm{inline}'\right)$

Sum the following quantities.

 =

 =

 =

 =

 =

 =

Each problem in this set may use a different variable, not just x.

 > $\mathrm{Student}:-\mathrm{Basics}:-\mathrm{PracticeSheet}\left("integer*\left(integer*variable+integer\right)",\mathrm{title}="Distributive Multiplication",\mathrm{message}="Expand each expression using the distributive property",'\mathrm{inline}'\right)$

Distributive Multiplication

Expand each expression using the distributive property

 =

 =

 =

 =

 =

 =

 =

 =

 =

 =

Expressions in this example use the variables x and y.

 > $\mathrm{Student}:-\mathrm{Basics}:-\mathrm{PracticeSheet}\left("integer*variable\left(xy\right)+integer*variable\left(xy\right)",\mathrm{title}="Addition with Variables",\mathrm{message}="Sum the following quantities.",'\mathrm{inline}'\right)$

Sum the following quantities.

 =

 =

 =

 =

 =

 =

 =

 =

 =

 =

Note that the default check-my-work algorithm requires fully reduced fractions.

 > $\mathrm{Student}:-\mathrm{Basics}:-\mathrm{PracticeSheet}\left("integer/integer\left(range=2..5\right)+integer/integer\left(range=2..5\right)",\mathrm{title}="Addition of Fractions",\mathrm{message}="Add and reduce each expression",'\mathrm{inline}'\right)$

 =

 =

 =

 =

 =

 =

 =

 =

 =

 =

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.

 > $\mathrm{Student}:-\mathrm{Basics}:-\mathrm{PracticeSheet}\left("\left(variable\left(x\right)+integer\right)*\left(variable\left(x\right)+integer\right)",\mathrm{title}="Distributive Multiplication",\mathrm{message}="Expand each expression using the distributive property",\mathrm{solution}=\mathrm{expand},\mathrm{width}=120,\mathrm{height}=35,\mathrm{state}=\left[\right],'\mathrm{inline}'\right)$

Distributive Multiplication

Expand each expression using the distributive property

 =

 =

 =

 =

 =

 =

 =

 =

 =

 =

Reverse of the above, we need to use a procedure in order to generate expressions that are easily factorable.

 > $\mathrm{Student}:-\mathrm{Basics}:-\mathrm{PracticeSheet}\left(\left(i,j\right)↦\mathrm{expand}\left(\mathrm{RandomTools}:-\mathrm{Generate}\left(\left(\mathrm{variable}\left(x\right)+\mathrm{integer}\left(\mathrm{range}=-10..10,\mathrm{exclude}=\left\{0\right\}\right)\right)\cdot \left(\mathrm{variable}\left(x\right)+\mathrm{integer}\left(\mathrm{range}=-10..10\right)\right)\right)\right),\mathrm{title}="Factor",\mathrm{message}="Factor each expression",\mathrm{solution}=\mathrm{factor},\mathrm{width}=120,\mathrm{height}=35,\mathrm{state}=\left[\right],'\mathrm{inline}'\right)$

Factor

Factor each expression

 =

 =

 =

 =

 =

 =

 =

 =

 =

 =

Drill and practice for a differentiation method.

 > $\mathrm{Student}:-\mathrm{Basics}:-\mathrm{PracticeSheet}\left("%diff\left(variable\left(x\right)^integer\left(range=2..20\right),variable\left(x\right)\right)",\mathrm{title}="Differentiation - Power Rule",\mathrm{message}="Differentiate each expression using the power rule.",'\mathrm{solution}'=\mathrm{eval},'\mathrm{inline}'\right)$

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).

 > $\mathrm{Student}:-\mathrm{Basics}:-\mathrm{PracticeSheet}\left("%int\left(variable\left(x\right)^integer\left(range=2..20\right),variable\left(x\right)\right)",\mathrm{title}="Integration - Power Rule",\mathrm{message}="Integrate each expression using the power rule. \n\nDo not include a constant of integration in your solution.",'\mathrm{inline}'\right)$

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');

Integration - Power Rule

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.

 > $\mathrm{Student}:-\mathrm{Basics}:-\mathrm{PracticeSheet}\left("integer*variable\left(x\right)+integer = 0",\mathrm{title}="Solve Linear Equations",\mathrm{message}="Solve for x.",\mathrm{solution}=\mathrm{solve},\mathrm{equalsymbol}="; x =",'\mathrm{inline}'\right)$

Solve Linear Equations

Solve for x.

 ;  x =

 ;  x =

 ;  x =

 ;  x =

 ;  x =

 ;  x =

 ;  x =

 ;  x =

 ;  x =

 ;  x =

This example uses a custom comparison procedure and the comparebyindex option along with state arrays that hold the question objects.

 > 
 > $\mathrm{MyPerms1}≔\mathrm{Array}\left(1..5,1..1,\left(\right)↦\mathrm{Perm}\left(\mathrm{combinat}:-\mathrm{randperm}\left(8\right)\right)\right)$
 ${\mathrm{MyPerms1}}{≔}\left[\right]$ (1)
 > $\mathrm{MyPerms2}≔\mathrm{Array}\left(1..5,1..1,\left(\right)↦\mathrm{Perm}\left(\mathrm{combinat}:-\mathrm{randperm}\left(8\right)\right)\right)$
 ${\mathrm{MyPerms2}}{≔}\left[\right]$ (2)
 > 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)

 =

 =

 =

 =

 =

Compatibility

 • The Student[Basics][PracticeSheet] command was introduced in Maple 2018.