hi all,
I have a Psychopy task that runs offline for quite a while. I now want to create an online version but I encountered a problem. I believe the issue lies in the code I added in the Psychopy builder that failed to be converted to java (I tried the automatic options).
In the experiment, participants are being asked to type sequences of numbers. After every keypress, a feedback element in the form of ‘polygon’ appears on the screen. To achieve that I used a code that was added in the Psychopy builder.
In the beginning of the experiment – import python toolboxes
Do you really need all these python libraries? They are not automatically converted to JavaScript. You might want to rewrite your experiment without using these libraries, try the auto-translate option. You probably still have to manually edit the JavsScript-code (set auto translate to both) and see Wake Carter crib sheet for python to JavaScript translation.
to further add to jens point, many of those libraries are actually automatically imported (and the psychoJS counterparts are imported behind the scenes for your online experiment) - so you don’t actually need to manually import these
I tried to remove this section or import only parts of the toolboxes but then it doesn’t recognize the variable ‘event’ that is defined based on the toolboxes.
I tried to perform an automatic conversion as you suggested but it didn’t work. I guess the solution is indeed to adjust it manually. I will try to use the website you suggested… I hope it will help because I have zero experience in java scripting.