
The program was repeating if I press the space bar. On each incorrect trial, add the unique id to that list, like this: if outerloopname.thisN 0 and blah blah: where blah blah is your check that the response was incorrect wronglist. Next, during my experiment loop if an incorrect response follows the variable 'correct' gets set to False (this is all going well).
#Psychopy repeat incorrect trial later on code#
When I included the whole code as above, it just plays all the trials one after another without waiting to take my response. Im trying to make a loop which repeats until the participants get all the questions in check routine correct, which are composed of 4 random questions. All reminders use the tAutoDraw (True) command. That is, it repeats the same trial, if I press ‘space’.

Now, add a keyboard response component, changing the start time to 0. When I had excluded the code after first six lines that does the repetition part, it works fine. Click the advanced tab and change Fill Color to colorVar and choose set every repeat. ThisExp.addData(‘reps’, ‘0’) if key_resp_3.keys=eval(CorrAns): At the bottom of the window there is a Flow bar, under this were going to select Insert Loop and move the dot that appears after trial in the flow diagram. Key_resp_3 = event.getKeys(keyList=)ĬontinueRoutine = False # trial will run again It does not play on subsequent iterations through a loop. It will need 8 columns: 7 to specify the unique images in a trial and an eighth to specify the repeated one. If a sound component of a trial is set to 'constant' then it will play on the first trial only. First, start with your conditions file (i.e.csv or. put something loike this in my Begin Expeirment component of the code repeatstimcolors - If True, a stimuli display can have repeated colors. 1 Answer Sorted by: 0 Yes, youre correct that there is a (much) more efficient way to do this.

In case if the participant want to re-hear the sound, he should press ‘space’, I have set up an inner loop ‘trials_5’, with empty conditions of 999 reps, so it can repeat the sound gets repeated if ‘space’ is pressed. I have made some progress but needs some help in thisĪs explained above my experiment is very simple, a sound is presented and participant has to press either ‘left’ or ‘right’ key to respond, which ends the trial.
