ReferencebooleanList

<booleanList>

A list of booleans

<booleanList> is a Logic component that stores multiple <boolean> components within a list.

When creating a <booleanList>, separate items by spaces, not commas. The component will default to displaying the list with commas.

Attributes and Properties

Attributes for <booleanList>

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 in this list should be treated as unordered (e.g. for matching).

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 <booleanList name="b">

Other (4)
$b.maxNumber

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

number. The number of items in the boolean list.

number. The number of booleans in the list.

$b.unordered

boolean. Whether the order of items in this list should be treated as unordered (e.g. for matching).

Common to all components (3)
$b.doenetML

text. The DoenetML source code that produced this component.

$b.hide

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

$b.styleNumber

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

Examples

Example: Accessing an item in a <booleanList>

Individual <boolean> components are listed directly between the opening and closing <booleanList> tags, with spaces (not commas) to separate list items.

The individual list items can be accessed with the index of the desired item.


Example: <booleanList> from user-input

The user is prompted to provide three agree/disagree type responses with the <booleanInput/> component. These are gathered into a <booleanList>.

Attribute Examples

Attribute Example: unordered

The unordered attribute is specified in order to make comparisons between boolean lists without regard to order. The <booleanList> component is ordered by default.


Attribute Example: maxNumber

Use the maxNumber attribute to limit the number of boolean values rendered by the <booleanList>.

Property Examples

Property Example: numComponents

The numComponents property renders the number of boolean values stored in the list.


Property Example: numValues

The numValues property is an alias for numComponents: it also renders the number of boolean values stored in the list (respecting the maxNumber cap, if set).