--- title: "Calculated multiple choice quiz question" slug: "calculated-multiple-choice-quiz-question" tags: ["Content Creator", "Explainer", "Totara Learn"] updated: 2025-07-22T10:52:18Z published: 2025-07-22T11:18:35Z canonical: "totara.help/calculated-multiple-choice-quiz-question" --- > ## Documentation Index > Fetch the complete documentation index at: https://totara.help/llms.txt > Use this file to discover all available pages before exploring further. # Calculated multiple choice quiz question Calculated multiple choice questions operate much like the [multiple choice question type](/19/docs/multiple-choice-quiz-question), however the choices available are generated from a given formula using wildcards and datasets, as with the [calculated question type](/19/docs/calculated-quiz-question). For example, a question may be: 'Calculate the area of a rectangle where its width = {width} and its height = {height}. The correct answer would be: 'The rectangle's area is {={width}*{height}} cm²' An incorrect answer could be: 'The rectangle's area is {={width}+{height}} cm²' The correct answer choice would display with the calculated answer, based on the values the system automatically generates. Calculated quiz questions present a potential security risk in that they can be used to execute PHP code on the server, so you may want to limit who is able to add these quiz questions. The ability to add **Calculated**, **Calculated simple** and **Calculated multiple choice** quiz questions is controlled by the **moodle/question:managecalculated** capability. For upgraded sites this capability will be assigned to any users who already have the **moodle/question:add** capability. For new sites, this capability is not assigned to any roles by default. In either case, we recommend that Site Administrators review whether calculated quiz questions are required, and limit the capability to administrative roles where possible. No special role is required to use existing calculated questions in a quiz. ![A calculated multiple choice quiz question from the Learner's perspective.](https://cdn.document360.io/a007399b-031e-436b-999a-528240e16f58/Images/Documentation/image-1726495661110.png?sv=2026-02-06&spr=https&st=2026-11-01T14%3A48%3A20Z&se=2026-11-01T15%3A48%3A20Z&sr=c&sp=r&sig=dKpyoJri6qGkQ59W5idR0zZiBvbPEes9TcflSSBPK8I%3D) To set up a calculated multiple choice quiz question, follow these steps: 1. In the quiz activity, click **Add**, then select **a new question**. 2. Select **Calculated multiple choice**, then click **Add**. 3. Give the question a name, then enter the question in the **Question text** field. The question text must include the [wildcards](/19/docs/calculated-quiz-question#wildcards) you will use in the answer formula, with each one inside a set of curly brackets. For example: 'A rectangle has a width of {width} and a height of {height}. What is the area of this rectangle?' 4. Set the **Default mark**, i.e. how many marks the Learner will be awarded if they answer correctly. 5. Configure the other **General** settings as required. 6. Enter a formula in each of the **Choice** fields, with at least one answer using the correct formula that will be used to calculated the correct answer based on the wildcards that are randomly generated. For example, entering {={width}*{height}} would mean the correct answer would be calculated by multiplying two wildcards: {height} and {width}. An incorrect choice could include the formula {={width}+{height}*2}. See [Answer formula syntax](/19/docs/calculated-quiz-question#answer-formula-syntax) for more information. You can configure additional answers by clicking **Blanks for 3 more choices**. 7. Set the grade weighting for each answer. 8. Add feedback for each choice. If you don't want to provide specific feedback for each answer, either use the **General feedback** field or the **Combined feedback** section. 9. If required, configure the [**Units** and **Unit handling**](/19/docs/calculated-quiz-question#units-and-unit-handling) sections. 10. If required, configure the **Multiple tries** and **Tags** sections. 11. Click **Save changes**. 12. Set which dataset you wish to use for the wildcards, and set whether data is synchronised with other questions in the quiz. 13. Click **Next page**. 14. Manually add wildcard values by entering values in the **Wild card {x}** fields, then clicking **Add**. If you want Totara to generate the values, you can additionally enter the **Minimum** and **Maximum** for the **Range of values**, set the number of decimal places, and select which distribution to use (**Uniform** means all values in the range are equally likely, while **Loguniform** means higher values are less likely to be generated). Note that you can generate multiple wildcards at once using the dropdown next to the **Add** button. 15. Click **Save changes**. ![Course badge](https://cdn.document360.io/a007399b-031e-436b-999a-528240e16f58/Images/Documentation/course-badge_getting-started-with-quizzes.svg?sv=2026-02-06&spr=https&st=2026-11-01T14%3A48%3A20Z&se=2026-11-01T15%3A48%3A20Z&sr=c&sp=r&sig=dKpyoJri6qGkQ59W5idR0zZiBvbPEes9TcflSSBPK8I%3D)There are two courses in the Totara Academy about using quizzes in Totara Learn, [Getting started with quizzes](https://totara.community/course/view.php?id=639) and [Advanced quiz](https://totara.community/course/view.php?id=262) Using these courses you can learn more on how to use these features, see best practice, and give it a go yourself. Join the [Totara Community](https://totara.community/) for more resources to help you get the most out of Totara. © Copyright 2025 Totara Learning Solutions. All rights reserved. Some content originally obtained via [GPLv3 license](https://www.gnu.org/licenses/licenses.html#GPL) and continues to be available under GPLv3. All other content is the sole copyright of Totara Learning Solutions.