trials.thisN and trials.thisTrialN are constant in the online experiment

There have been some changes in how loop variables work in newer versions of PsychoJS. Try using this variable instead: snapshot

Now, it will have most properties you’re after (like snapshot.thisN), but there is some room for improvement, since it doesn’t have all the properties that PsychoPy offers, and it will complicate things with nested loops. I made a little test to illustrate these issues, for when we’ll go optimize this. Likely to take a while though, since we’ll probably bundle this up with some other upgrades of the looping system.