What are you trying to achieve?:
I am programming an IAT, where participants have to categorize stimuli (left vs right). Here is a simplified version of the experiment so there is only the relevant stuff.
My goal is the following :
- if the participant answers correctly, the experiment must continue to the next trial.
- if they answer incorrectly, feedback appears (eg: a red cross), and they should correct their answer by hitting the other key. My dependent variables will be the RT of the correct answers, but I would like to have the RT of the wrong answers as well.
That implies a few functionalities I am struggling with.
1. How to give the feedback inside the trial ? (I am able to create adequate feedback with a custom Code but only outside of the trial, hence not giving the possibility to correct the answer)
Here is the code I use :
Now, the problem is that all resp.corr are registered as “0” in the data file, and thus logically, irrelevant of the answer, the feedback is always “X”. What strikes me is that I did not change the “resp” component, and when the same code was in another routine (after the trial), the encoding of resp.corr worked just fine.
Also, already at the first occurence of the stimuli, a feedback appeared even though no keys were pressed.
I guess it’s an easy one but I have no clue.
(I have read How to provide simultaneous feedback? but I am not skilled enough to adapt it to my case)
2. How to end the trial only if the given answer is correct ?
Since I am blocked at step 1/ I cannot test it already but I plan to untick Force end of routine in the keyboard component, ask to Store all keys, and add in the code Each frame :
continueRoutine = True # end this trial and continue with the next one
continueRoutine = False # end this trial
according to the solution shared here
A huge thanks in advance for your time and pedagogy,
(I am using Win10 and v1.90.1)