Pavlovia - TypeError: Cannot read properties of undefined (reading 'play')

URL of experiment: Pavlovia

Description of the problem:

Hello!

I’m using the builder (PsychoPy3, Mac OS 12.3) to create an experiment that selects a randomly selected of subset rows from conditions spreadsheet, then presents the associated video along with text and a slider. When I run the experiment locally it works, when I run it on Pavlovia, I get “TypeError: Cannot read properties of undefined (reading ‘play’)”.

I believe the problem most likely lies in the way that I am selecting rows to be presented in the loop using a variable defined in a code snippet, which is then in the ‘selected rows’ parameter.

In this workable example, I aim to present the same 2 randomly selected videos 3 times. My condition file has 4 videos listed beside 3 unique question. The code snippet that works locally is below.

# select and shuffle rows: SYNCH
synchRows = list(range(2))
shuffle(synchRows) 

# add 4 to get each subsequent question
synch1 = synchRows[0:1]
synch2 = [x + 4 for x in synch1]
synch3 = [x + 8 for x in synch1]

# select and shuffle rows: CONTROL
controlRows = list(range(2,4))
shuffle(controlRows) 

# add 4 to get each subsequent question
control1 = controlRows[0:1]
control2 = [x + 4 for x in control1]
control3 = [x + 8 for x in control1]

# append as list of integers 
theseRows = synch1 + synch2 + synch3 + control1 + control2 + control3

What I’ve considered/tried:

  • The if trials.thisN == n:\ trials.finished = true approach won’t work for me.
  • In @wakecarter’s crib notes, I saw that slice(0,1) won’t work in JS, and tried manually changing the JS translation of the snippet slice(0:1), which made the experiment get stuck on ‘initialising the experiment’.

My flow, in case it’s helpful:

Many thanks in advance!

Resolved in my example experiment by making a new conditions file (more than once). Seems to be the clincher for a lot of things.