URL of experiment: Pavlovia
Description of the problem:
Dear all,
I am building an experiment where properties of stimuli in an array are stored as vectors. My python code (which works both in python and online) is as follows:
THECOLS=
THESHAPS=
THESHAPC=
THETAROR=for x in range(12):
THECOLS+=[iscolred]
THESHAPS+=[isshapsq]
THESHAPC+=[-isshapsq+1]
THETAROR+=[Math.floor(Math.random()*2)*90]
However, if I try to modify just one element of the arrays:
THESHAPS[tarpos]=-isshapsq+1
THESHAPC[tarpos]=isshapsq
This works in psychopy, but online I get errors like TypeError: 11 is read-only.
The number (in this instance 11) seems to correspond to the value of tarpos. I get the same error if I try to put say directly a value in the array, es.
THESHAPC[tarpos]=1
I really don´t understand what´s going on because the js code:
THESHAPS[tarpos] = ((- isshapsq) + 1);
THESHAPC[tarpos] = isshapsq;
seems to be correct as far as I can tell.
Does anybody have an idea what the problem might be?
Thank you in advance,