<else>

Default branch within a `<conditionalContent>`; matched when no `<case>` condition is true

<else> is a Logic component that is used with the <conditionalContent> component in creating logical statements with DoenetML.

Attributes and Properties

Attributes for <else>

Other (1)
condition

boolean. Boolean expression; this case is selected when the condition is true.

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 <else name="e">

Other (5)
$e.conditionSatisfied

boolean. Whether this case's condition is currently satisfied.

$e.disabled

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

$e.fixed

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

$e.fixLocation

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

$e.hidden

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

Common to all components (4)
$e.doenetML

text. The DoenetML source code that produced this component.

$e.hide

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

$e.isResponse

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

$e.styleNumber

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

Examples

Example: <else> in a <conditionalContent> based on answer

The <else> component is used to define the third <case> response in a <conditionalContent> block.


Example: <else> in a <conditionalContent> based on textInput

The <else> component is used to define a response to all user entries that do not match the given <case> conditions in a <conditionalContent> block.