| Reference | Downloads | Github

Loop does not run to end of list/randomly skips one trial when running experiment online

URL of experiment: Nina Becker / associative_learning · GitLab

Description of the problem: I have a very simple experiment, in which I’m randomly looping through images. In total, there are 72 trials that are stored in an excel file which I’m linking to in the loop component. The routines within the loop are very simple image components. The experiment runs perfectly normal offline but when I run in online, the loop randomly skips one trial, i.e., instead of running 72 it only runs 71 trials.
The trial it leaves out is, as I said, completely random, i.e., it can be trial 16, 55 or 67. Since it does not leave out trial 72, I’m assuming that it does recognize all 72 trials from the list. It just doesn’t run the randomized list all the way to the end. I don’t get any error messages.

I have another set of experiments that have the same loop component and refer to the exact same excel file and in both of these experiments, the loop runs all trials, offline and online.

I’ve tried deleting the experiment several times, building it from scratch, duplicating one of the functioning experiments and simply adjusting the components that are different but it always only runs 71 trials instead of 72 in this particular setup.

Since I have not even the slightest idea how to trouble shoot this or where the problem could stem from, I’d very much appreciate any help on this.


Does it skip the four trials within that loop or only one of them?

It skips one entire trial and by that I mean one entire row of the list that entails all four elements of the loop (fixation, context, lag, and item).

That’s very weird and a little worrisome. I have a couple things you could try, but I’m worried this could be something going wrong with trialhandler itself.

  1. Try making the conditions file into a csv instead of an xlsx. Should this matter? No, but I don’t trust excel files as a matter of principle.
  2. If you run it on sequential rather than random, does it do all 72 trials?
  3. Can you link the other experiment you said works and displays all 72 trials? I want to see if there’s any salient differences.
  1. Alright, I will try that and report back. I had some issues with the csv file initially, which is why I switched to an excel file.

  2. If I run it on sequential the issue remains. In this case, it leaves out trial 72, i.e., the last one in the list.

  3. Here’s the link to the experiment that runs all 72 trials and links to the same excel file:


Well, if the CSV thing doesn’t work, I’m officially stumped. The two experiments seem to be completely identical in all the relevant ways, they’re even made in the same version of PsychoPy. Have you re-run the old one recently online to ensure that it does actually show all 72 trials?

Otherwise I have no idea.