Trial keeps repeating itself and code keeps crashing

Description of the problem:

Hi all, I have made my dot probe task but the trails kept repeating them self and I set the nReps to 1. I tired to use the code trials.finished=True but it quits the experiments and says “trials not defined”. Can anyone help me out?

This is what my test looks like on builder:

Your loop is called trials_1 not trials which is why trials is not defined.