Either the condition is never been met or continueRoutine isn’t sticking. I’ve seen some mentions that JS has trouble referencing the current loop by name. Let’s try this:
if (trials.thisTrialN % 20 > 0){
continueRoutine = false;
console.log('no break here')
}
If you open your javascript console (in Chrome it’s in the menu under view->developer), the log messages should appear there. This gives us the ability to test two things separately. If the condition is not being met, then it’ll just show you the break on every trial, but the console log will remain blank. If the problem is with continueRoutine, then it will show you the break on every trial, but it will also fill up the console log with these messages. That’ll help us narrow down the root issue.