I am running a study online that includes multiple tasks. As I am doing the piloting and finishing the first task, I ran into the following error: TypeError: Cannot read property ‘0’ of undefined.
I think the error was caused by the repeat time of a routine set to be 0. For my experiment, I was trying to counterbalance the order of tasks and I followed the instruction for counterbalancing subtasks in builder and convert the experiment online. https://www.psychopy.org/builder/blocksCounterbalance.html#counterbalancing-different-subtasks
It seems like that I cannot use the same method for online experiments. I am wondering if you have any clue for how to counterbalance subtasks online. Thank you!
I just changed the version to the latest version. But I did upload the initial experiment using an older version, I will sync the experiment again and see if it solves the problem. Thank you so much for your help!
That is probably why, somehow it runs fine without the offline and so I wrongfully assumed that it does not need '’ online. I am sorry for making such a stupid mistake. Thank you for your help!
I’m having a similar issue, can I not use nReps twice in a project? For example, if I have numEncoding = 25 for my encoding blocks, can I set numEncoding = 25 in a code component before the loop and use this for nReps, then set it numEncoding = 25 again in a different component before another loop and have it work? I’m now looking into whether using a different name would fix the problem, but I thought that since I was re-setting it it should work
I’m running a memory task with 2 blocks (different images in the blocks) and each block has 25 encoding and 40 retrieval trials. I didn’t make it a big loop because I was changing the images and didn’t know how to set the code for that, so I just made psychopy routines like encoding 1, encoding 2 etc. For these loops, I set the nReps to numEncoding, so telling it to run 25 trials for both blocks, however, when I’m piloting the study and get to the second block, I get the same error as in this question! I tried re-naming it to numEncoding2 but it didn’t help, I thought maybe it was giving me an error because it already ran 25 trials
Yes! I define/assign numbers to them in the randomization routine then add to the nReps, and for the 2nd block of encoding and retrieval I do the same!
@wakecarter I realized that I don’t get the error if I set the number lower. For piloting purposes, if I set numEncoding to 2 and numRetrieval to 4 in the first block, and do the same for the second block, I can run the whole task. However, when I set numEncoding to 25 and numRetrieval to 40 in both blocks, I get the error in the second block. If I keep numRetrieval 40 for the second block, but make numEncoding 3 or some lower number, then I can get through the second encoding block, but get the error after the encoding trials! Any idea why this may be? Is it because that it already ran the number of trials? I tried changing the names but that didn’t work for me