On this page:
Calculated Multichoice Questions are individual numerical questions based on a formula using variables or "wild cards" (i.e {x} , {y}). These wild cards are selected randomly from a set of values when the quiz is taken. Warning: Setting up this question type is very confusing; consider using a Multiple Choice Question instead.
Example of a Calculated Multichoice Question:

Edit a Calculated Multichoice Question
- In the Question Bank, select the desired question category, then click Create a new question... Choose Calculated Multichoice and click Next. The Adding a question screen opens.
- Give the question a descriptive name - this makes it easy to identify it in the question bank. The question name is not visible to students.
- Enter question text, include any wild cards (variables) surrounded by curly brackets.
Example: What is the area in square meters of a parallelogram with a height of {h} m and a base length of {b} m ?
- Create the correct answer for Choice 1 by entering a formula using the same wild cards as the question text in order to define how a correct answer will be calculated. You must include an equal sign (=) in the formula.
Example: {={b}*{h}}
- Set Grade for the correct answer to 100%.
- To choose the number of decimal places for the correct answer, set Correct answer shows. Moodle will round the correct answer to the number of places set.
- Enter formulas or values for the remaining choices. Using the wildcards ({b} and {h}) in these formulas will result in random values as potential choices.
Example: {={b}*{h}+1}
- Scroll to the bottom of the screen and click Save changes. The Choose wildcards dataset properties screen opens.
- Each wildcard that you specify in the answer formula must have an associated set of possible values - this is its dataset. Each of the wild cards is listed on this page along with a choice of dataset:
- Private: only used by this question
- Shared: shared with other calculated questions in the same category
Note: Using a shared dataset can save time when you are creating a lot of similar calculated questions.
For each wild card, choose will use a new shared dataset if you are creating a dataset for the first time. To synchronize the wild card values with the other questions in the quiz, choose Synchronize, then click Next page. The Edit the wildcards datasets screen opens.
Edit the datasets
There are two ways of creating values: you can type them in yourself and add them to the list, or you can have Moodle generate random values. The table at the top of the page keeps an updated count of how many wild cards have been added to the set.
Add/delete your own values
Adding individual values to the list is easy:
- In the Item to add section, choose the value you want for each wild card item. You can ignore Range of values since the values will not be random.
- Scroll down to the Add section and click Add (leaving the number of items set to 1)
- Repeat the above steps as many times as necessary (the maximum number of items is 100)
To delete values from the list:
- In the Delete section, select the number of items to delete
- Click Delete.
Let Moodle generate values
- In the Item to add section choose values for the Range of Values fields, and enter the lower and upper limits for the values you would accept.
- Choose a number of decimal places for the value.
- Choose the Distribution of values between the limits
Uniform means any value between the limits is equally likely to be generated.
Loguniform means that values towards the lower limit are more likely. - Now move down to the Add section and choose Force regeneration of all wildcards.
- Next to Add, choose the number of sets of random values (items) you want to add to the list. (Note that the maximum total number of items in your list is 100.)
- Finally, click Add to append the new values to to the dataset. The screen reloads and you see a preview of the wild card values that have been added to your dataset.
Note: If you want more control over the items that Moodle adds, you can do them one at a time and preview the values before you add them. Click Get New Item to Add to make Moodle generate new values in the Item to Add section at the top. If you like them, click Add for 1 item; if not, click Get New Item to Add again to get new values.
Finish the question setup
Once you have added wild card values to the question dataset, you can finish creating the question. Click Save changes to save the question. The Question bank opens.
After creating a question, be sure to check to make sure the question works correctly. Click the magnifying glass icon
next to the question in the Question bank to view a preview of the new question.
For additional instructions on setting up this question type including advanced formula options, see Calculated question type and Calculated Multichoice Question Type on Moodle Docs.