up Inquisit Language Reference

insertItem function

Inserts the item at the specified index.

Member of

<item><html><picture><port><sound><text><video><xid>

Syntax

object.name.insertItem(value, index)

Return Type

none

Parameters

Name Type Description
value value The value for the item.
index integer The index where the item is inserted. The first item in the list is 1.

Remarks

The insertItem function inserts a value into the item list at specified index. When called from a stimulus element, a stimulus item is inserted. This function causes the list size to grow by one.

Examples

The following inserts the first item of a text stimulus:

<trial myTrial>
/ onTrialEnd= [text.myText.insertItem("Hello world!", 1);]
</trial>

The following inserts an item into the middle of the selection pool of a list:

<trial myTrial>
/ onTrialEnd= [list.mylist.insertItem(values.newvalue, list.mylist.itemCount / 2);]
</trial>

Copyright Millisecond Software, LLC. All rights reserved.