Skip to content

Stimulus Block

The stimulus block provides the ability to present the participant with a certain type of stimulus. This can either be done via text or media (audio/image/video), encapsulated in a stimulus block. The structure of this block is summarised below.

Parameters

max_duration

Optional.
Integer that indicates the number of milliseconds after which the stimulus is hidden. Alternatively, if playable media (audio or video) is specified, this element may be defined as Keyword MEDIA to hide the stimulus after the media finished playing.

Example: max_duration = 10000 or max_duration = MEDIA.

If the max_duration of a stimulus is larger than the max_duration of the trial it is part of, this parameter has no effect.

Members

Tip

Use the shorthands below instead of a block members, if you do not need the extra parameters of the block.

text
Optional.
text block that presents a simple text stimulus to the participant.
media
Optional.
media block that presents a media stimulus to the participant (audio/image/video).
link
Optional.
link block that presents a link stimulus to the participant.

Shorthands

text
String that specifies a text stimulus with the text set to the provided String.
image
String that specifies a media stimulus with an image stimulus set to the provided String.
audio
String that specifies a media stimulus with an audio stimulus set to the provided String.
video
String that specifies a media stimulus with a video stimulus set to the provided String.

Example usage

The code below illustrates how a stimulus block might be used.

experiment { 
    trial {
        stimulus { 
            text = "In the next trials, a word will briefly appear.\n\
Press the left arrowkey if the word contains at most one vowel\n\
and the right arrowkey if the word contains more than one vowel.\n\n\
For each trial, answer within 3 seconds." //(1)
        } 
        response {
            button
        }
    }

    trial {
        max_duration = 3000 //(2)

        stimulus {
            max_duration = 500
            image = "sample_image.png"
        } 
        response {
            keyboard = [ARROW_LEFT, ARROW_RIGHT]
        }
    }
}
  1. Confused? See Preliminaries for a refresher on how linebreaks work.
  2. Take care! Both trial and stimulus have a max_duration parameter with a different effect.
Back to top