Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] Limiting the duration of part of the experiment

edited November 2014 in OpenSesame

Hello. In my experiment, subjects must do a distraction task for several minutes before starting the actual task that I would like them to do. But I would like to limit the sequence of the distraction task to ten minutes, even if the subjects haven't finished the whole task yet, then the sequence of the real task will begin. I was wondering if you could tell me how I can limit the distraction task to a determined amount of minutes before the real task begins?


  • edited November 2014

    Hi RitaMary,

    You can calculate the duration of every trial before you actually start a block and collect them in a list, until their total duration exceeds the time you want them to do the distractor task. Something like:

    time = 0
    trial_list = []
    while training_duration > time:
            # do something to calculate how long one trial takes
            time += trial_duration

    Next, set the number of repetitions in the variable assistantof a loop item to the number of trials in that list. Alternatively, you can include an inline_script in the beginning of your sequence that will break the loop as soon as the last trial was presented.

    Give it a try. If you get lost have a look on the documentation pages or ask again here.

    Good luck,


Sign In or Register to comment.