<tupleList>
<tupleList> is a math-list component that stores a list of math
tuples — parenthesized, comma-separated groups such as (1, 2) or
(a, b, c). It is a specialized form of <mathList> in
which each list item must be written as a parenthesized group.
When creating a <tupleList>, separate items by spaces, not commas.
The component will default to displaying the list with commas. (The commas
inside each pair of parentheses are part of one tuple, not separators
between items.)
Because <tupleList> extends <mathList>, all of the
attributes and properties of <mathList> are also available here
(unordered, maxNumber, asList, mergeMathLists, numComponents,
latex, text, etc.).
Attributes and Properties
Attributes for <tupleList>
Other (13)
asListboolean. Default value: true. Whether to render the items separated by commas (true) or with no separator (false).
avoidScientificNotationWhether to render numbers in full decimal form rather than scientific notation.
displayDecimalsNumber of decimal places to display when rendering this number.
displayDigitsNumber of significant digits to display when rendering this number.
displaySmallAsZeroThreshold below which numbers are displayed as zero.
functionSymbolstextList. Default value: ["f","g"]. Symbols treated as function names when parsing items.
number. Default value: Infinity. Maximum number of items to retain in the list.
mergeMathListsboolean. Whether nested math-list children should be flattened into this list.
padZerosWhether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
parseScientificNotationboolean. Default value: false. Whether to parse expressions like 1e3 as scientific notation.
referencesAreFunctionSymbolsreference. References whose names should be treated as function symbols when parsing items.
splitSymbolsboolean. Default value: true. Whether multi-character symbols are split into a product of variables.
boolean. Default value: false. Whether the order of items in this list should be treated as unordered (e.g. for matching).
Common to all components (9)
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.
fixedDefault 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 component is treated as a response for the purposes of assessment.
nametext. The name used to reference this component from elsewhere in the document.
styleNumberinteger. Default value: 1. The style number used to select this component's visual styling from the available style definitions.
Properties for <tupleList name="t">
Other (8)
$t.functionSymbolstextList. Symbols treated as function names when parsing items.
$t.maxNumbernumber. Maximum number of items to retain in the list.
$t.mergeMathListsboolean. Whether nested math lists are merged into the parent list.
$t.numComponentsnumber. The number of items in the math list.
$t.numValuesnumber. The number of math expressions in the list.
$t.parseScientificNotationboolean. Whether to parse expressions like 1e3 as scientific notation.
$t.splitSymbolsboolean. Whether multi-character symbols are split into a product of variables.
$t.unorderedboolean. Whether the order of items in this list should be treated as unordered (e.g. for matching).
Common to all components (3)
$t.doenetMLtext. The DoenetML source code that produced this component.
$t.hideboolean. Whether to hide this component from the rendered output.
$t.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: Defining a <tupleList> and retrieving a tuple
Each parenthesized group becomes one math tuple. Spaces between the groups
separate the items; the commas inside each (...) are part of one tuple.
Individual tuples are accessed by index.
Example: A <tupleList> of 3-tuples
Tuples may have any number of components. Each tuple is itself a math expression and its components can be indexed individually.
Example: Mixed-arity items
The items in a <tupleList> do not need to share the same arity or
the same content type.
Attribute Examples
Attribute Example: unordered
The unordered attribute makes comparisons (e.g., inside a <boolean>
or an <award>) ignore the order of the items.
Attribute Example: maxNumber
The maxNumber attribute limits the number of tuples retained in the list,
regardless of how many are supplied.
Comparison with <mathList>
The difference between <tupleList> and <mathList> is in how
the children are parsed:
<mathList>x y z</mathList>→ a list of 3 maths (x,y,z). Commas inside the body would create a single tuple math instead.<tupleList>(1, 2) (3, 4)</tupleList>→ a list of 2 tuples ((1,2),(3,4)). Non-parenthesized text is not accepted as an item.
Use <tupleList> when every item must be a tuple — for example, a
list of coordinate pairs that should not specifically be a list of
<point> or <interval> components.