You appear to be using event.getKeys in a code component which ends the routine, so I would recommend that you replace it with a normal keyboard component.
Use keyboard components instead of event.getKeys()
The keyboard component in PsychoPy Builder uses the Keyboard class, which has better timing than the older event module. If you want to identify whether a key has been pressed in Each Frame then code of the form
keys = event.getKeys()
can be replaced with
keys = []
if key_resp.keys: # Keyboard component should store all keys and not force the end of the routine
if len(key_resp.keys) > nKeys: # Add nKeys = 0 in Begin Routine
keys =…
You also have unnecessary code in your feedback routine. Why not use a text or textbox component?
Builder isn’t Coder
I strongly discourage the use of PsychoPy Coder for the creation of psychology experiments because Builder is easier to debug, share with others and translate into PsychoJS for use online.
If you already have an experiment written in Coder, pasting the code into Builder code components is not sufficient to turn it into a Builder experiment. The logic of how to arrange an experiment is slightly different because of the way Builder works with components, routines and loops.
F…
What are your print statements telling you about IMCpercu?
Use Print statements
When debugging, print statements can be very helpful to track down errors or unexpected behaviour.
I tend to use them in one of two ways:
print('trial setup started')
Sometimes I won’t know where the error is, especially if there is a problem during the initial setup of the components or Begin experiment code. The components of each routine are set up in turn from top to bottom. Therefore, if you have a flow with routines called start, trial and finish and put print('tri…