URL of experiment: des condition [PsychoPy]
Description of the problem:
the experiment can run at psychopy, but stuck at ‘Initialising the Experiment’ when online, I had translated the coding into JS, and add a blank at text, but it still stuck
the code is as below:
import {Design, Prospect} from ‘darc_toolbox’;
import {days_to_string} from ‘darc_toolbox/utils’;
import {data_plotter} from ‘darc_toolbox/data_plotting’;
import {event} from ‘psychopy’;
import {gui} from ‘psychopy’;
import * as random from ‘random’;
var keys, rand_num;
rand_num = random.random();
keys = event.waitKeys({“keyList”: [“1”, “2”, “3”, “4”]});
console.log(keys);
if ((keys[0] === “1”)) {
result_2.text = “100”;
} else {
if (((keys[0] === “2”) && (rand_num <= 0.5))) {
result_2.text = “200”;
} else {
if (((keys[0] === “3”) && (rand_num <= 0.2))) {
result_2.text = “500”;
} else {
if (((keys[0] === “4”) && (rand_num <= 0.1))) {
result_2.text = “1000”;
} else {
result_2.text = “0”;
}
}
}
}