| Reference | Downloads | Github

Presenting comprehensive score at the end of emotion recognition experiment

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10):
PsychoPy version (e.g. 3.0.x):
Standard Standalone? (y/n) y
What are you trying to achieve?:

I have created a test for emotion recognition of my subjects. I have created a set of 6 experiments conjoined in a single experiment file, and I am able to achieve the output file. These experiments create a set of responses that can be checked alongside the experiment’s output of correct answer. As I am new to Psychopy, I am not very apt with the code component in it. Is there a way through which the subject’s answers can be checked with the experiment’s correct answer, and a comprehensive score be given at the end of the experiment?

Thanks in advance

@Shardul_Shankar, keyboard components have a parameter called “Correct response”. You can put your correct responses in your conditions file, and pass that variable (column) name to the correct answer field in the keyboard component. Then, using a code component you can get the value for the correct answer and add those values to a variable, giving you a total at the end of the experiment. In this code, I am assuming your keyboard component is called “resp”:

# Begin Experiment tab
score = 0

# End Routine Tab
score += resp.corr  # resp.corr returns a 1 for correct and 0 for incorrect.

Now you have accumulated a total score in the score variable, you can use it in a text component.

@dvbridges Thanks! It works perfectly in one demo module. I will insert that in my whole experiment, and if any error occurs, will get back to you! Thanks again!! :grinning:

Hi there! Is there a way to use this method to provide participants with a score by condition or trial type?