Referencefeedback

<feedback>

Targeted feedback shown when conditions are met

<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)
copy

reference. Create an independent copy of another component by reference. Enter a references a $name.

disabled

boolean. Default value: false. Whether this component is disabled and cannot be interacted with.

extend

reference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.

fixed

boolean. Default value: false. Whether this component's value is fixed and cannot be modified.

fixLocation

boolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

isResponse

boolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.

name

text. The name used to reference this component from elsewhere in the document.

styleNumber

integer. 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.disabled

boolean. Whether this component is disabled and cannot be interacted with.

$f.fixed

boolean. Whether this component's value is fixed and cannot be modified.

$f.fixLocation

boolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

$f.hidden

boolean. Whether this component is hidden from the rendered output.

Common to all components (3)
$f.doenetML

text. The DoenetML source code that produced this component.

$f.isResponse

boolean. Whether this component is treated as a response for the purposes of assessment.

$f.styleNumber

integer. 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).