First of all: Thanks to all of you for helping me with my other issues. This forum has been such a great help for me!!
I am working on a new Experiment now. This time it is a Mental Rotation experiment.
It is already working quite well but I have one big problem that I couldn’t solve yet. In the trainings trial I want to repeat a stimulus as long as the participant gets it wrong and only want to show the next stimulus when the participant gets it correct but I don’t know how to do it.
I have created a routine feedback ant inserted a code component. This is how it looks like right now:
The reason for the syntax error is because the second part of your if statement isn’t indented. However, continueRoutine = True is superfluous so I’d recommend that you delete it entirely.
Thank you @wakecarter! I realized that shorty afterwards as well and fixed the syntax error. Now my code component looks like this but it is still not working…
After an incorrect answer it just displays the next stimulus and doesn’t repeat the stimulus I got not correct…
For some reason (possibly due to conflict with the slider component I’ve added) it doesn’t work offline, but online it uses a single text component to display the fixation, item and feedback – and then repeats if the answer is incorrect.
Thank you so much @wakecarter for taking the time helping me and for sending me your experiment!!
That is exactly what I need! Unfortunately I can’t read the code properly because of the format.
Did you do it with the Builder interface?
Could you maybe send me a screenshot of what you did in the Code component for achieving that a stimulus gets repeat if it is incorrect??
When I click on the icon with the cloud and the down arrow the file downloads with a psyexp extension. If it’s downloading with a txt extension for you, you should be able to rename it to open it in PsychoPy
The easiest thing to do in this situation is just to insert a second loop around your trial routine (i.e. nested within the outer trial loop). This inner loop should not be connected to a conditions file, and just be given a large nReps values, like 100.
In the “End routine” tab,
put code like this:
if key_resp.corr:
your_inner_loop_name.finished = True
i.e. the trial routine will just keep repeating until the response is correct. At that point, the inner loop will end, and the next iteration of the outer loop (i.e. the next trial) will occur.