<numberList>
<numberList> defines a list of numbers, each like a <number>. Some
components that accept a <numberList> as an input include <function>, <repeat>,
and <award>.
When creating a <numberList>, separate items by spaces, not commas.
The component will default to displaying the list with commas.
Attributes and Properties
Attributes for <numberList>
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 (2)
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 <numberList name="n">
Number display (5)
$n.avoidScientificNotationIn developmentboolean. Whether to render numbers in full decimal form rather than scientific notation.
$n.displayDecimalsIn developmentinteger. Number of decimal places to display when rendering this number.
$n.displayDigitsIn developmentinteger. Number of significant digits to display when rendering this number.
$n.displaySmallAsZeroIn developmentnumber. Threshold below which numbers are displayed as zero.
$n.padZerosIn developmentboolean. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.
Other (4)
$n.maxNumbernumber. Maximum number of items to retain in the list.
number. The number of items in the list.
$n.numValuesnumber. The number of values in the list.
$n.unorderedboolean. Whether the order of items in this list should be treated as unordered (e.g. for matching).
Common to all components (8)
$n.disabledIn developmentboolean. Whether this component is disabled and cannot be interacted with.
$n.doenetMLtext. The DoenetML source code that produced this component.
$n.fixedIn developmentboolean. Whether this component's value is fixed and cannot be modified.
$n.fixLocationIn developmentboolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).
$n.hideboolean. Whether to hide this component from the rendered output.
$n.isResponseIn developmentboolean. Whether this component is treated as a response for the purposes of assessment.
$n.styleNumberinteger. The style number used to select this component's visual styling from the available style definitions.
Examples
Example: Defining a <numberList> and retrieving a value
The <numberList> component stores a list of numbers.
Array notation can be used to access an individual element in the list.
Example: A <numberList> from multiple <mathInput/> components
Combining a number of user-inputs into a <numberList> can be achieved by
referencing the named component between the opening and closing tags, separated by spaces.
Example: A <numberList> for function evaluation
Here, a <numberList> stores multiple input values to be used in the subsequent code for function evaluation.
Attribute Examples
Attribute Example: unordered
If a <numberList> is defined with the unordered attribute,
comparisons (for validation in an <award> or a <boolean> for example) are unordered automatically.
Attribute Example: maxNumber
The maxNumber attribute imposes a limit on the number of numbers that can be stored in the list.
Property Examples
Property Example: numComponents
The numComponents property returns the number of elements stored in a <numberList>.