- 13 Sep 2024
- 5 minutes to read
Embedded answers (Cloze) quiz question
- Updated on 13 Sep 2024
- 5 minutes to read
Embedded Cloze questions are used to combine different question types into one question (such as multiple choice, missing words, short answer, numerical, etc.).
Questions are added using specific code or question text formats. The Totara Academy has a useful resource providing a list of the text formats for each question type.
Set up a Cloze question
To set up an embedded answers (Cloze) question, follow these steps:
- In the quiz activity, click Add, then select a new question.
- Select Embedded answers (Cloze), then click Add.
- Give the question a name, then enter the question in the Question text field. The Question text field can include multiple Cloze questions. See the Formatting section for more information on how to set up these questions.
- Either enter feedback in the General feedback field, or for specific questions and answers using the Cloze formatting.
- Click the Decode and verify the question text button to check that the question is set up correctly. A new section will appear for each question, allowing you to check the details.
- If required, configure the Multiple tries and Tags sections.
- Click Save changes.
Cloze question types
The following question types are available to add in an Embedded answer (Cloze) quiz question.
Question type | Description | Code |
---|---|---|
Short answer | Learners enter a short amount of text, which is compared to the correct answer. | SHORTANSWER SA MW |
Short answer (case-sensitive) | Learners enter a short amount of text, which is compared to the correct answer. The case of the text entered must match the case of the answer, e.g. 'hello' and 'Hello' would not match. | SHORTANSWER_C SA_C MW_C |
Numerical | Learners enter a numeric value, including integers or floating point (decimal) numbers. | NUMERICAL NM |
Multiple choice question (dropdown list) | Learners select from options in a dropdown list. | MULTICHOICE MC |
Multiple choice question (vertical radio buttons) | Learners select from options displayed as a vertical set of radio bullets. | MULTICHOICE_V MCV |
Multiple choice question (horizontal radio buttons) | Learners select from a set of options displayed as a horizontal set of radio bullets. | MULTICHOICE_H MCH |
- MULTICHOICE_S
- MC_S
- MULTICHOICE_VS
- MCVS
- MULTICHOICE_HS
- MCHS
Formatting
Let's look at an example question to see how to format a Cloze question:
The capital city of New Zealand is {1:MULTICHOICE:Auckland#Wrong!~Christchurch#That's not right.~=Wellington#That's right!}
This subquestion is made up of the following features:
- Each Cloze subquestion in contained within curly brackets: { }
- The first number inside the curly brackets indicates the grade for this subquestion. In this example a correct answer gives a score of 1. You can use this value to give each subquestion a different weighting. Note that this number must be a positive integer.
- Next the code between two colons defines the question type. In this example, :MULTICHOICE: means this is a multiple choice question with options displayed in a dropdown list.
- Answers are separated by the tilde symbol: ~
- The correct answer is marked with the equals symbol: =
- After each answer you can optionally add specific feedback with the hash symbol: #
If the correct answer within an embedded question contains the symbols } # ~ / " or \ you will have to remove or escape them from the Cloze code by entering a \ in front of each character.
The { shouldn't be escaped as this can be vital in getting TeX expressions to work.
In the feedback ~ and } must be escaped otherwise they will be interpreted as the next answer or end of the short answer section respectively.
Quotation signs should be avoided. Instead use the HTML entity: & quot; (without the space between & and quot;).
When using mathematical symbols the \ used in TeX expressions can be problematic. Unicode characters can be used to avoid any issues.
- Export questions in GIFT or Totara XML formats to import them into a lesson activity.
- Copy and paste text from a PDF or text file into the question content area. This strips out additional formatting and any hidden code which other editing programs can insert.
Examples
Multiple choice question
Here is an example of a multiple choice question:
The American flag is red, white and {1:MULTICHOICE:black~=blue~yellow}
Short answer question
Here is an example of a short answer question:
The capital of Japan is {1:SHORTANSWER:%100%Tokyo#That's right!}
Instead of an equals sign, the correct answer in this example is denoted with %100%, which indicates that this answer is worth 100% of the grade. You can add additional answers with different weightings if you wanted to provide partial credit for other answers.
The capital of Japan is {1:SHORTANSWER:%100%Tokyo#That's right!~%25%Kyoto#Kyoto was the capital until 1868}
In this example a user answering 'Kyoto' would receive a score of 0.25 (25% of 1), while a user answering 'Tokyo' would receive a score of 1.
Numerical question
Here is an example of a numeric question:
A hexagon has {1:NUMERICAL:%100%6} sides
In this example, users must answer '6' exactly, and any other answer would receive a score of 0. However, you can also include a range/interval so that users' answers can be will be marked as correct provided they are within the specified range of the correct answer, e.g.:
The value of pi is approximately {2:NUMERICAL:%100%3.14159:0.01~%50%3.14159:0.02}
In this example, a more precise answer will achieve a higher score. The number after the colon for each answer represents the accepted error. For full marks, the user's answer could be 0.01 above or below the specified answer, i.e. between 3.13159 and 3.15159. A less precise answer between 3.12159 and 3.16159 would still receive a score of 1 (50% of 2, the grade for the subquestion).
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.