Embedded answer (Cloze) quiz question
  • 23 Apr 2024
  • 4 minutes to read

Embedded answer (Cloze) quiz question


Article Summary

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.


Cloze question types

The following question types are available to add in an Embedded answer (Cloze) quiz question.

Question typeDescriptionCode
Short answerLearners 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
NumericalLearners 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
If the quiz question behaviour is set to shuffle answers, you can also shuffle the answers for embedded multiple choice questions using these codes:
  • MULTICHOICE_S
  • MC_S
  • MULTICHOICE_VS
  • MCVS
  • MULTICHOICE_HS
  • MCHS

Formatting

Instead of manually configuring questions using the syntax outlined in this section, you may instead want to use a Cloze generator. There are numerous third-party Cloze generators available online.

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}

Note that you can also use :MULTICHOICE_V: to display the options as vertical radio buttons, or :MULTICHOICE_V: for horizontal radio buttons.

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.

Note that you can use :SHORTANSWER_C: if the answer needs to be case sensitive.

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).

C025 - Quiz(1)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.


© 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.