| Reference | Downloads | Github

Correct mouse click (left or right), with feedback

OS (e.g. Win10): Mac
PsychoPy version (e.g. 1.84.x): v2020.2.4
What are you trying to achieve?: I want a left and right mouse click to be accepted as responses to the stimuli presented. The mouse click should be defined as being correct or not. According to whether the response was correct or not, there should be feedback given at the end of each trial, and a summation of the number of correct responses shown at the end of the block.

What did you try to make it work?: I tried playing around with this piece of code: MouseClick correct answer output

See the attachment (as a new user, I can only upload two links so this is all I can attach in this post):
CPED_even_RJP.psyexp (109.5 KB)

What specifically went wrong when you tried that?:[‘correctResp_P’]
KeyError: ‘correctResp_P’

When you call .data on a TrialHandler object, it returns a dictionary with keys for each data column. It looks like when you ask for the column ‘correctResp_P’ it can’t find one - do you define this earlier using Trials_Prac.addData('correctResp_P', DATA)?

I tried it but it doesn’t seem to fix anything. The program quits by itself without any error message…

Quitting without an error message usually means it’s hit some infinite loop or tried to do something too memory intensive to handle - do you have any while loops in your experiment? Or large files being read in via an Each Frame bit of code?