Skip to main content

The PreTeXt Guide

Subsection 4.12.2 Multiple-Choice Exercises

A multiple-choice exercise is signaled by a <choices> element (plural) following a <statement> and preceding an optional <hint>. The <choices> element is structured by a sequence of <choice> elements, whose content is a potential answer for the reader to choose. So the <statement> is the prompt or question, and the <choice> are the possible answers.
At least one <choice> has an attribute @correct set to the value yes. The default value of @correct is no. There may be several correct answers, indicated with this attribute. The presentation as an exercise with one answer or many is automatic. However, in the event there is exactly one correct answer, but you wish the reader to consider the possibility of multiple correct answers, you may set the @multiple-correct attribute on the <choices> element to yes. The default value is no.
Each <choice> element must be further structured with a <statement> and a <feedback>, which each can contain items such as paragraphs (<p>). In this way, the highly-encouraged feedback can be associated with each correct and incorrect choice.
The order of the <choice> as authored, is the order they will be given in a static version. To present the choices in different orders in an interactive version, set the @randomize attribute on the <choices> element to yes.
An automatic <answer> for the static version is simply the list markers for the correct choices. An automatic <solution> has an indication for each choice if it is correct or incorrect, along with the choice’s feedback.