<hint>

Hint shown on demand to help with an exercise

<hint> is a Sectional component that renders a hidden block of content that can be expanded when its banner is clicked or can be rendered visible only when triggered by specific user interactions.

Attributes and Properties

Attributes for <hint>

Common to all components (9)
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).

hide

boolean. Default value: false. Whether to hide this component from the rendered output.

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 <hint name="h">

Other (6)
$h.disabled

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

$h.fixed

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

$h.fixLocation

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

$h.hidden

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

$h.open

boolean. Whether the hint is currently open (revealed).

text. The hint's title text.

Common to all components (4)
$h.doenetML

text. The DoenetML source code that produced this component.

$h.hide

boolean. Whether to hide this component from the rendered output.

$h.isResponse

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

$h.styleNumber

integer. The style number used to select this component's visual styling from the available style definitions.

Examples

Example: <hint> that is always visible

The <hint> banner is not triggered by any specific conditions and is always accessible to the user. The content of the <hint> is made available by clicking on the hint banner.


Example: <hint> only visible for specified interactions

The conditions under which a <hint> is visible can be tailored to specific user interactions using the <hide> attribute.


Example: Hide a <hint> until user answers twice

Properties of the named <answer> component are referenced by the boolean condition listed in the hide attribute of the <hint>. In this case, if the user answers incorrectly 2 or more times, the hide attribute of the <hint> will become false, and the <hint> will appear.

Property Examples

Property Example: open

The open property renders the boolean value corresponding to whether the <hint> is currently open.


Property Example: title

The title property renders the title associated with the <hint>.