Within the same routine, participants hear an audio and have to make a response at any point within that audio, but during the whole experiment the background screen is black so in order to reassure to the participant that their response was recorded I want to briefly display a message (e.g., “response recorded!”) when they press any of two keys. Crucially, when they make a response the routine does NOT end, it continues until the audio is over.
I want to do this online, preferably with a simple code that doesn’t need to go to the output data file, cause I don’t need to check if response was correct or not, just if the participant pressed any of the two keys I instructed.
I created text_1 set to blank and constant, and added the code component in begin routine (I defined “event” in JS as per your crib sheet) is there anything I am missing? cause it is not working, but it is not giving me error either (although when I ran it offline, it gave me “responseRecorded” undefined).
Now it is starting to work in PY, but the message appears at the beginning of the next routine instead of the exact moment of the key press. In JS, it gives me code error (_pj is not defined, but that was part of the automatic translation the software gave me), I only defined “event”, anything else I can try?