OS (e.g. Win10): OS 10.12.2
PsychoPy version (e.g. 1.84.x): 1.84.2
What are you trying to achieve?: I am trying to show one of two images based up whether or not a participant presses a button. So if they press any of 1-5 then they should see an image of coins right after, or if they don’t press any button they see an image with empty circles.
What did you try to make it work?: I have been trying to use a code component after the key response component. In the code component I have tried to have an if statement such as
if TwoGoGo1AllResponses.keys=='1' or TwoGoGo1AllResponses.keys=='2' or TwoGoGo1AllResponses.keys=='3' or TwoGoGo1AllResponses.keys=='4' or TwoGoGo1AllResponses.keys=='5': thisGo1Feedback = 'habitstimuli/penny.png' else: thisGo1Feedback = 'habitstimuli/emptycircle.png'
What specifically went wrong when you tried that?: There is no error message but when I push the 1 button during the task for example, it does not show the penny image. It only shows the empty circle image regardless of what I press. I cannot figure out how to make an if statement that actually reads in what the button push was and then chooses the penny image when applicable.
Include pasted full error message if possible. “That didn’t work” is not enough information.