How to have participants continue after a loop only when they have gotten a certain number of questions correct in the loop

I am stuck, hoping for some general advice.
I want to show participants photos (30) and provide them with 4 multiple choice answers that they can choose from. I have completed this, and I have it loop through the 30 pictures/ answers.

I want to make my program do two things:

  1. When an answer is chosen, have the correct answer go green, and the incorrect answers go red. A second later it moves on to the next item.
  2. I want the loop to repeat forever unless the participant gets at least 25 correct. If they get 25 or more correct, then it moves past the loop to the next thing.

I am not sure how to even begin to implement this.

Hello Bennett

there are a couple of solutions to both questions posted in the forum, for instance

or regarding feedback

Best wishes Jens