## Using The Math Question Generator

The Math Question Generator enables the easy creation of mathematics questions using dynamic content.

# Description

The Math Question Generator automates repetitive aspects of mathematics question authoring, by taking a range of values and creating a data table with variations of the question (and relevant solutions), with automatic validation.

The Math Question Generator leverages the same scoring methods as other math question types, however, it applies the scoring methods for you, depending on the type of correct answer you select.

# Create a Question

To create a Math Question Generator question, add a new question and select the Math Question Generator tile from the math section in the tile view.

** Note: a Math Question Generator question cannot be added to a question with an existing dynamic content data table. Also note, you cannot add two Math Question Generator questions in the same question**.

*Any change to the data table is must be made in the Math Question Generator wizard and then regenerated.*

The Math Question Generator authoring interface contains the dynamic math generator and settings for the following:

- Settings for layout, including final response box size and associated ARIA label
- Settings for the keypad
- Additional options

With the "More Options" box expanded you can see the following options:

- Scoring
- Layout
- Text Blocks
- Extras (associated metadata)

To use the Math Question Generator in a question for the first time, launch the wizard by selecting the **Create expression** button.

The four steps that the wizard brings you through are:

- Create parameters and set their values
- Create the expression with the parameter(s)
- Select the correct answer format(s)
- Generate the questions

## 1. Create parameters and set their values

In this section, you will define the question parameters. A parameter is the element of an expression that will receive dynamically generated values. Parameters can be added to an expression and also to part of the question stem text.

Parameter names can only be alpha characters (a-z or A-Z) and will be swapped for real values when the question is loaded for the end-user.

When the parameter is named values can be added to it.

There are two options for setting parameter values – list and range. Each option will accept positive, negative and decimal values to three decimal places.

**List**allows a string of specific, comma-separated values to be defined where there is a need to curate the possible variants.**Range**allows the setting of a minimum and maximum for the range of values to be drawn from. This range can be incremented with the step value. The increment will start at the minimum value and finish at the nearest value to the maximum. The step support decimals but will not accept negative values.

Use the add parameter to add a new parameter, parameters can be removed by selecting 'Delete' on the relevant parameter row.

*Note: There is always a pre-populated parameter, as the Math Question Generator requires at least one to operate.*

Removing a parameter will remove the column and its associated data in the data table, and it will no longer be available under the 'Data' button. However, if the parameter has already been added to the Composed question field, the parameter instance in the text will not be removed (it must be manually removed).

Once all parameters and values are set, navigate by clicking 'next' or via the breadcrumb link at the top of the generator wizard.

## 2. Create the expression with the parameter(s)

In this section, the expression that defines the question is set including the parameters created previously. This expression is the basis for the validation setting (the correct answer) that is returned by the Math Question Generator. It can also be used within the question content itself. See the headings 'Adding Parameters in an expression' and 'Adding Parameters inline with text' on this page for examples.

Using the keypad, enter the required math, adding the parameters. These are available from the ‘Data' dropdown.

There are two ways that content can be used in a question. The parameters can be applied directly within an expression, or they can be added inline within the question text.

## Adding *parameters* within an expression

Let’s take the example of factorizing a quadratic expression to demonstrate this use case:

`(x+a)(bx-c)`

Our constants are a, b and c and will become the parameters we set for generation of math question generator content.

As per **Create parameters and set their values, **enter these parameters with the following values:**a** - set a range 1 to 5**b** - set a list containing 2,4,6**c** - set a list containing 1,3,5

Now move to the *Expression & question* section and use the keypad to add a mathematical expression that will form the basis of your question. This expression will be evaluated when generating the correct answer forms. The parameters can be inserted within the expression using the *Data* dropdown.

In this example it will be the factored form of the expression, it should look like this:

Moving to the field below the keypad, this is where the question stem is added. This offers the same rich text options of a regular math question stimulus.

Additionally, in the Math Question Generator, there is a 'use expression' option to place a copy of the expression into the question stem if required.

Below is how this example may be authored.

*Note: you must ensure that there is a ‘Response’ box included in the question text.*

This is the field that the user will enter their answer in, and where the math engine will process the answer from. You can only add one ‘response’ area as multiple responses are not supported.

The default size is 25px square to accommodate its use of inline within the text. If a different size is required this can be adjusted under the **Layout** section once the content is set and you are back in the question editor. Select preview to see the result as it will be rendered.

## Adding *parameters* inline in text

Math question generator parameters can also be used within text to add the parameter values to the question stem itself.

Let's take the example of a number of pieces of fruit. We will ask the user to calculate the final number of fruit a group of people has combined.

First, we need to define fruit types. On the first screen of the wizard we enter all the fruit parameters, we add ‘apples’, ‘bananas’ and ‘pears’ and set each parameter range to the desired amount. In this case, we set ranges of 1 to 5.

On the next screen we can define our expression and our question, the order does not matter. For this example, we will set the question first, remember the parameters are available in the ‘data dropdown' button in the text editor toolbar. Don’t forget you need to have one response box in this section for the user to enter their answer.

See below:

Next, we will define an expression that represents this question. In the same way as the factored example, this expression will be used to calculate the correct answer in all adaptations.

In this case, we need to add apples, bananas and pears and then subtract three.

So, we would enter the following:

## 3. Select the correct answer format(s)

Moving to the next section of the wizard, the Math Question Generator will process the expression and parameter settings and present you with all mathematical forms that represent a possible answer the Math engine will accept. It will also offer any further settings that may be relevant to the form of the correct response. For example, if there are decimals or thousandths in the valid answers, configuration options are displayed to set the accepted forms of the decimal and thousandths separators.

The options displayed will be forms of a correct response that are relevant to the original expression set in 'Setting the question expression and creating the question stem'. Using the checkboxes, select the forms of the correct answer that will be accepted.

*Note: In some cases, only the original expression will be available to select. In this case, it's recommended to check the original expression and the expected answer. Where this could be relevant for the intended use case, in most cases it signals that the original expression is invalid.*

Behind the scenes, the Math Question Generator will set the math scoring method(s) for the question. Multiple forms of the solution can be selected and where relevant, alternate responses are set automatically, as well. Because setting the validation is handled automatically, the existing math question validation interface is not displayed in the Math Question Generator*.*

## 4. Generate the questions

The next section of the wizard will allow us to generate the possible variations for this expression. This is based on the ranges for each parameter, and the particular form of the correct answer(s).

Select **Generate** to display the populated table of possible variants of the equation.

Any unwanted variants can be removed from the final data table. As you scroll through the list of generated results, check those that you want to remove, then select the "Remove" button to remove these from the final data table saved to the question.

To ensure that the data table and the question stem content is committed to the question, it is necessary to select **Apply**. The data and question content will be saved and returns to the question editor.

Here, we can add further settings for the question and preview the results.