I’m fairly confident that the issue here is that you are setting the selected rows as a string of comma-separated indices instead of a list.
Try putting $stimnum_sample in your loop. If you’ve already tried this and get the same error then perhaps there’s an issue with your create of stimnum_sample. Try printing it to the console.
TypeError: Cannot read properties of undefined (reading ‘x’)
While similar to TypeError: Cannot read property ‘x’ of undefined , the format of this error implies a different cause.
[截屏2025-04-09 16.55.59]
[Screen Shot 2022-02-20 at 9.52.58 PM]
[Screenshot 2023-04-05 181938]
Sometimes there is information about the location of the error and sometime there is just the error message.
If the error occurs at a random point during a loop then it may be due to a blank cell. Check that the number of…
Avoid multiple spreadsheets
One way of counterbalancing blocks in an experiment is to have an outer loop which points to a spreadsheet which contains the names of different spreadsheets to use in an inner loop. The main issue with this is that if you have multiple spreadsheets with the same columns and you want to make a change, you have to make it to all of them. The other more minor issue is that you may have to specify the spreadsheets as additional resources in Experiment Settings / Online.
…