<feedback>
<feedback> is an Evaluation
component that renders a boxed section of content that can be triggered by predefined user interactions.
For short, reusable feedback messages keyed by a code rather than a
condition, see <feedbackDefinition> — it pairs
with the feedbackCodes attribute on <award> and
<choice> and includes four
built-in codes
(goodJob, numericalError, oneSignError, twoSignErrors).
Attributes and Properties
Attributes for <feedback>
Other (2)
boolean. Boolean expression; the feedback is shown when the condition is true.
reference. References whose changes trigger re-evaluation of the feedback.
Common to all components (8)
copyreference. Create an independent copy of another component by reference. Enter a references a $name.
disabledboolean. Default value: false. Whether this component is disabled and cannot be interacted with.
extendreference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.
fixedboolean. Default value: false. Whether this component's value is fixed and cannot be modified.
fixLocationboolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
isResponseboolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.
nametext. The name used to reference this component from elsewhere in the document.
styleNumberinteger. Default value: 1. The style number used to select this component's visual styling from the available style definitions.
Properties for <feedback name="f">
Other (4)
$f.disabledboolean. Whether this component is disabled and cannot be interacted with.
$f.fixedboolean. Whether this component's value is fixed and cannot be modified.
$f.fixLocationboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
Common to all components (3)
$f.doenetMLtext. The DoenetML source code that produced this component.
$f.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$f.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: <feedback> for any arbitrary incorrect answer
The condition for triggering the <feedback> consists of a boolean
that has two parts. The first part references the creditAchieved property of the
named <answer>, and the second checks to see whether the user has yet submitted a response.
No feedback is provided if the user answers the question correctly.
Example: <feedback> based on <choice> selected
The <feedback> provided to the user is tied to the <choice>
selected within an <answer>.
Example: Feedback defined directly in choices
Feedback is defined within each <choice> with the feedbackText attribute.
Below the <answer> block, the feedback text is rendered to the viewer with the reference
$ans.feedbacks.
Example: <feedback> tied to an <award>
Individualized feedback is provided to specific responses by referencing named awards in the condition.
Attribute Examples
Attribute Example: condition
The condition attribute specifies the boolean condition necessary for rendering the <feedback>.
Attribute Example: updateWith
When the updateWith attribute is specified, the condition for the <feedback> is re-checked after
the specified action. An <answer> action is completed when the user clicks the Check Work button.
The action for a <mathInput> is completed when the input box is no longer activated (i.e. the user
navigates outside the box).