up Inquisit Language Reference

list element

The list element is a general purpose class for storing and selecting any type of item.

Attributes

<list name>
/ itemProbabilities = (value, value, value, ...]
/ itemProbabilities = [expression; expression; expression; ...]
/ itemProbabilities = distribution

/ items = (number, number, number, number, ...)
/ items = (string, string, string, string, ...)
/ items = (extent, extent, extent, extent, ...)
/ items = (value, value, value, value, ...)
/ items = [expression; expression; expression;...]

/ maxRunSize = integer
/ not = (value, value, value ...)
/ not = [expression; expression; expression]

/ poolSize = integer
/ poolSize = expression

/ replace = boolean
/ selectionMode = selectionmode
/ selectionMode = value

/ selectionRate = rate
/ resetInterval = integer
</list>

Properties

list.name.currentIndex
list.name.currentValue
list.name.itemCount
list.name.itemProbabilities
list.name.items
list.name.maximum
list.name.maxRunSize
list.name.mean
list.name.median
list.name.minimum
list.name.nextIndex
list.name.nextValue
list.name.poolSize
list.name.replace
list.name.selectedCount
list.name.selectionMode
list.name.selectionRate
list.name.standardDeviation
list.name.unselectedCount
list.name.variance
list.name.resetInterval
list.name.name
list.name.typeName

Functions

list.name.appendItem
list.name.clearItems
list.name.indexOf
list.name.insertItem
list.name.item
list.name.removeItem
list.name.reset
list.name.resetSelection
list.name.setItem
list.name.sort

Remarks

The list element is a data structure for storing ordered sets of items, whether they are strings, values, properties, expressions, or compbinations thereof. It also provides simple and powerful methods for retrieving items from the list. Retrieval can be filtered through built-in algorithms for sequential access and random selection with or without replacement according to uniform or normal distributions. Items can also be retrieved according to custom expressions. Items can also be directly accessed by index through properties or functions.

List can be created statically using the items attribute, or dynamically using the appendItem, insertItem, removeItem, and clearItems functions. An ordered list of integers can be quickly be created by setting the poolSize property. The values in the list will be null, but the currentIndex and nextIndex could be used for random selection of integers ranging from 1 to the poolSize.

A list can be used drive stimulus item selection by setting /select = list.listName.nextValue or /select = list.listName.nextIndex on the stimulus.

The list element provides a simpler and more predictable implementation of the functionality provided by the counter element and also introduced new functionality. Although the counter element will continue to function as it has, where possible script developers should the list element instead.

Examples

The following list stores a reverse sequence of numbers, selecting them in sequential order:

<list backwards>
/ items = (5, 4, 3, 2, 1)
/ selectionMode = sequence
</list>

The following randomly selects the name of a president without replacement:

<list presidents>
/ items = ("George Washington", "John Adams", "Thomas Jefferson")
</list>

The following selects a countdown of numbers:

<list countdown>
/ selectionMode = sequence
/ items = (3 2 1)
</list>

The following selects a value of 2 for odd numbered trials and 1 for even numbered trials:

<list evenodd>
/ selectionMode = sequence
/ items = [if ( floor(mod(block.test.currentTrialNumber, 2)) == 0 ) 1 else 2]
</list>

The following creates a list of 200 null values and randomly selects without replacement. All items are replaced after 10 blocks or after all of them have been selected.

<list stimulusTracker>
/ poolSize = 200
/ resetInterval = 10
</list>

<picture targetPics>
/ items = targetItems
/ select = list.stimulusTracker.nextIndex
</picture>

Copyright Millisecond Software, LLC. All rights reserved.