ReferenceError: ISI is not defined

URL of experiment: PercOnlyNoMic [PsychoPy] (There’s obviously an issue with the experiment fitting to the screen as well, but I’m hoping that shouldn’t be as hard to fix.)

Description of the problem: The experiment was built in the PsychoPy 3 builder and has no problem running locally on my laptop, all the way through. But I synced it with Pavlovia through the builder and I’m now running into this issue that stops the study (a popup displaying: ReferenceError: ISI is not defined), so I’m assuming that it has something to do with the JS that was automatically created when synced with Pavlovia.

I tried defining the variable at the beginning of the JS file by simply putting:
ISI = 0.5;
But that did not fix the problem. I’m wondering what else I should try at this point? Is there a better way to define the variable?

Where did you put ISI = 0.5; ?

It needs to be earlier than

if (t >= ISI && resp_A_practice.status === PsychoJS.Status.NOT_STARTED) {

and not inside a conditional.

I placed it towards the beginning of the code after all the variables were defined, like this:

var advance_begin_posttest;
var closingClock;
var txt_closing;
var key_close_exp;
var globalClock;
var routineTimer;
ISI = 0.5; 

That looks like you’ve edited the JS code directly.

You should add ISI = 0.5 in the Begin Experiment tab of an Auto translated code component.

The ISI = 0.5 is a part of a begin experiment tab code in the study in the PsychoPy builder, written in python. Did it not sync properly? And can I not make changes to the JS file directly to try and fix issues?

Please could you show a screenshot of your code component?

Changes directly made to the JS file will be lost when you sync and are therefore not recommended unless you are editing something that cannot be changed via the Builder.

Oh, I see.
And here’s the screenshot. This is in a code component of the first block of the experiment:

Would trying to reupload the study help?
Is there any known reason why that definition in the code didn’t sync from the PsychoPy experiment in the first place?

What version are you using? It looks like it comes from 2020.1.

I would look at the JS code and search for ISI. You could try using a different variable name, just in case ISI is being used for something else.

I checked and the variable isn’t being used for anything else.
But it is 2020.1.3, so I could try using a newer version to see if that works.

I would currently recommend 2020.2.10. However, some bits did break in 2020.2 and still haven’t been fixed (such as .thisN). Please check my crib sheet for more details.