ReferencechoiceInput

<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

Attributes for <choiceInput>
AttributeTypeValues
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
Props for <choiceInput name="c">
PropertyType
$c.choiceMaths[ math ]
$c.choiceTexts[ text ]
$c.collaborateGroupscollaborateGroups
$c.disabledboolean
$c.feedbacks[ feedback ]
$c.fixedboolean
$c.fixLocationboolean
$c.hiddenboolean
$c.inlineboolean
$c.labellabel
$c.labelIsNameboolean
$c.matchPartialboolean
$c.numChoicesnumber
$c.numFeedbacksnumber
$c.preserveLastChoiceboolean
$c.selectedIndexnumber
$c.selectedIndices[ number ]
$c.selectedValue
$c.selectedValues
$c.selectMultipleboolean
$c.shuffleOrderboolean
$c.submitLabeltext
$c.submitLabelNoCorrectnesstext
$c.valueChangedboolean
$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.