[solved] nested A.B.B.A structure
Hi
I have an experiment with two task (A,B)
in every task I have 120 unique trails (every one is different from the others)
I already have two lists with 120 rows inside.
in my experiment I want to run 60 trails from task A, 120 trails from task B (two 60 trail blocks) and than again 60
from task A.
2 important point:
- I want counter balance the tasks between subj (ABBA, BAAB)
- I want the exp to "remember" which trail I used and to run every trail and all off the trails once
how can I do that?
thenx
Dror

Comments
Hi Dror,
This is an interesting question. What I would do first is add a column with a unique identifier for each trial. For example, a variable named
trialidthat identifies the block (AorB) and the trial number (instead ofdigityou would have your own conditions, of course):The next step would be to keep track of which trial is presented, by adding the
trialidto a list at the end of each trial_sequence. You can do this with a simpleinline_script(in the run phase):Of course, you also need to initialize
self.experiment.trials_doneat the start of the experiment, again with a simpleinline_script:Now you can use a run-if statement in your trial_sequence to skip all trials that have already been presented, by adding the following run-if statement to all items the trial_sequence". (Note that this a Python-style run-if statement).
Now we're getting somewhere!
Of course, the first time that the block_loop is executed, we want to present only half the trials (60 of 120 in your case), so we set 'repeat' to 0.5. However, the second time that the block_loop is executed we want to present all trials, and use the run-if statement described above to skip the trials that were already presented (so effectively presenting the other half of the trials). We can do this by changing the
repeatsetting of the block_loop programmatically, after the block_loop has been executed for the first time:This is basically it. Now you have a block_loop that runs 50% of the trials on the first execution, and the other 50% on the second execution! It may seem like a lot to take in, but if you first implement the steps above in a simple dummy experiment, you will see the logic of it.
For detailed information about counterbalancing, see this page:
Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
hi
I find your solution very flexible and much simpler then what I used
thanx - I will use it!
but one thing I did not understood, how do you control which block type a\b will be presented? are they in a same list or different one?
Dror
Hi Dror,
I would treat blocks A and B as different block loops (
block_loop_Aandblock_loop_B), so your experiment would go like this for some participants:And like this for others:
So you basically perform the trick I described above separately for
block_loop_Aandblock_loop_B.Cheers,
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!