Skip to content

Trial Block

The trial block provides a framework to set up a trial to present to a participant. It offers interaction between stimulus blocks and response blocks. The structure of this block is summarised below.

Parameters

id
Optional, defaults to increasing numbers.
String that determines the trialId column in the results. The default value is increasing numbers throughout the experiment, so e.g. '1' for your first trial and '2' for your second trial. These numbers are automatically prefixed with 'INC-' or 'SPR-' if the trial comes from an include file or selfpacedreading block.
Tip

We recommend you supply this parameter. This parameter can later, during your analysis of results, help identify which trial a result belongs to.

description
Optional.
String that determines the trialDescription column in the results. This can include useful information for later analysis of the results, such as which answer is correct for this trial.
max_duration

Optional.
Integer that indicates the maximum number of milliseconds the experiment waits for an answer before continuing.
The experiment will continue regardless of whether a (required) response has been given by the participant. If no response has been given yet, any response values in the results will also be empty, even if required.
Alternatively, if a sound or video element is specified, this element may be defined as Keyword MEDIA. In this case, the experiment will automatically continue to the next slide when the media finishes playing.

If max_duration is not specified, an appropriate response block, one that is able to continue the trial, needs to be specified in order to be able to continue with the experiment.

Tip

If the trial continues because of its max_duration, this will be reflected in the trigger column in the experiment results. As such, you can distinguish between the participant not providing an optional response (in e.g. a textfield) or running out of time.

pre_delay
Optional.
Integer that indicates the number of milliseconds the trial waits before starting, hiding any display meanwhile.
post_delay
Optional.
Integer that indicates the number of milliseconds the trial waits before ending, hiding any display meanwhile.

Members

stimulus / s
Optional.
stimulus block that can present a stimulus to the participant.
response / r
Optional.
response block that can request a response from the participant.
font
Optional.
font block that specifies the font used for the current block.

Example usage

The code below illustrates how the trial block might be used.

experiment {
    trial {
        id = "intro_exp"
        description = "Introduction to experiment"

        post_delay = 3000

        stimulus {
            text = "Welcome to this experiment"
        }
        response {
            button = "Start"
        }
    }
}
Back to top