ReferencemoduleAttributes

<moduleAttributes>

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