Hello,
I have been trying to design a simple simon task in psychopy. I took help from an online youtube video.
The link is:
Instead of using X and O, in my experiment I am trying to use red and blue square images. So, I made some changes in the code they wrote. I replaced X and O with red and blue square images. Probably I did some mistake in the syntax, that’s why there is an error showing that the for eg., blue_square.png is not defined.
Could you please check and point out the mistake and tell me the correct way to write it.
Here is the code.
if expInfo['counterbalance'] == '0':
bindings = {'blue_square.png': 'm', 'red_square.png': 'z'}
if thisTrial['condition'] == 'incongruent':
if thisTrial['stim'] == 'blue_square.png':
thisTrial['stim'] = thisTrial['stim']
'red_square.png' = ''
ans = 'm'
elif thisTrial['stim'] == 'red_square.png':
'blue_square.png'= ''
'red_square.png' = thisTrial['stim']
ans = 'z'
elif thisTrial['condition'] == 'congruent':
if thisTrial['stim'] == 'blue_square.png':
'blue_square.png'= ''
'red_square.png'= thisTrial['stim']
ans = 'm'
elif thisTrial['stim'] == 'red_square.png':
'blue_square.png'= thisTrial['stim']
'red_square.png' = ''
ans = 'z'
elif expInfo['counterbalance'] == '1':
bindings = {'red_square.png': 'm', 'blue_square.png': 'z'}
if thisTrial['condition'] == 'incongruent':
if thisTrial['stim'] == 'blue_square.png':
'blue_square.png' = ''
'red_square.png' = thisTrial['stim']
ans = 'z'
elif thisTrial['stim'] == 'red_square.png':
'blue_square.png' = thisTrial['stim']
'red_square.png' = ''
ans = 'm'
elif thisTrial['condition'] == 'congruent':
if thisTrial['stim'] == 'blue_square.png':
'blue_square.png' = thisTrial['stim']
'red_square.png' = ''
ans = 'z'
elif thisTrial['stim'] == 'red_square.png':
'blue_square.png' = ''
'red_square.png' = thisTrial['stim']
ans = 'm'
I hope you can help me.
Thank you