Referenceshuffle

<shuffle>

Randomly shuffles its children

<shuffle> is a Math Operator component that re-orders a list of referenced components and creates document variants based on the different possible orders.

Attributes and Properties

Attributes for <shuffle>

Other (2)
asList

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

type

text. Component type to shuffle children as.

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 <shuffle name="s">

Common to all components (4)
$s.doenetML

text. The DoenetML source code that produced this component.

$s.hide

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

$s.isResponse

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

$s.styleNumber

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

Examples

Example: Shuffle a list of numbers

Four <number> components are defined and then re-ordered (which in turn creates document variants) using the <shuffle> component.

Select a new page variant from the pulldown menu at the top of the editor to see different variants of the document.


Example: Shuffle an ordered list

Four <li> (list item) components are defined within an <ol> (ordered list) and then re-ordered using the <shuffle> component.

Select a new page variant from the pulldown menu at the top of the editor to see different variants of the document.


Example: Shuffle a <textList>

A named <textList> is defined, then re-ordered using the <shuffle> component.

Select a new page variant from the pulldown menu at the top of the editor to see different variants of the document.


Example: Shuffle rows in a <tabular>

The individual <row> components within a <table> can be re-ordered using the <shuffle> component.

Select a new page variant from the pulldown menu at the top of the editor to see different variants of the document.