psychopy.org | Reference | Downloads | Github

Passive Errors / Nonresponses do not register when converting to Javascript for Pavlovlia, will not progress to next trial

URL of experiment: https://pavlovia.org/eric/workingwithnumber

Description of the problem:

In the first phase of my experiment, practice trials have keyboard responses that “force end of routine”. When I respond within the response window, the trials progress to the feedback screen and on to the next trial. If I do not respond, the experiment gets stuck and will not progress to the next trial. In the python version, it would register as an error with no reaction time and progress to the next trial. After the trial and within the practice loop, I have a feedback screen > custom code for saving data > custom trial counter > custom code for conditional exit of loop, but the feedback screen does not work, so it seems like the problem is before my custom code. That said, I am new to javascript.

This experiment worked fine in python (built in Builder with custom code sections) but I can’t get a productive error message out of the html version and can’t determine where the experiment stops (what js line).

Any idea what would cause the experiment not to log a passive error when the trial elements time out?

This issue is resolved.

Eventually, I found that the problem was in the custom code for saving my data. I had declared my variable earlier using “var array1 = []” which made the variable local and couldn’t be used by my custom code directly after the trial. As mentioned in other posts, to make variables accessible throughout your experiment, do not use “var” when declaring a variable.