Adjusting the timing of stimuli and trials

Adjusting the time between trials (inter trial intervals)

If you want to introduce a delay between the end of one trial and the beginning of the next, modify the "delay" property of the relevant trial_template with the desired number of seconds.

"delayed_trials": {
      "type": "basic",
      "stimuli": ["s1", "s2", "s3", "s4"],
      "responses": ["r1"],
      "delay": 2
     }

Making a stimulus disappear before the end of a trial

By default, stimuli remain on the screen until the end of a trial. To make a stimulus disappear before the end of a trial, adjust the "duration" property of your stimulus. This is particularly useful if you don’t want your stimulus to remain on the screen during the presentation of responses.

"timed_stimulus": {
      "type": "text",
      "content": "Read me quickly; I'm about to disappear!",
      "duration": 3
     }

Creating trials that proceed automatically

If you want to limit the duration of a trial with responses (perhaps to implement speed-accuracy trade off or for trials that don’t require responses), use the "duration" property for the relevant training_template. This is the number of seconds (fractions supported) to wait before automatically proceeding to the next trial.

"timed_trial": {
      "type": "basic",
      "stimuli": ["S1", "S2"],
      "responses": ["R1"],
      "duration": 3,
      "delay": 1,
      "countdown_visible": false // change this to true to display a countdown for participants
     }

Make sure that the delay property of your response is set properly so that participants will have a chance to respond before the specified trial duration is up!

To display a countdown for the particpants, include "countdown_visible":true in your trial_template dictionary.

Presenting multiple stimuli at different times

To present multiple stimuli in sequence on a single trial, utilize the delay and duration properties for your stimulus. Note that the delay property is relative to the beginning of a trial.

For example, the following code displays a fixation cross for 1 second followed immediately by a text stimulus for 2 seconds.

"stimuli": {
    "fixation_cross": {
        "type": "text",
        "content": "+",
        "alignment": "center",
        "duration": 1,
        "size": "24px"
    },
    "text_stimulus": {
        "type": "text",
        "content": "muffin",
        "alignment": "center",
        "duration": 2,
        "delay": 1
    }
},

"trial_templates":{
    "sequential_stimuli_trial"{
        "type": "basic",
        "stimuli": [{"which": ["fixation_cross", "text_stimulus"], "location": [5,5]}],
        "responses": ["r1"],
    }
}

Remember that the multiple stimuli you want displayed on a single trial should be placed in a nested list in your trial_template. Also note that in this example, since we want the text stimulus to appear at the same location as the fixation cross had occupied, we use the more elaborated syntax when specifying "stimuli".