| Reference | Downloads | Github

Inconsistency in the effect of a code component's location on the the production of feedback

If this template helps then use it. If not then just delete and start from scratch.

Win10 PsychoPy version 2021.1.4 Standard Standalone

I have been trying to follow the documentation to get key-press accuracy and reaction time feedback at the end of each trial. The documentation at Builder - providing feedback — PsychoPy v2021.2 says to put the code in the “begin routine” section.

I did not understand how that would work since, at the beginning of the routine, the keyboard component would not have run yet. However, it did work, but only for providing accuracy feedback. It did not work for reaction time feedback (the reaction times were not displayed). It also did not work for echoing onto the screen the specific key the subject pressed. I ended up moving the code to the “end routine” section, and that made everything work fine.

By the way, with the code now inserted in the “end of routine,” it appears to run after the other, non-code components have run, regardless of where the code component appears in the top-to-bottom routine display. This is different from what’s in the documentation (“Be aware that the code for each of the components in your routine are executed in the order they appear on the Routine” – Code Component — PsychoPy v2021.2).


simply put your feedback in a routine following your rt-routine. Then the code that determine the feedback goes in the begin routine-tab and is the first component of this routine. Add a text-component to display the feedback.

Best wishes. Jens

1 Like