Referencechoice

<choice>

<choice> is an Input component that defines an individual choice when nested within an <answer> block for multiple choice questions.

Attributes and Properties

Attributes for <choice>
AttributeTypeValues
credit = "…"number
feedbackCodes = "…"textList
feedbackText = "…"text
preSelect = "…""true" "false"
Props for <choice name="c">
PropertyType
$c.creditnumber
$c.disabledboolean
$c.disabledOriginalboolean
$c.feedbackCodestextList
$c.feedbacksfeedbacktext
$c.feedbackTexttext
$c.fixedboolean
$c.fixLocationboolean
$c.hiddenboolean
$c.mathmath
$c.selectedboolean
$c.submittedboolean
$c.texttext

Example: <choice> inside a <choiceInput> block

The <choice> components can be nested inside a <choiceInput> block.


Example: <choice> inside an <answer>

The <choice> components can be nested inside an <answer> for validation. Use the credit attribute to assign the correct <choice>.


Attribute Example: credit

Use the credit attribute to assign the correct <choice> in an <answer>. Partial credit may also be assigned with the credit attribute.


Attribute Example: feedbackText

Use the feedbackText attribute to directly define short feedback corresponding to individual <choice> selections within the <choice> definition. To render the feedback to the student, copy the feedbacks property of the named <answer>.


Attribute Example: preSelect

The preSelect attribute causes the <choice> to appear selected when the page is rendered.


Property Example: Attributes as properties

The credit and feedbackText attributes of a <choice> are accessible as properties.


Property Example: text

The text property renders the text contained in the <choice>.


Property Example: math

The math property renders the math contained in the <choice>.


Property Example: selected

The selected property renders the boolean value corresponding to whether a choice is currently selected.


Property Example: submitted

The submitted property renders the boolean value corresponding to whether a choice has been submitted as a response.