URL of experiment:
RTexp1.psyexp (32.3 KB)
https://pavlovia.org/run/NiklasJung/10_exp_rt
Description of the problem: Greetings, im currently working on this “Sternberg-like” Experiment on reaction time. It works offline perfectly. Im struggling with the manual translation of the py code to the js in order to run the Experiment online. I solved the random positions of the stimuli but I need help with translating the loops.
‘’'number_symbols = random.randint(3, 7)
opa_list = [0, 0, 0, 0, 0, 0, 0, 0]
i = 0
if random.randint(0, 1)>0.5:
opa_list[0] = 1
i = 1
else:
opa_list[0] = 0
for x in range(random.randint(3, 7) - i):
opa_list[x+1] = 1
‘’’
Error message: Uncaught (in promise) ReferenceError: random is not defined RTexp1.js:344
I can provide more infos if necessary
Thanks in advance.
With kind regards,
Niklas