Pavlovia doesn't recognise selected rows

I had the same problem. I defined a variable (“trial_sequence”) with a random sequence to run the trials in my excel conditions file, and passed it to the loop option “Selected rows” like “$trial_sequence” (with loopType being “sequential”).

The problem was that the program would randomize the order offline (Python worked), but not on pavlovia (JS didn’t work). It didn’t produce any error messages on pavlovia, but would just present the trials unrandomized as defined in the conditions file.

The solution was to not initialize/define the “trial_sequence” variable with “var” (so not write “var trial_sequence = ;”, but just “trial_sequence = ;”), because it causes the variable to not be available outside its component (as described in TypeError cannot read property '0' of undefined in Pavlovia).