<module>
<module> is a General Operator
component that provides a way to organize a sequence of repeatable content. It is similar to creating
a reference that can be reused multiple times within a DoenetML document.
Attributes and Properties
Attributes for <module>
Other (4)
asListboolean. Default value: false. Whether to render the group's children separated by commas (true) or with no separator (false).
createComponentOfTypetext. Component type to wrap each child as when expanding the group.
numComponentsnumber. Number of components to create when expanding (used with createComponentOfType).
renderedboolean. Default value: true. Whether the group's children are rendered.
Common to all components (8)
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.
isResponseWhether this group's children should be treated as responses for assessment.
nametext. The name used to reference this component from elsewhere in the document.
Properties for <module name="m">
Other (1)
$m.renderedboolean. Whether the group's children are rendered.
Common to all components (2)
$m.doenetMLtext. The DoenetML source code that produced this component.
$m.hideboolean. 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.