I have been using psychopy builder, 1.83.0 for my experiment. The stimuli presentation and recording is simple. A sound file is played and participant has to select one of the two images on the screen, by pressing ‘left’ of the ‘right’ which ends the trial. This part may have been easy, but I want the trial to be repeated again if ‘space’ bar is pressed.
So, I have set it up such that allowed keys are ‘left’, ‘right’, ‘space’ and added a code component like this
Thanks for that. Yes! you are spot on. I changed that. And it now seems to not give error.
The problem now is,
It plays the audio and freezes. It does not take responses and end the trial. Nor does it replay the audio if I press ‘space’.
As I explained I want the program to end the trial if either ‘left’ or ‘right’ was pressed. And, replay the stimuli if ‘space’ was pressed.
I have made some progress but needs some help in this
As 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. 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.
put something loike this in my Begin Expeirment component of the code
#And in the each frame
if key_resp_3.keys == ‘space’:
continueRoutine = False # trial will run again
thisExp.addData(‘reps’, ‘1’)
reps=reps+1
else :
thisExp.addData(‘reps’, ‘0’)
When I had excluded the code after first six lines that does the repetition part, it works fine. That is, it repeats the same trial, if I press ‘space’.
When I included the whole code as above, it just plays all the trials one after another without waiting to take my response.
Can any body help?
Thanks
The program was repeating if I press the space bar. However, when the