ReferencenumberList

<numberList>

<numberList> defines a collection, or list, of <number> components. Some components that accept a <numberList> as an input include <function>, <repeat>, and <award>.

Attributes and Properties

Attributes for <numberList>
AttributeTypeValues
asList = "…""true" "false"
displayDecimals = "…"
displayDigits = "…"
displaySmallAsZero = "…"
maxNumber = "…"number
padZeros = "…"
unordered = "…"boolean"true" "false"
Props for <numberList name="n">
PropertyType
$n.maxNumbernumber
$n.numComponentsnumber
$n.numValuesnumber
$n.unorderedboolean

Example: Defining a <numberList> and retrieving a value

The <numberList> component stores a list of “numbers”, or <number> components. 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 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 Example: numComponents

The numComponents property returns the number of elements stored in a <numberList>.