<choice>
<choice>
is an Input
component that defines an individual choice when nested
within an <answer>
block for multiple choice questions.
Attributes and Properties
Attribute | Type | Values |
---|---|---|
credit = "…" | number | |
feedbackCodes = "…" | textList | |
feedbackText = "…" | text | |
preSelect = "…" | "true" "false" |
Property | Type |
---|---|
$c.credit | number |
$c.disabled | boolean |
$c.disabledOriginal | boolean |
$c.feedbackCodes | textList |
$c.feedbacks | feedbacktext |
$c.feedbackText | text |
$c.fixed | boolean |
$c.fixLocation | boolean |
$c.hidden | boolean |
$c.math | math |
$c.selected | boolean |
$c.submitted | boolean |
$c.text | text |
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.