<conditionalContent>
<conditionalContent> is a General Operator
component that defines one or more blocks of content that
are evaluated only when certain conditions are met.
Conditions may be defined directly on the <conditionalContent> tag using the condition attribute.
Alternatively, one can use one or more <case> children with an
optional <else> child.
Attributes and Properties
Attributes for <conditionalContent>
Other (1)
boolean. Convenience for a single-case form: the boolean condition for which the children are rendered.
Common to all components (9)
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).
hideboolean. Default value: false. Whether to hide this component from the rendered output.
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 <conditionalContent name="c">
Common to all components (4)
$c.doenetMLtext. The DoenetML source code that produced this component.
$c.hideboolean. Whether to hide this component from the rendered output.
$c.isResponseboolean. Whether this component is treated as a response for the purposes of assessment.
$c.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: <conditionalContent> with nested <case> children
The <conditionalContent> component defines a block of content
containing individual <case> children. The doenetML within
each <case> is only rendered when its specified condition is true.
Example: <conditionalContent> with nested <else>
The <conditionalContent> component defines a block of content
containing individual <case> children. To catch all remaining
cases following a given condition or set of conditions, the
<else> component may be used.
Attribute Examples
Attribute Example: condition
A <conditionalContent> block with a <condition> attribute
renders only when the condition is satisfied. This allows for use of
a <conditionalContent> component without nested <case> components.