The feedback edited by the code cannot be displayed in the experiment

OS:Win10
PsychoPy:2021.2.3
I want to add feedback after the trail of each experiment.
After writing the code and text, although the experiment can run and end normally without error, the content in the code cannot be displayed


Here is additional information on this issue:


Hi there, I can see 2 things that can potentially be the reason why your code is not working.
Firstly, in line 1 of your code component in the Begin Routine tab, you do not need ==1 so your code should look like this

if key_resp.corr:
    msg = 'Correct RT = ' + str(key_resp.rt)
else:
    msg = 'Error'

And the second thing might be that in line 10, you also used msg to display a different message. You should rename it to something else, perhaps totalCorrectmsg and use another text component to display that message.

Hope this helps,
Sue Lynn

Thank you very much for your reply. I made changes according to your method, but I still can’t show the feedback in the experiment.

Do you mind sending me your experiment so that I can take a closer look?

练习.zip (21.1 KB)
thanks!!!

练习.zip (24.1 KB)
Hi, it turns out that your letter height was empty which was why nothing was presented :slight_smile:

Hello, this is the program I changed, but I still can’t display feedback. And there is a very strange thing, that is, why can’t code display the length of time in Routines?
练习.zip (21.1 KB)

Hi, have you tried running the demo I sent you in my previous reply because that worked on my local computer. And sorry but I’m not sure what you mean by the code can’t display the length of time in Routines. Could you be more specific?

Thank you very much for your patience. My question has been solved perfectly.