MouseClick correct answer output

Hi,

I’m asking participants to click left on the mouse if they want to take one action or right click if they wish to take another. My issue is that even though the excel file I’m using specifies the correct answer, my output excel file isn’t saving whether or not the participants made the correct response, just what button they clicked.

I’ve added my conditions file and mouseclicking script below.

Any help would be much appreciated.

Thanks,

PictureTest.psyexp (7.6 KB)
Real_TrialsMC.xlsx (8.6 KB)

Hi,

I am not sure I understand your question because in the beginning you say [quote]
click left on the mouse if they want to take one action or right click if they wish to take another.
[/quote]

and then later on [quote]
My issue is that even though the excel file I’m using specifies the correct answer, my output excel file isn’t saving whether or not the participants made the correct response
[/quote]

I will assume that what you are asking is that the correct response for some pictures is the left click and for others the right click. If this is the case, I would add two columns in the excel file one showing the correct responses for left click (and the incorrect too) and one for the correct responses for the right click (and for incorrect too) - see attachment.

Then in psychopy I would add a snipet of code within the code component → end of routine tab such as:

if mouse.leftButton[0]== corrRespL and mouse.rightButton[0] == corrRespR:

    mycorreResp = 1

elif mouse.rightButton[0]== corrRespR and mouse.leftButton[0] == corrRespL:

    mycorreResp = 1

else:

    mycorreResp = 0

trials.addData('wasItCorrect', mycorreResp)

I attach the .psyexp

I am sure experienced psychopy users will offer a more elegant solution. Note that I changed the pic names within the excel file as well as some timings in the psychopy exp.

PictureTest.psyexp (8.4 KB)
Real_TrialsMC.xlsx (9.8 KB)

1 Like

Hi Yiannis,

Thanks so much! It’s fixed my problem completely. I really appreciate it!

Josh