#### Howdy, Stranger!

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

Supported by

# [open] Present multiple different trials within a block

edited March 2013

As a relatively unexperienced OpenSesame user, I am running into this problem while designing my experiment:

I know how to present the same item/block of trials repeatedly in a loop, but I want to present different items/block of trials mixed in one loop (in random order). Does anyone know whether this is possible and if so, how to do this?

Thanks!

• edited 7:04AM

Hi Martine,

I'm not sure I understand your question. Do you want to have a single block_loop, which can run a number of different trial sequences?

If so, you could create a number of different trial sequences, say `trial_sequence1`, and `trial_sequence2` and insert these in turn into a "meta sequence". Then you decide using "run if" statements which of the trial sequences should actually be executed. Schematically, this would look like this (assuming that there is a variable `trial_type` that is used to specify which trial sequence should be executed):

``````block_loop
meta_sequence
trial_sequence1 (run if: "[trial_type] = 1")
trial_sequence2 (run if: "[trial_type] = 2")
``````

Cheers,
Sebastiaan

There's much bigger issues in the world, I know. But I first have to take care of the world I know.
cogsci.nl/smathot

• edited 7:04AM

Hi Sebastiaan,

Thanks for your comment! We indeed want to run a number of different trial sequences within one block_loop. In specific, we want to run 2 different trial_sequences in random order (each 5 times), counterbalanced between participants.

For example, for some participants 1, 1, 2, 1, 2, 2, 2, 1, 2, 1; for other participants 2, 1, 1, 2, 1, 2, 2, 2, 1, 1; and so on...

I am not sure whether the 'run_if' statement is appropriate for this question?

I hope you understand my problem and that you can help!

• edited 7:04AM

Hi Sebastiaan,

Although we have not found an answer to the previous question yet, we are running into another problem.

We will try to explain our design and our problem.
We want to present a fixation point that consists of rapidly changing letterstrings (e.g. "HJAKSNZKA"). After 6-8 seconds, we present a sound, which indicates that participants have to press the spacebar. After they have pressed the spacebar, the letterstring disappears and a picture is presented on the screen. After the presentation of this picture (approximately 2000ms), the same trial has to start again AUTOMATICALLY, beginning with the random letterstrings.
In addition, the letterstring should ONLY disappear and be followed by a picture when the participant presses the spacebar. In other words, the letterstring should continue indefinitely until a response (spacebar) is given.

So far, we are able to run this trial one time, however, our problem is that we are not able to let the sequence start again automatically. The strange thing is that the sound part does start over, but the letterstring does not. So now, the picture remains on the screen while the participant keeps hearing the sound every few seconds.

We do not understand why the sound does start over, but the letterstring does not.

Our experiment looks like this:

We hope this explains our problem clear enough for you to understand and help us out. If you need more information, please let us know.

Martine

• edited 7:04AM

Hi Martine,

For example, for some participants 1, 1, 2, 1, 2, 2, 2, 1, 2, 1; for other participants 2, 1, 1, 2, 1, 2, 2, 2, 1, 1; and so on...

Right, then I understood correctly. Perhaps you can first try my suggestion (which should do exactly this!) and if you get stuck please post what you have and we take it from there.

So far, we are able to run this trial one time, however, our problem is that we are not able to let the sequence start again automatically. The strange thing is that the sound part does start over, but the letterstring does not. So now, the picture remains on the screen while the participant keeps hearing the sound every few seconds.

Could you perhaps post the script for this experiment (for example to http://www.pastebin.com)?

Cheers,
Sebastiaan

There's much bigger issues in the world, I know. But I first have to take care of the world I know.
cogsci.nl/smathot

• edited 7:04AM

Hi Sebastiaan,

This is the script for the letterstring experiment:
http://pastebin.com/ANfxwcpQ

I posted the complete script, we hope it makes any sense to you, since we are pretty unexperienced with using Open Sesame.

Thanks again!

• edited 7:04AM

Hi Martine,

Interesting structure! There are few things here. The first is that you use a `[correct] = 1` break-if statement. This makes sense, but it does require that `correct` is set back to 0 before you start the trial sequence again. Otherwise the loop will break immediately on the second run, and you will never see visual stimuli on the second trial. To do this, simply add an inline_script to the top of sequence_trial with the following code in the run phase:

``````exp.set('correct', 0)
``````

The second problem is that both 'parts', which run in parallel, present things on the screen and get in each others way. Doing things in parallel is awkward at the best of times, but if there is overlapping functionality things become really messy. Luckily it's not necessary in your case, because the empty_space sketchpad can simply come after the letterstring_part loop. In that case, all the display presentation stuff is handled by the letterstring_sequence, as you can see in the screenshot below.

A structure like this works for me:

However, I'm not sure whether this situation is best dealt with using the GUI, even though it's possible. It's quite complex and requires an unwieldy structure of loops and sequences. If you intend to develop more of these types of experiments, it might be worthwhile to invest some time in learning Python. With inline scripting this situation could be dealt with much more gracefully.

Hope this helps!

Cheers,
Sebastiaan

There's much bigger issues in the world, I know. But I first have to take care of the world I know.
cogsci.nl/smathot

• edited 7:04AM

Thanks a lot Sebastiaan, this really helps us a lot!