Calculated quiz question
  • 24 Sep 2024
  • 2 minutes to read

Calculated quiz question


Article summary

Calculated questions are used to create mathematical questions which provide random values within a set formula, through the use of wildcards (e.g. {x} , {y} ).

This randomisation allows each learner to have a individualised calculated quiz question during an attempt.

For example, a question may be 'Calculate the area of a square where it's width = {width} and the height = {height}'. When displayed to the learner, {width} and {height} would be replaced with randomly selected numerical values - e.g. 'Calculate the area of a square where it's width = 3cm and the height = 3cm'.

The quiz creator can also specify the units required for the answers (e.g. cm).

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.

Setting up a calculated quiz question.

Tolerance 

You can set the acceptable tolerance for error within the learner's response and the type of tolerance allowed. The specified tolerance value and the tolerance type selected combines to generate a range of acceptable scores.

If tolerance = t, correct answer = x and the difference between the user's answer and the correct answer is cx, then the tolerance types are as follows: 

  • Nominal: Mark correct if cx <= t 
  • Relative: Mark correct if cx / x <= t 
  • Geometric: Mark correct if cx² / x² <= t²

Answer formula syntax

  • There is no need to use an equal symbol in the formula.
  • As a general rule, enter formulas as you would on a calculator e.g. 3 + 5 * sin(3/{x}. Exponentiation should be entered as pow({x}, y).
  • Any special mathematical function must have parentheses around its values.
  • Use an asterisk (*) for multiplication.

Wildcards

Wildcards are placeholders for the numbers, values and/or measurements used in a calculated question formula.

Wildcards (such as {width} and {height} from the above example) can be saved within a wildcard bank within a quiz category and reused across quizzes and quiz questions. 

After adding a wildcard to a calculated question and saving, select the wildcard datasets available for this question.

Wildcard datasets defines the range of numerical values available for each wildcard, specifies the number of different datasets (values) available for random selection, and determines the wildcard values for each of the datasets available.

Setting up wildcard datasets.

Calculated simple

This question type provides a simpler version of the calculated question type, where numerical values are randomly from a specified dataset during a quiz attempt.

There are two courses in the Totara Academy about using quizzes in Totara Learn, Getting started with quizzes and Advanced quiz Using these courses you can learn more on how to use these features, see best practice, and give it a go yourself.


Can't find what you're looking for? Contact us at documentation@totara.com. Alternatively, book a call to have a chat about your Totara platform with a dedicated Customer Success Manager.

© Copyright 2024 Totara Learning Solutions. All rights reserved. Some content originally obtained via GPLv3 license and continues to be available under GPLv3. All other content is the sole copyright of Totara Learning Solutions. 

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.