ReferencemoduleAttributes

<moduleAttributes>

A reusable group with parameterized attributes; can be copied elsewhere with new parameter values

<moduleAttributes> is a General Operator component that is used to describe custom user-defined attributes when nested in a <module> component. Similar to the attributes of a built-in DoenetML component, the user-defined attributes defined with a <moduleAttributes> block are then listed in the opening tag of the custom <module> component.

Attributes and Properties

Attributes for <module>

Other (4)
asList

boolean. Default value: false. Whether to render the group's children separated by commas (true) or with no separator (false).

createComponentOfType

text. Component type to wrap each child as when expanding the group.

numComponents

number. Number of components to create when expanding (used with createComponentOfType).

rendered

boolean. Default value: true. Whether the group's children are rendered.

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

hide

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

isResponse

Whether this group's children should be treated as responses for assessment.

name

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

Properties for <module name="m">

Other (1)
$m.rendered

boolean. Whether the group's children are rendered.

Common to all components (2)
$m.doenetML

text. The DoenetML source code that produced this component.

$m.hide

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

Examples

Example: <module> for repeated geometry

In this example, a <module> named drawBalloon is defined within a <setup> block. Nested <moduleAttributes> components define the center point, color, and radius of a default balloon.

Geometry defined within the <module> (the <lineSegment> and <circle> components) are copied into the graph when the module is referenced.

Referencing the module multiple times within the <graph> and varying the attribute values has the effect of creating a “bunch” of balloons. Note the use of the copy attribute (rather than the extend attribute) so that each balloon is an independent copy.