Issues getting started

https://run.pavlovia.org/TheSav/v3_conda/html/

Description of the problem:

Hi, I’ve been trying to create an online version of a latent inhibition program (that works perfectly but I’m having a few issues.

Here are some assumptions I am making about the process (which I may be wrong about);

  1. When I click the “sync with web project” button in PsychoPy 3.1.5, a html folder is created and there should be a corresponding .js file created with the same name as the project that is created and uploaded to the pavlovia server. At present, this file does not appear.

  2. The online program stalls at the ‘initialising the experiment’ phase as I think it cannot load the corresponding .js file (https://run.pavlovia.org/TheSav/condition_a_mg/html/Practical_Prog_A.js).

  3. The program has some coder elements that I presume I will need to create native javascript for in the “code properties” box when showing “code type” both. I’ve yet to do this but would this cause the .js file to not be created?

Am I missing something?

Regards, Justin.

Hi Justin, welcome! I think for point 1 and 2, me and someone else are having the same issue, see
here, just in case there might be an answer there earlier than there is in this thread. Sorry I can’t help you, I’m having the same problem - no .js files, and stuck on initialising. (If you figure it out please let me know how you did it!)

Hi @TheSav, and @carlijn, yes I believe your issues will be related to an error in your code components, or somewhere in your Builder components where you have inserted some custom code. If there is a syntax error in your code components, your JS will not be created. There should be an error output when you try to compile/sync your HTML/JS. To check, from Builder, open a Coder window or just compile your script into Python and the Coder window will open. Then, try to sync you experiment again. Any errors should appear in the Coder output window.

Hi @dvbridges thanks for your reply. I do not have any code components in either of the files, because I don’t know JS I hardcoded everything I needed in my conditions file. So is there anything else that could cause this problem? Thanks in advance!

Ok great, I still recommend you try the steps above then copy and paste any errors that appear.

Hi Justin @TheSav,

From my experience, it is a translating problem of PsychoPy, from .psyexp (XML format) to .js (JS format). PsychoPy would fail to interpret and translate some component’s parameters and could not export as HTML.

And that is why your online program stalls at the ‘initializing the experiment’ phase, I think.

I also have met the same issues before.
Do you set a conditional expression as a parameter in some components? (text of the text component, or start/stop of every component, etc.)
If you are comparing variables in a conditional expression, it is likely that cause the problem.

Because Python and Javascript have different syntax for large and small comparisons, it can cause problems when interpreting and translating your experiment.

Check your experiment in Builder.
If you set a conditional expression in some component parameter, you can achieve the same behavior in other ways.
(i.e. Define the parameter as a variable in code component separately for Python and Javascript, using a conditional expression, and set “($) + the variable name” in individual components.)

I’m still a beginner and I don’t know the details, but I hope I can help you solve the problem.

Hope this helps!

Sorry for the many screenshots I’m working from a small screen now.

@carlijn, that error looks like a networking issue, which is separate to the original problem. I have had a look at your newcd project and the reason for the failure to compile is the use of the cross shape in polygon. There should have been an error raised output saying that this shape is currently not supported for JS, but that appears to have not been reached above due to the networking error. The good news is you can make your own cross using a text stim e.g., “+”, you can overlay to rectangle stim to make a cross, or you can use a cross from an image file.

@TheSav, just looking into your issue now, which similarly appears to be related to the use of Polygon stim that are in development, causing the JavaScript compiler to fail. Will let you know shortly how it is possible to draw circle stim.

@dvbridges Ok brill. I tried all your suggestions above and found no errors. I’ll tinker with removing the polygon and see what happens.

So just to confirn, when I remove the polygon elements the js now generates.

Thanks @TheSav, the issue is with regular polygon, which Alain is implementing very soon. For now, the supported shapes for online studies include lines, triangles and rects.

1 Like

@dvbridges - ok thanks for the info. I’ve now successfully replaced the circle polygon with a transparent circular gif which seems to be working in builder.

1 Like

thank you so much, it works now indeed!! :clap:
just wondering if the overwriting with an old file (as I wrote here On-Line Issues with Pavlovia) had anything to do with this/anything else and/or if that is a known problem?