I am creating an experiment (online) where there is a decision (they have to respond yes or not for a word that appears on the screen), and I want to display the message “Response recorded!” when they press either key (l or a). I tried using the feedback coding and added a feedback_text component and a code component:
#End of routine
if resp.corr:msg="Response recorded!"
but it only works for correct responses and, most importantly the message only appears AFTER the key_resp component duration is over (they have 3 seconds to respond), because I DO NOT want to force end of routine after the response.
During each trial an audio plays, so I do not want the routine to stop immediately after the response, but only when the audio ends. But I want the participant to know that her/his response was recorded so I want to display a message in the screen as soon as they respond (correct or incorrect, just response recorded).
Thank you for your response @Michael
It is not working-- maybe I am missing something, the message is displayed during the whole routine (before any key is pressed), opacity does not change. I am still working and testing in the desktop. I tried moving the components in the routine and change durations, but text still displays during the whole routine.
Hi @Michael, you helped me with displaying a messages (playing with the opacity in a polygon), it worked perfectly in builder, but now that I just uploaded it on Pavlovia I am getting an error right before that routine (although I use AUTO>JS).
Here is attached what I did and the error message: * TypeError: Cannot read property ‘length’ of undefined it seems light the variable was undefined, but I doubled checked that the code is calling the right variable. Please, could you guide me on what is happening?
Thanks for your promptly response @Michael
I probably won’t be able to solve this, but in the meantime is there a simpler way to display my message. For example every time participant press the key ‘a’ or ‘l’ the message “response recorded!” is shown for a few seconds. That way there is no need for JS to check the resp.keys variable. Or is this a more complicated solution than before?
Is there something like the following (I am very not skilled in programming):
I’m trying to replicate the text opacity bug, but when I set the opacity of text on my own install it seems to work. If you’re using one of the newest versions then it probably isn’t a version error, unless it’s been fixed very recently, so I’ll look further into what’s going on. Could you send me the full .psyexp / .py files for your experiment so I can test it out?
Hi @TParsons, I went back to using the text component but the opacity actualization did not work, as it does with opacity in the polygon. I am attaching the .psyexp file with the text not working. Also, if you have an idea on how to get this to work online, that’d be much appreciated.