Skip to Content
ReferencebooleanList

<booleanList>

A list of booleans

<booleanList> is a Logic component that stores a list of boolean values, each like a <boolean>.

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>

Highlighted (1)
asList

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

Other (2)

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

boolean. 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

boolean. Default value: false. 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 list.

number. The number of values 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 (8)
$b.disabledIn development

boolean. Whether this component is disabled and cannot be interacted with.

$b.doenetML

text. The DoenetML source code that produced this component.

$b.fixedIn development

boolean. Whether this component's value is fixed and cannot be modified.

$b.fixLocationIn development

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

$b.hiddenIn development

boolean. Whether this component is hidden from the rendered output.

$b.hide

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

$b.isResponseIn development

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

$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 values 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).

Last updated on