Does opensesame convert python to javascript? Online expriment ran into problem
Hi there,
I have one question, does OpenSesame convert python code to javascript automatically when we use OSWEB?
I was trying to upload and run one self-paced reading study to JATOS test server, however, it could not get started after the instructions part, which I wonder whether it is the problem of the python inline at the beginning of the practice part could not be executed.
If anyone has similar experience or know how to resolve this problem, could you share a bit how you deal with this?
Thanks!
The Error information is as follows:
Application Error:
Uncaught TypeError: Cannot read property 'split' of undefined
See the console for further details
Comments
I found that OSWEB has information that: Item inline_script is not supported...so that might be the case, but how could we deal with this, do we need to rewrite the code in javascript?
This is not a JATOS question but rather an OSWeb one, @sebastiaan might be able to help
We have tried once converting Python code to JavaScript, but the are vastly different languages, and it was too challenging to focus on at the current stage of osweb. Python runs code in a 'blocking' fashion or linear and javascript works asynchronously, meaning that it is really difficult to pause the script with something like
clock.sleep. This and a lot of other bridges need to be crossed first before python inline_script items will be supported by osweb.In more recent versions of OpenSesame however, there also is an inline_javascript item, with which you can simple manipulations such as working with the var_store. You can't do anything fancy like drawing to canvases yet, but hopefully we can add that soon, or at least sooner than we will add support for python inline_script support.
Find more info on this here: https://osdoc.cogsci.nl/3.2/manual/osweb/#inline-javascript