OS (e.g. Win10): Mac
PsychoPy version (e.g. 1.84.x): 1.90.3
This is my first attempt on PsychoPy. I would like to show two set of images (set A and set B) and register the reaction time. Participants are told to press “space” only if the image belongs to the set A. I already did this. Now, my problem is that I would like to display the results to the participants at the end of the experiment. I found how to display the number of correct answer (when they did press ‘space’ for an image of set A) and the mean of the reaction time. However, the mean of reaction time is calculated on both sets (mean of reaction for set A (correct answer) and set B (wrong answer)).
In the Code Component (Begin Routine) of my Routine I wrote :
nCorr = trials.data[‘response.corr’].sum()
meanRt = trials.data[‘response.rt’].mean()
msg = "Vous avez fait %i reponses correctes (rt=%.2f), " %(nCorr,meanRt)
I am a beginner also in python coding, but I am pretty sure the solution would be to set a condition there… (meaning : calculate the mean of reaction time if ‘response.corr’ = 1).
What would be the best solution to display the mean of reaction time for the correct answers.
Thank you for your help!