Counterbalancing response keys

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): v2020.1.3
Standard Standalone? (y/n) Y
What are you trying to achieve?: Balancing response keys across participants so half of participants respond ‘yes’ with ‘z’ and ‘no’ with ‘m’ and the other half respond ‘no’ with ‘z’ and ‘yes’ with ‘m’

I’m working with a task that involves sentences being presented to participants, followed by a comprehension question occurring after roughly 50% of those sentences. Currently, participants are asked to respond ‘yes’ to these questions with the Z key and ‘no’ with the M key. However, I want to balance these response options so half of participants answer ‘yes’ with the M key and ‘no’ with Z.

I’ve scoured these forums but I didn’t come across any clear answers. If you need any further information I’d be happy to provide, thanks for your help in advance! Below are some screens from my current experiment and data file.

Comp Q response options:

Data file correct Answer structure:

The way I do this is by having an array for response keys, e.g.

responseKeys=[['s','the S key'],['k','the K key']]

I then shuffle responseKeys and use responseKeys[primAns][0] for the correct answer and responseKeys[0][1] and responseKeys[1][1] in the instructions. You could then have 0 and 1 in your primAns column.

1 Like