ReferenceconstraintUnion

<constraintUnion>

A constraint that is satisfied if any of its child constraints are satisfied

<constraintUnion> is a Graphical component that delineates a block of code for defining the union of one or more constraint components associated with a <point>.

Attributes and Properties

Attributes for <constraintUnion>

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 <constraintUnion name="c">

Other (4)
$c.disabled

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

$c.fixed

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

$c.fixLocation

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

$c.hidden

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

Common to all components (4)
$c.doenetML

text. The DoenetML source code that produced this component.

$c.hide

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

$c.isResponse

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

$c.styleNumber

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

Examples

Example: Constrain a <point> to multiple components

A <point> is constrained to four <line> components. In the first graph, the <constraintUnion> container is used, and the point can move between lines. In the second graph, without <constraintUnion>, the point is quickly “trapped” on the last line to which it is constrained.


Example: Constrain to a circle and a grid

A <point> is constrained to a <circle> and a grid. In the first graph, the <constraintUnion> container is used, and the point can move off the circle, but then only on gridlines. In the second graph, without <constraintUnion>, the point is “trapped” on the circle, which is the last constraint.