psychopy.org | Reference | Downloads | Github

Pavlovia Black Screen No Error Message After Initialization on version 2020.2.5 but not 2020.2.4

hi @sotiri, I re-added you. Could you please let me know what the relevant bits are?

Hi @rkempner, thanks, maybe you gave me access to the 2020.2.4 generated code instead of the more problematic 2020.2.5 version? Apart from a few resources failing to load this one seems to be running fine even without the post PixiJS upgrade patches? x

hey @sotiri I also gave you access to pilot_NEW_PSYCHOPY repository which is the problematic 2020.2.5 version.

Are the PixiJS updates or other updates after 2020.2.4 necessary or could I do without them for running an experiment if the pilot experiment seemed to work out fine with 2020.2.4?

Hi @rkempner, yes you did give me access, thanks, but I never got email notified like with the 2020.2.4 one, sorry. Yes, you should be fine using that if the pilot runs OK!

Getting back to our earlier conversation, you’ll see by comparing the main JS files between the two versions that line #1564 in the 2020.2.5 project is preventing the Scheduler from advancing as normal.

Just by looking at the code, it is unclear which parts of the script are PsychoPy generated and which are yours. The logic is hard to grasp in full for someone not familiar with the particulars of a relatively complex design.

For those reasons, it would greatly speed things up for our team debugging the issue if you could, as a courtesy, provide us with PsychoPy output demonstrating a single case of you setting continueRoutine = true inside the BeginRoutine callback and commenting out that let continueRoutine = true; // until we’re told otherwise bit inside the RoutineEachFrame callback plus any extra JS edits you are likely to need?

As your were building your experiment, what was the first routine that required extra coding? Please, could you send us a copy of only that portion of the project?

Thanks again for your understanding as we iterate to improve our software, x

Hey @sotiri, yep thanks I’m working on that minimal example with the contineRoutine stuff. Should I make a new repository with you as a developer for that?

Also, seems like if I just comment out the round thing and the if (!continueRoutine) { in the BeginRoutine’s, then my task will work fine with the latest versions.

Do you think it is safe for me to do that editing to the PsychoPy JS output and use the latest versions? Do all the latest versions of psychopy have the if (!continueRoutine) { in the BeginRoutine’s or did that just happen because of how I coded things up?

Hey @rkempner, alright super, yes a new repo would be great, or you could send me a base .psyexp if easier. Yes you could be commenting out those lines to make it work, but you would need to go through that same process each time you export HTML, just the thought of which is frustrating no doubt.

Yes it looks like PsychoPy 2020.2.5 brought about the following change in the JS boilerplate at the end of begin trial blocks:

// Before
return Scheduler.Event.NEXT;

// After
if (!continueRoutine) {
  return Scheduler.Event.NEXT;
}

That should work by default, but because you have custom code in place that relies on manually flipping the continueRoutine flag, I believe parts of your program may need adjusting to make it compatible with PsychoPy again. Having a cut down version of your project should help us make suggestions to that end.

Hi @sotiri, I was able to change around the code so that I could have continueRoutine remain False in the beginRoutine tab. Now, things works with the latest version.

If you are curious, I accomplished this by making up a new variable called routineContinue which is set to the same boolean values that I set continueRoutine to in the BeginRoutine tab, but now, I set continueRoutine = routineContinue at the beginning of the Each frame tab if routineContinue is set to False so that the routine does not continue. Pretty much this accomplishes exactly what I had working in the earlier versions.

The code adde in 2020.2.5 was there to allow users to set the variable continueRoutine=false at the beginning of the trial rather than on each frame during the trial. I couldn’t tell from the discussion above whether that boilerplate code has been added to the experiment incorrectly (possibly I’ve over-applied the Python solution to the JS case?) or whether it’s just that the experiment itself was using that value in an unconventional way.

In python psychopy, I was able to set continueRoutine to false at the BeginRoutine tab and have the routine not continue.

However, the javascript output has let continueRoutine = true; // until we're told otherwise at the beginning of the EachFrame tab, so I needed some awkward work arounds since anything done to contineRoutine variable in the BeginRoutine tab is overwritten subsequently.

Before 2020.2.5 my solution was to comment out let continueRoutine = true; // until we're told otherwise which was not hard by a simple ctrl + F and replace all before uploading my script to pavlovia. However, after 2020.2.5, the BeginRoutine tab added

 // After
if (!continueRoutine) {
  return Scheduler.Event.NEXT;
}

This meant that I needed to change things around because I could no longer set continueRoutine to true in the BeginRoutine tab. Remember, i needed to set continueRoutine to true in the BeginRoutine tab since I commented out the let continueRoutine = true; // until we're told otherwise .

Now, my workaround is described above by using a variable called routineContinue to control whether or not I want to proceed. I explain this above.

Hey @rkempner, makes sense, yes! Clever workaround, light touch. Thanks for the update and detailed account, x

I’ve fixed the code for continueRoutine in 2020.2.10
Hopefully your workaround is no longer needed and setting continueRoutine=false in BeginRoutine should now abort the routine online as it does locally

best wishes
Jon

1 Like

thanks for helping :slight_smile:

Thanks, will check out the new version.