OS (MACO):
Do you want it to also run online? no
What are you trying to achieve?: I need to set the counterbalance routine based on the participant number. I am doing a visual word eyetracking paradigm and, at the beginning of the experiment, I need to assign my participants to counterbalance A (if participant number is even) or B (if participant number is ODD)
What did you try to make it work?: I created a condition spreadsheet (with a coulumn “group” and a column “cap” ) separated from the stimuli spreadsheet, and I changed the loop settings adding $np.where(counterbalance.group == group)[0].tolist() to select rows
What specifically went wrong when you tried that?:
row[‘remaining’] = data[str(row[‘group’])] KeyError: ‘A’
Hello @Giorgia_Sironi
Do you want to use the counterbalance-feature from the shelf? Given that you plan to run a visual world experiment with an eye-tracker I assume that your experiment will run locally and not online.
Your approach looks a little bit complicated to me. One spreadsheet for the groups, two woth spreadsheets for the stimuli. You might get away with just one spreadsheet. Put all your stimuli in one spreadsheet. Add some code in a Begin experiment tab of your experiment as in this little example:
start = '0'
end = '0'
if int(expInfo['participant']) % 2 == 0:
start = '0'
end = '8'
else:
start = '8'
end = '16'
useRows = start + ":" + end
```
Then in your loop-specifiation use useRowsin the Selected rowsproperty of your loop.
You can add and save the selected group information in your ifelse-construction. But I might miss something that is relevant for your experiment.
Best wishes Jens
The counterbalance routine is for automatic counterbalancing. If you are setting the participant number manually and want to use that to counterbalance then you don’t need the routine.
(if participant number is random then assigning to group based on odd/even isn’t counterbalancing)
1 Like
That is what I was looking for. Thanks for helping!