At the heart of the conditional branching feature in SuperLab are expressions.
An expression
consists of one or more Boolean comparisons where a left hand side (LHS)
is compared to a right hand side (RHS); example:
The result of a comparison is always true (1) or false (0). At
present, the LHS consists of a few SuperLab-provided variables and the
RHS is always a constant value.
The following variables are available for building comparisons:
Time Since Start of Block: This time is reset every time the block is started or repeated.
Time Since Start of Experiment
Trials Presented in This Block: A "function" must be used with this variable. Three are available: Number of, Percentage of, and Average Reaction Time of. The functions operate only on the trials presented within the current block. The range of trials that the functions should operate on can be further filtered by specifying a subset. The number of trials presented in a block is cumulative, e.g. if you present 10 trials in Block A, exit Block A to present the trials in another block, and then go back to Block A, the number of trials presented in Block A is not reset -- it will still be 10.
To specify a subset, click on the Subset
button. The
following dialog appears:
You can set the maximum number of trials to include in the subset, the
trials that have a specific code value set, or both. In
the screen snapshot above, SuperLab will look only at the last response
to see if it’s correct. This
allows the experimenter to do more than what the built-in feedback options
provide.
Another example using subsets is in learning experiments. During the learning phase of an experiment, it is common to keep repeating trials until the average reaction time drops below a certain threshold. But often, an experimenter wants to use a moving average rather than the average of all the trials in the block. Using a subset would help in looking at moving averages.
The following example shows an expression containing three comparisons:
SuperLab automatically uses the “and” operator but this is easily changed
to “or” simply by clicking on it:
SuperLab imposes no limits on how many comparisons an expression can have.