Loop items

In an experiment you will generally want to repeat the same type of trial while manipulating a number of independent variables. For example, you may present a cue followed by a target stimulus, while varying the interval between the cue and the target. This is where the loop item comes in.

The loop item is always attached to another item, the item to run. This is the item that is called by the loop item. This can, for example, be a sequence corresponding to a trial.

In the loop item you can specify variables, which are displayed as columns in the table. You can add and remove variables using the add variable and remove variable buttons. The rows in the table correspond to cycles, i.e. to one time that the item to run is called. You can specify the number of cycles by entering a number in the cycles input field.

The repeat option corresponds to the number of times that all cycles should be executed. You can set this to a non-integer value. For example, by setting repeat to 0.5, half of all cycles will be executed.

The order option indicates whether the cycles should be executed sequentially or in random order. Randomization is complete, that is, all the complete list of [number of cycles] x [repeat] trials is randomized.

Using functions

Most of the time you will enter static values into the loop table. For example, you may have a variable called 'cue', which is either 'right' or 'left'. However, you can also use functions instead of static values. This is handled, similarly as in most spreadsheets, by prepending an '=' character. For example, to draw a random number between 0 and 100, you can enter the following into a cell in the loop table:

=randint(0,100)

More generally,you can enter any valid Python statement after the '=' sign. An overview of of useful functions can be found in the Python documentation:

Convenient ways of creating a large loop table

If you have multiple variables, each with multiple levels, it is a daunting task to manually create the entire loop table.

In this case you may want to use the variable wizard, which can be started by clicking on the variable wizard button at the top right of the table. In the variable wizard you can specify your variables and the levels of your variables. OpenSesame will automatically fill the loop table with all possible combinations.

You can also prepare your loop variables in your favorite spreadsheet (e.g., OpenOffice Calc or Microsoft Excel) and paste it into the loop table.

Fore more information, visit the website <http://osdoc.cogsci.nl/usage/about-sequences-and-loops>.