Hello,
I am having trouble in translating a Python code to Java. First, I describe the Py script.
In the experiment, participants have to make 3 consecutive presses (with a total maximum time of 2.5 seconds). If they don’t make the 3 presses, the time expires and the next routine starts. The three presses correspond to 3 routines:
Press1:
#Begin Routine
timer = core.Clock()
max_time = 2.5
and
#Each Frame
if timer.getTime()>max_time:
continueRoutine = False
Press 2 and Press 3 (separately)
#Each Frame
if timer.getTime()>max_time:
continueRoutine = False
However, using the automatic translation in JS, I get the following error:
TypeError: core.Clock is not a constructor
As far as I understand, reading also other topics here, JS does not really like core.Clock(). Is there another way of doing it though?
Here is the repository for the experiment: