URL of experiment: Sign in · GitLab
Description of the problem:
Hello there! I have a question concerning the code components when running an experiment online on Pavlovia. Due to a somewhat more complex experiment design I had to load images “manually” via a code component and store them in an array. Before each block/trial I need to shuffle the images. Running the experiment locally works perfectly fine with np.random.shuffle(array). For running it online I translated it into shuffleArray(array) and defined the function shuffleArray() at the beginning of the experiment. The definition of the function is exported into the js files, but when starting the experiment online, I still get the error that the function was not defined:
Is something wrong with the definition?
I tried both: inserting a JS Code Component at the beginning of the experiment (in the first routine) and inserting it in the “Begin Experiment” section of the Code Component in the Routine where I need the shuffleArray() function. Both did not work.