ReferencetextList

<textList>

A list of texts

The <textList> is a Text component that stores multiple <text> components within a list.

When creating a <textList>, separate items by spaces, not commas. The component will default to displaying the list with commas. (A comma inside a <textList> is treated as part of the text itself, just as it would be inside a <text>.)

Attributes and Properties

Attributes for <textList>

Other (3)
asList

boolean. Default value: true. Whether to render the items separated by commas (true) or with no separator (false).

number. Default value: Infinity. Maximum number of items to retain in the list.

boolean. Default value: false. Whether the order of items should be treated as unordered.

Common to all components (9)
copy

reference. Create an independent copy of another component by reference. Enter a references a $name.

disabled

boolean. Default value: false. Whether this component is disabled and cannot be interacted with.

extend

reference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.

fixed

Default value: false. Whether this component's value is fixed and cannot be modified.

fixLocation

boolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

hide

boolean. Default value: false. Whether to hide this component from the rendered output.

isResponse

Whether this component is treated as a response for the purposes of assessment.

name

text. The name used to reference this component from elsewhere in the document.

styleNumber

integer. Default value: 1. The style number used to select this component's visual styling from the available style definitions.

Properties for <textList name="t">

Other (4)
$t.maxNumber

number. Maximum number of items to retain in the list.

$t.numComponents

number. The number of items in the text list.

$t.numValues

number. The number of text values in the list.

$t.unordered

boolean. Whether the order of items should be treated as unordered.

Common to all components (3)
$t.doenetML

text. The DoenetML source code that produced this component.

$t.hide

boolean. Whether to hide this component from the rendered output.

$t.styleNumber

integer. The style number used to select this component's visual styling from the available style definitions.

Examples

Example: <textList> with direct input

In the sample code above, the individual <text> components are listed directly between the opening and closing <textList> tags, with spaces (not commas) to separate list items.


Example: <textList> from user-input

The user is prompted to provide three text responses with the <textInput/> component, which are then referenced within the definition of a <textList>. Individual entries in the list can be referenced by index.

Attribute Examples

Attribute Example: unordered

The unordered attribute allows for boolean comparisons between lists, such as in the <award> component or the <boolean> component, without regard to the order in which the names of the fruits have been entered.


Attribute Example: maxNumber

In the sample code above, the maximum number of <text> components displayed is 3, even though there are 5 <text> components listed directly between the opening and closing <textList> tags.