<choiceInput>
<choiceInput> is an Input
component that defines a block of code for multiple choice questions.
It serves as a container element for the individual
<choice> components that are nested within.
Attributes and Properties
| Attribute | Type | Values |
|---|---|---|
bindValueTo = "…" | ||
inline = "…" | boolean | "true" "false" |
labelIsName = "…" | boolean | "true" "false" |
matchPartial = "…" | boolean | "true" "false" |
placeHolder = "…" | ||
preselectChoice = "…" | ||
preserveLastChoice = "…" | boolean | "true" "false" |
selectMultiple = "…" | boolean | "true" "false" |
shuffleOrder = "…" | boolean | "true" "false" |
submitLabel = "…" | text | |
submitLabelNoCorrectness = "…" | text |
| Property | Type |
|---|---|
$c.choiceMaths | [ math ] |
$c.choiceTexts | [ text ] |
$c.collaborateGroups | collaborateGroups |
$c.disabled | boolean |
$c.feedbacks | [ feedback ] |
$c.fixed | boolean |
$c.fixLocation | boolean |
$c.hidden | boolean |
$c.inline | boolean |
$c.label | label |
$c.labelIsName | boolean |
$c.matchPartial | boolean |
$c.numChoices | number |
$c.numFeedbacks | number |
$c.preserveLastChoice | boolean |
$c.selectedIndex | number |
$c.selectedIndices | [ number ] |
$c.selectedValue | |
$c.selectedValues | |
$c.selectMultiple | boolean |
$c.shuffleOrder | boolean |
$c.submitLabel | text |
$c.submitLabelNoCorrectness | text |
$c.valueChanged | boolean |
$c.values | |
$c.valueToRecordOnSubmit | [ number ] |
Example: <choiceInput> for survey question
A <choiceInput> is used to collect user responses that do not require validation.
Example: <choiceInput> in <answer>
A <choiceInput> can be nested within an <answer> to
collect user responses with validation.
Example: <choiceInput> as a menu
A <choiceInput> can be used in combination
with <conditionalContent> to create a simple menu.
Attribute Example: selectMultiple
The selectMultiple allows users to select multiple <choice>
components in a <choiceInput>.
Attribute Example: matchPartial
If an <answer> requires more than one <choice> selection
for full credit, the matchPartial attribute can be used to
assign partial credit if one or more of the total number of correct
choices are selected within a <choiceInput>.
Attribute Example: inline
The inline attribute provides a pull-down menu for <choice>
selection rather than the default radio buttons.
Attribute Example: shuffleOrder
With the shuffleOrder attribute, the sequenceing of the choices is
different for each page variant.
Attribute Example: preselectChoice
The preselectChoice attributes takes the index of the choice to preselect.
Attribute Example: bindValueTo
The <bindValueTo> takes a named component as input. The
value of the <choiceInput> then becomes linked to that component’s value.
Attribute Example: submitLabel
The submitLabel attribute can be used to create a custom label for the “Check Work” button.
Attribute Example: submitLabelNoCorrectness
The submitLabelNoCorrectness attribute modifies the standard
“Submit Response” button label for answers where it is not desired to show correctness.
Property Example: numChoices
The numChoices property returns the number of nested <choice>
children in the named <choiceInput>.
Property Example: choiceTexts
The choiceTexts property renders the texts contained in the <choiceInput> in an array.
Property Example: choiceMaths
The choiceMaths property renders the maths contained in the <choiceInput> in an array.
Property Example: selectedIndices
The selectedIndices property renders an array of the indices of all choices selected by the user.
Property Example: selectedValues
The selectedValues property renders an array of the values contained
in all of the choices selected by the user.
Property Example: feedbacks
The feedbacks property should be copied in the document at the
location where feedback should appear based on the specified interactions.