URL of experiment: https://run.pavlovia.org/arkadiym/od_e_1_test1/html
Description of the problem: The fixation cross is supposed to appear for a pre-set number of milliseconds. These are randomly sampled from a generated list of Ints. It appears as planned, but randomly disappears/reappears about 15 minutes into the experiment.
Here is the code pertaining to the fixation cross:
Python:
import random
# Get a variable number of ISI presentation times
ISI_Num= np.random.triangular(0.25, 0.5, 1.0, 10000)
np.random.shuffle(ISI_Num)
ISI_Num= ISI_Num.tolist()
Javascrip (ISI Num values are truncated for the purpose of this example, but there are 10,000 of them):
ISI_Num = [0.41455211, 0.71802275, 0.32057255, 0.67399222, 0.7005724,
0.61799867, 0.37266446, 0.45349066, 0.53348465, 0.86651267,
0.40217111, 0.32989753, 0.74102027, 0.46488324, 0.55745606]
// create a function to shuffle a list
function shuffle(a) {
var j, x, i;
for (i = a.length - 1; i > 0; i--) {
j = Math.floor(Math.random() * (i + 1));
x = a[i];
a[i] = a[j];
a[j] = x;
}
return a;
}
//create a list
x = [1,2,3,4,5,6,7,8]
shuffle(ISI_Num);
Begin routing:
# Pop ISI Time
ISI_Time= ISI_Num.pop(0)
The ISI_Time variable is then entered into the “Duration” tab of the polygon.