<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>
Highlighted (1)
asListboolean. Default value: true. Whether to render the items separated by commas (true) or with no separator (false).
Number display (5)
avoidScientificNotationAdded in 0.7.16boolean. Default value: false. Whether to render numbers in full decimal form rather than scientific notation.
displayDecimalsinteger. Default value: 2. Number of decimal places to display when rendering this number.
displayDigitsinteger. Default value: 3. Number of significant digits to display when rendering this number.
displaySmallAsZeronumber. Default value: 1e-14. Threshold below which numbers are displayed as zero.
padZerosboolean. Default value: false. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
Other (7)
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.
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.
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.
isResponseboolean. Default value: false. Whether 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">
Number display (5)
$t.avoidScientificNotationIn developmentboolean. Whether to render numbers in full decimal form rather than scientific notation.
$t.displayDecimalsIn developmentinteger. Number of decimal places to display when rendering this number.
$t.displayDigitsIn developmentinteger. Number of significant digits to display when rendering this number.
$t.displaySmallAsZeroIn developmentnumber. Threshold below which numbers are displayed as zero.
$t.padZerosIn developmentboolean. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
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 list.
$t.numValuesnumber. The number of values 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 (8)
$t.disabledIn developmentboolean. Whether this component is disabled and cannot be interacted with.
$t.doenetMLtext. The DoenetML source code that produced this component.
$t.fixedIn developmentboolean. Whether this component's value is fixed and cannot be modified.
$t.fixLocationIn developmentboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$t.hideboolean. Whether to hide this component from the rendered output.
$t.isResponseIn developmentboolean. Whether this component is treated as a response for the purposes of assessment.
$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.