Randomize trial in a sequence and repeat the same sequence two times
Hi, I have a sequence with 4 items. I need to randomize items in the sequence e show the sequence two times. For example, if my trials are "A, B, C, D" I need to randomize them (e.g. B, C, A, D) and then show this sequence two times (B, C, A, D, B, C, A, D).
In OpenSesame I set an experimental loop with 4 cycles in random order. Then, how can I repeat the same sequence two times?
Comments
Hi,
That's an interesting scenario. There are multiple ways to solve it, but here's what I would do. First, in your loop, define your
conditionvariable in terms of other variables:condition0,condition1, etc. Keep a sequential order, and set repeat to 2:Then, before the
loop, insert aninline_scriptin which you define the variablescondition0, etc. such that they correspond to your conditions ('A', 'B', 'C', and 'D) in a random order.Do you see the logic here?
Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastian,
Thanks for your response. I'm not very good in Python, so I'll show you my experiment:
On the left you can see the experimental sequence, then my experimental loop (is that correct?). Then i wrote a inline_script as you told me:
Could you help me in a more specific way?
Thanks a lot
Hi,
What exactly is the problem? Your script and structure seem to be fine. (Maybe you could move your script for the run to the prepare phase of your inline_script). Are there any error messages?
Eduard
The problem is that trials are not randomized. It shows times 25, 35, 45 and 55 and then repeats.
Oh, I see. Well, this is because you do randomize only your condition variable but not the durations of the conditions. They are hardcoded.
You can try coding all your variables in a similar way:
Alternatively, you have to add another inline_script to the trial sequence and in that one set variables depending on the condition you are in.
Does that make sense?
Eduard