My laptop specs:
MacOS Mojave Version 10.14.6
PsychoPy version 2020.1.2
What I want to happen:
I want the message “response recorded” to appear as soon as a participant has pressed a key but I don’t want it to force the end of the routine. Participants look at an image of a face for 5 secs and press 1 if the eyes are looking at the camera and 0 if not. This is a face learning task so the image needs to stay up for the full 5s. I want to acknowledge their button press without ending the trial. I’m not fussed about telling them if they were right or wrong, but if that’s easier to do I’m happy to do that. This needs to work on Pavlovia so any code component fixes need to be Pavlovia-friendly.
Things I’ve tried:
Without any feedback, the experiment works locally and on Pavlovia.
Based on another post, I believe there’s an old bug where you can’t change the opacity of the text, so that won’t work.
I tried the method where you have a polygon cover the text and you set its opacity to 0 after a button press, but my background colour changes every trial so I don’t think this is possible.
I tried adding this code component.
Under Begin Routine I have:
msg = " "
And under End Routine I have:
msg = " " if gaze_key_resp_1.keys == 1: msg = "Response recorded!" if gaze_key_resp_1.keys == 0: msg = "Response recorded!"
There is a text component which has $msg in. I tried that second bit of code in the End Routine box and the Each Frame box. Both attempts have not displayed the text and caused my screen to turn grey and stay grey after 1 trial. It doesn’t crash, it just turns grey and I have to press esc to crash out.
- Based on the PsychoPy website Builder - providing feedback (Builder - providing feedback — PsychoPy v2021.2) I have since tried this:
Under Start Experiment I have:
msg = 'doh!' #if this comes up we forgot to update the msg!
And under Begin Routine I have:
if gaze_key_resp_1.keys: msg="Response recorded!"
I set the text component to end at 5.5s so the screen no longer stays grey, it moves onto the next trial. However, it only says “doh!” and if I press an allowed key at any point it still says “doh” and doesn’t change to “response recorded.”
I have tried moving the if statement code to the Each Frame box. It starts the trial showing the word “doh” and if I press a key it stays that way, but on the next trial it changes to “response recorded” but stays stuck showing that for the rest of the experiment.
I have tried every combination of putting msg=" " and the if statement in under every tab in the code component, I just can’t get it to work.
Any help would be very gratefully received.