Referencemodule

<module>

<module> is a General Operator component that provides a way to organize a sequence of repeatable content. It is similar to creating a macro that can be reused multiple times within a DoenetML document.

Attributes and Properties

Attributes for <module>
AttributeTypeValues
asList = "…""true" "false"
createComponentOfType = "…"
numComponents = "…"
rendered = "…"boolean"true" "false"
Props for <module name="m">
PropertyType
$m.renderedboolean

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.