Calculated multiple choice quiz question
    • 24 Sep 2024
    • 1 minute to read

    Calculated multiple choice quiz question


    Article summary

    Calculated multiple choice questions operate much like the multiple choice question type, however the choices available are generated from a given formula, using wildcards and datasets.

    For example, a question may be: 'Calculate the area of a square where it's width = {width} and the height = {height}.

    The correct answer would be: 'The square's area is {={width}*{height}} cm2' 

    An incorrect answer could be: ' The square's area is {={width}+{height}} cm2' 

    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.

    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.