OS (e.g. Win10): Win10 PsychoPy version (e.g. 1.84.x): 3 Standard Standalone? (y/n) y What are you trying to achieve?: In my experiment, participants are supposed to learn new words. After a training phase I want to check how well they’ve learned the new words. For this I want to present the new word in the middle of the screen and let them choose one of two definitions shown on the bottom right or left on the screen (randomized where the correct and the distractor definition are presented). I wanted to give feedback on whether their response was correct.
What did you try to make it work?: I used a code component in the beginning of the feedback routine.
if key_resp.corr:
msg=“Richtig!”
else:
msg=“Leider falsch!”
In the routine were the response is given I put
msg = " "
in the begin routine code component so that it will refresh each trial.
What specifically went wrong when you tried that?: Feedback is shown after the choice is made, however in my excel data file key_resp_corr is always 0, even if the answer was correct. No error message occured. It might be a problem that the correct answer is a whole sentence and not a word. In the key_resp component I put the parameter $definition in the field for correctAns. This parameter is also used to display the definition. I cannot say right or left would be the correct answer as the correct definition’s location is randomized.
Essentially to create the key_resp.corr variable, psychopy is asking does the key pressed correspond to what is written in the definition column (i.e. key_resp==definition).
If you need definition position to randomly be on left or right, you will need your conditions file to be something like this:
word
definition_left
definition_right
corrAns
cat
a feline
a canine
left
cat
a canine
a feline
right
Then in your routine you have 4 components:
centre word, where the textField is $word
definition1, where the textField is $definition_left
definition2, where the textField is $definition_right
key response, where the correct answer field is $corrAns
Give this a go and hopefully this should work as you expected for you to then adapt to your experiment.
It’s me again. Sadly the feedback works when testing it in the desktop version, however it does not work on pavlovia…
I updated my condition file the way you suggested it and filled in $corrAns in the key_resp component.
That’s the code I’m using in the routine after the one where the response is given:
if key_resp.corr:
msg=“Richtig!”
else:
msg=“Leider falsch!”
When piloting it in Pavlovia it says that resp is not defined. I tried to use the code you suggested with the print command but it didn’t help.
I’m sorry for bothering you but I do not know how to solve this problem