Translation Problem: OS is not defined

Hello everyone!
I am unfortunately super unfamillar with the java script code.
I build my experiment from a demo in the builder and as I tried to run it online, I got the following error:

  • ReferenceError: os is not defined

I think it probably is a translation error, because the experimetn works on psychopy but not on pavlovia. I think it must be in this code sequence:

expInfo[‘OS’] = window.navigator.platform;

Can anyone tell me how I can define os?

I don’t think it’s that code sequence because the error says os and your code says OS.

Are you trying to import a Python library?

Thank you!

Yes I think, that is what I am doing.

Do you think the failure could be in

psychoJS.experiment.dataFileName = ((“.” + “/”) + ((“data” + os.path.sep) + ${expInfo["participant"]}_${expInfo["date"]}));

Absolutely. You can’t change the data file name in PsychoJS.

thanks again!
Do you know how I can modify my code without loosing any important functions?

Hello Ele,

well, since you don’t tell us which functions you might be loosing we can’t help you.

You can’t import Python function for running online. Not all Python-libraries have a online (JavaScript) equivalent. The Builder imports all libraries for which there online-equivalents.

Best wishes Jens