Step terminating conditions

BITTSy allows you to specify under what conditions to end one STEP and move on to the next one. These step terminating conditions are used to control the experiment flow from step to step within your protocol.

Note that the UNTIL statements that function as step terminating conditions are formatted identically to loop terminating conditions (covered in the Loops section), and many of the options overlap - but some conditions are exclusive to terminating steps or terminating loops, respectively!

Basics

STEP 1
Phase Training Start

STEP 2
LIGHT CENTER BLINK 200
UNTIL KEY C

Sometimes you don't need to wait for any particular condition to be met before moving on to the next step. When a step has no terminating condition, execution proceeds to the next step immediately (STEP 1 to STEP 2 in the example above).

When you want your experiment to wait for something, that's when you'll use a step terminating condition. These are UNTIL statements, and should be understood as "don't move on to the next step until the following conditions are true."

When a step has terminating conditions, these must be the last lines in that step. Once the specified terminating condition(s) are fulfilled, execution proceeds immediately to the next step. Therefore, the next thing you want to happen should be placed at the start of the step that follows.

STEP 2
LIGHT CENTER BLINK 200
UNTIL KEY C

STEP 3
AUDIO CENTER familiarization ONCE
UNTIL SINGLELOOKAWAY familiarization GREATERTHAN 2000

STEP 4
AUDIO CENTER OFF

Types of terminating conditions

KEY

UNTIL KEY <key>

With a KEY terminating condition, execution waits at the current step until the experimenter presses the specified key. For a protocol using live-coding, these could be used to time the start of steps according to where the experimenter judges that the participant is looking - in this case, you should specify the same keys that you have assigned to sides for live coding. You may also wish to use keypresses to progress the experiment without tying it to participants' looking behavior. In this case, you can use any valid unassigned key.

Valid keys are alphanumeric, plus arrow keys (denoted by the names UP, DOWN, LEFT, and RIGHT). Number and arrow keys correspond to keys on the main keyboard, not the number pad. Letter keys should be capitalized.

UNTIL KEY X
UNTIL KEY L

TIME

UNTIL TIME <time in milliseconds>

This terminating condition allows the step to end after a specified amount of time. The time is counted from the point when the step starts. Remember, time is in milliseconds! (So 20 seconds would be listed as 20000).

UNTIL TIME 25000

FINISHED

UNTIL FINISHED

This terminating condition checks whether all the media files (audio/video) that began to play in the current step have finished playing, and only allows execution to move on to the next step once they have ended.

UNTIL FINISHED should not be used in steps where audio or video action statements make the file play on LOOP rather than ONCE - this will go very badly! See below for an alternative.

Below are two examples of how this could be used in a study with an audio familiarization passage that is presented with an unrelated video to help maintain the participant's attention.

STEP 1
AUDIO CENTER familiarization ONCE
VIDEO CENTER animation ONCE
UNTIL FINISHED

In the above example, the step would only end once both the video and familiarization passage had ended.

STEP 1
VIDEO CENTER animation LOOP

STEP 2
AUDIO CENTER familiarization ONCE
UNTIL FINISHED

STEP 3
VIDEO CENTER OFF

And in this example, STEP 2 would end when the audio file was finished playing, but would not wait for the video file to be finished (and thus instructs for this video to be turned off in the next step).

The first example would be suitable for a study in which the passage and the video were made to be the same length. The second example is better for use where the video file is a different length - either shorter and needing to be played on LOOP , or longer and can be played ONCE, but it is not necessary to wait for it to play all the way to the end before going to the next step.

Looking-based conditions

Often you may want BITTSy to wait until the child does something - either the child has looked at something for a sufficient length of time, or has looked but then looked away for a certain length of time, etc. There are four basic types of looking behavior that can serve as a trigger: a single look of a particular length, a total amount of (cumulative) looking of a particular amount, a single look away of a particular length, or a total amount of time spent looking away. These are done with the keywords SINGLELOOK, SINGLELOOKAWAY, TOTALLOOK, and TOTALLOOKAWAY.

For all of these, you must also specify a tag - it must be clear what the child should be looking toward or away in order to be tracked for these terminating conditions.

SINGLELOOK

UNTIL SINGLELOOK <tag> GREATERTHAN <time in milliseconds>

This terminating condition is met whenever the experimenter records via keypress a single look in the direction where the given tag is being presented that exceeds the given time in milliseconds. The look must end (the experimenter presses a key that indicates a different direction, or the tag is no longer actively being presented) before the step will end and the next begin - the step is not cut off as soon as the threshold is met.

The tag given in this terminating condition can be of any type (denoting a particular file, a group, or a dynamic tag).

STEP 1
LET trialaudio = (TAKE trialaudiolist RANDOM)
AUDIO LEFT trialaudio ONCE
UNTIL SINGLELOOK trialaudio GREATERTHAN 5000

In this case, the terminating condition would be waiting for a look to be recorded by the experimenter that was to the left (as defined by the key assignments in the protocol), where the dynamic tag trialaudio is being presented, that lasts for at least 5 seconds before the experimenter indicates the participant has looked in another direction (by pressing a key that has not been assigned to LEFT).

SINGLELOOKAWAY

UNTIL SINGLELOOKAWAY <tag> GREATERTHAN <time in milliseconds>

This terminating condition is met whenever the experimenter records via keypress a single look in a direction where the given tag is NOT being presented that exceeds the given time in milliseconds. The look away does not have to switch to a new direction before the terminating condition is met; it will be cut off at the specified time.

Importantly, BITTSy's timer on looks starts when the tag begins to be active/displayed, so if the participant starts in a state of looking away from the tag, they could meet this terminating condition without ever having a look that was in the direction of the tag. If you would like to require this (a look but then a look away), you should set up the preceding step such that they must start in the correct direction (as is typically the case in HPP studies).

STEP 1
LIGHT LEFT BLINK 200
UNTIL KEY L

STEP 2
AUDIO LEFT training ONCE
UNTIL SINGLELOOKAWAY training GREATERTHAN 2000

In the case above, where the key L is assigned to LEFT, the left light would blink until it got the participant's attention and the experimenter indicated they had turned to the left. Then, the audio would begin playing. Because the step could only start when the participant is looking left, there must be a change in their looking (that lasts for at least 2 seconds without looking back to the left) before the step can end.

"Away" in this case is defined as any direction that is not the direction where the tag is being presented, not solely AWAY. That is, if the tag is being presented LEFT, SINGLELOOKAWAY could be satisfied by a look started by pressing any key other than the one assigned to LEFT, whether it denotes another side, AWAY, or is completely unassigned. BITTSy assumes that anything that isn't LEFT is away from LEFT!

TOTALLOOK

UNTIL TOTALLOOK <tag> GREATERTHAN <time in milliseconds>

This terminating condition is met whenever the participant accumulates the specified amount of time looking in the direction of the given tag during the current step.

STEP 1
AUDIO LEFT passage LOOP
UNTIL TOTALLOOK passage GREATERTHAN 20000

STEP 2
AUDIO LEFT OFF

In the above example, the step continues (and the audio continues to loop) until the participant looks towards it for a total of at least 20 seconds. This could occur with a single look that lasts longer than 20 seconds, or could accumulate across any number of shorter looks until the total reaches this threshold. Each look in the given direction must end (the experimenter presses a key that is not assigned to that direction) before being added to the running total and checked for whether it exceeds the threshold; the step will not end while the participant is still looking toward the given tag.

TOTALLLOOKAWAY

UNTIL TOTALLOOKAWAY <tag> GREATERTHAN <time in milliseconds>

This terminating condition is met whenever the participant accumulates the specified amount of time looking away from the direction of the given tag during the current step.

STEP 1
AUDIO LEFT passage LOOP
UNTIL TOTALLOOKAWAY passage GREATERTHAN 10000

STEP 2
AUDIO LEFT OFF

As covered above for SINGLELOOKAWAY, any keypress that is not associated with the side the tag is being presented on is treated as "away" from that tag.

Using multiple terminating conditions

OR combinations

For steps that can end one of two ways, the step terminating conditions should be listed on two separate lines, one after the other.

STEP 1
AUDIO CENTER passage ONCE
UNTIL FINISHED
UNTIL SINGLELOOKAWAY passage GREATERTHAN 2000

In the example above, the step ends when either the audio file runs out OR the participant looks away from that direction for at least two seconds - whichever happens first.

Terminating conditions are checked sequentially. If there is one that is "held up" and cannot currently be evaluated, this prevents any of the others from being checked in the interim. In particular, SINGLELOOK and TOTALLOOK cannot be evaluated while a look to that stimulus is still in progress. Another terminating condition can be met while the look is still in progress, but it cannot be checked until later, which means that the in-progress look cannot be cut off by ending a step via an alternate terminating condition.

AND combinations

For steps must meet multiple conditions before ending, the terminating conditions get put on one line and are joined by "and".

UNTIL TIME 25000 and KEY X

In the above example, the step would have to last for at least 25 seconds and the experimenter would have had to press a key, either anytime before the 25-second mark (in which case the step would end at 25 seconds), or after the 25 seconds have elapsed (in which case it would continue for however long until the key was pressed). A condition like this would ensure that a minimum time is always met, but allow an experimenter to draw out the step for longer until a particular cue comes (e.g. when waiting for a certain behavior).

Complex combinations

You can use both of the above combination types on the same step, for even more nuanced end conditions for steps.

UNTIL <condition 1> and <condition 2> ... and <condition N>
UNTIL <condition A>
UNTIL <condition B>
...
UNTIL TIME 5000 and KEY X
UNTIL TIME 25000

In the above example, the step must last at least 5 seconds and a maximum of 25 seconds. If the experimenter presses the indicated key anytime before the maximum time, the step can end immediately when the first condition is satisfied; otherwise, it ends when the second condition, reaching 25 seconds, is met. A combination of conditions like this ensures minimum and maximum times for the step, but allows the experimenter to indicate whether the step should end earlier than the maximum time.

Last updated