Repeat trial loop until a condition

See if there’s anything helpful here: Conditional loop depending on percentage of correct responses