OS: Windows 10, 64-bit
PsychoPy version: v2023.2.3 (Standard Standalone)
What are you trying to achieve?:
Hi there,
I’m working on a short-term memory task and I’m inserting a code component to provide response feedback based on the condition of two variables.
The first variable “is_match” is predetermined on the excel sheet (either “TRUE” or “FALSE” as values), but for the second variable I’m calling in psychopy’s default recorded variable “pressed_key_Trial.keys”, since the feedback will depend on whether participants pressed the spacebar key or not (“space” or “None” as values—“None” being how “no response” is recorded). So the response is of the type GO/No-GO so to speak.
Whitin the trial loop there’re three routines: trial component, response feedback, and intertrial screen.
In the response feedback routine, inside the “Begin Routine” tap, I’ve inserted the following code:
if(is_match == “TRUE”):
… if(pressed_key_Trial.keys == “None”):
… … feedback_text = “Correct omission”
… … responseType = “correctOmis_trueNeg”
… elif(pressed_key_Trial.keys == “space”):
… … feedback_text = “False alarm! \n false positive”
… … responseType = ‘falseAlarm_falsePos’
else:
… if(pressed_key_Trial.keys == “space”):
… … feedback_text = “Well done! \n it’s a hit”
… … responseType = ‘hit_truePos’
… elif(pressed_key_Trial.keys == “None”):
… … feedback_text = “Incorrect omission! \n it’s a miss”
… … responseType = ‘miss_falseNeg’
thisExp.addData(‘responseType’, responseType)
and within the “Begin Experiment” tap I initialised the respective variables (as I kept getting the warning of them being called before assignmen)t:
responseType = “ ”
feedback_text = “ ”
What specifically went wrong when you tried that?:
The problem that I have is that no matter the response emitted (and not emitted), the only feedback that is shown/registered is the “Well done! it’s a hit”, seemingly irrespective of any variables’ values. I’ve tried inserting the code component at different taps stages and routine such as at the end of the “trial routine” but to no avail.
I’m new to the experiment-builder functionality of psychopy so it is hopefully a simple mistake on where/when to make the code active, but at this point I frankly have no idea; I’ve even wondered if there’s an issue with trying to use the “None” no response value (???). Any help would be much appreciated.