Problems with two dimensional array in psychojs

URL of experiment:

Description of the problem:
Hi,
I´m creating a working memory experiment in which participants have to learn 14 pairs of lists with 3 digits each. In the beginning I have the following code component to create the list pairs:

lists = [];
var digits = [];
for (var i = 0; i < 15; i++) {
     digits[i]= [1, 2, 3, 4, 5, 6, 7, 8, 9];
    shuffle(digits [i]);
    lists.push(digits [i]);
    console.log(digits [i]);
}

So I get an “array of arrays”. In my conditions file I refer to the different digits as follows:

PsychoPyScreenshot

This works absolutely fine in PsychoPy. With an older version of PsychoPy I had no problems running this experiment online, but today I updated to the newest version and now instead of the item of the array the index is presented in my lists. I don not think that there is a problem with the code component as I can see in the console that the different lists are created and shuffled. So I guess there is a problem now with how I refer to the items in my excel file. I hope I could make my problem clear.
Thanks a lot in advance!
Frida

Hi Frida,

Thanks for the warning! Do you know which version of PsychoPy it did work with? As a workaround, in experiment settings, Use Version, selecting an older version of PsychoPy could help.

Best, Thomas

I noticed an issue with 2020.2.5 (I think) whereby square brackets in Excel files were interpreted as lists and any content outside the brackets was discarded.

In your case, you could solve the issue by just having the indices in your columns, e.g. [13,0] in column digit1 and then use lists[digit1[0]][digit1[1]] to refer to the digit.

1 Like

Hi,
so sorry for the late reply. So it works with the version 2020.1.1 and I just switched back to this version. Thanks for your help!

Hi,
thanks a lot for this tip! For now, I just switched back to the older PsychoPy version, as I had to get the experiment started quickly. I will try this for another experiment. Thanks!