Dear Lioness-Team,
I am trying to randomize the treatment assignment but I am facing a problem with getting the values of an array that i saved.
in short, player 1 should save an array with the randomly shuffled 12 treatments and all other players should draw their role from this array.
In practice I did it like this:
STAGE 1:
if(playerNr==1){
treatments=['1','2','3','4','5','6','7','8','9','10','11','12'];
treatments=shuffle(treatments);
record('treatments', treatments)
-----
STAGE 2:
refPl=1;
treatments=getValue('decisions', 'period='+period+' and playerNr='+refPl, 'treatments');
role=treatments[playerNr-1];
-------
However, at stage 2 drawing from the treatments array does not work as it somehow not saved as it looks in stage 1.
I tried it with .join() but then the role=treatments[playerNr-1] does not work as it counts also the comma.
Do you have any idea how to solve this?
Thanks and best regards,
Marcel