psychopy.org | Reference | Downloads | Github

Hosting psychoJS experiment on a different server (folder structure problem)

Hello!

I’m trying to host an experiment built with psychoJS on my own server, but I’m getting some errors that seem to have to do with the structure of my folders with resources I want to display (a .wav file and a .jpg file). I tried with the same structure that I used on Pavlovia (i.e. html/resources/images with the .wav file in the resources folder and the .jpg file in the images folder. I get this error in a pop-up window:

  • when getting the value of resource: brrt.wav
  • unknown resource

And this error in the console:

Thank you so much!

Johanne

Hi @johannenedergaard, running PsychoJS from your own server is not currently supported. However, we will soon be releasing local debugging functionality, which creates a local server on your computer so you can test your scripts, without having to sync them with Pavlovia beforehand.

Hi @dvbridges,

Okay, thank you.

Johanne

Hi @dvbridges, I would guess that this is a frequently asked question, but I had no luck finding an answer:

Other than for local debugging, is it likely that running PsychoJS/Builder experiments from my own server will eventually be an option? Are there a lot of technical hurdles to overcome before that could be done? Or maybe it’s just a low priority because not many users would use that option?

Yes, it is a frequently asked question and the answer is still that we don’t plan to support this in the near future. What is your reason for needing this? Is it to avoid paying for participant credits or for some other reason?

Hi @jon and @dvbridges,

I don’t know why @bfiles asks about running on other servers, but personally I’m interested in using psychoJS elsewhere because I need to expand the functionality beyond compiling a javascript script from Builder. I’ve already tweaked the code for an experiment I’m piloting on Pavlovia but it sometimes crashes/freezes for undecipherable reasons which I thought might be less opaque if I ran it without the rest of Pavlovia in the background.

Best,
Johanne

@johannenedergaard, you can also debug your experiment when it runs from Pavlovia using developer tools. Press F12 and view the console to see what errors have arisen during your experiment. Spotting bugs should be easier with the new local debugging feature.

@dvbridges Yes, that’s what I’ve been doing so far - and the reason why I’ve been able to tweak my experiment so relatively extensively. The issue is when the experiment sometimes crashes or freezes for reasons that don’t always pop up in the console. Excited for the new local debugging feature though.

hi! I’m from Turkey and this is the first time experiment in PsychoPy for me. I need to get online my experiment but as you said, i can’t pay the credits for participants because of expensive exchange rate. So, ı want to ask that; Can ı load my experiment to any website by using .js document?

No, as discussed above you can’t simply upload your study to another server. I’m sorry that the exchange rate poses problems. Still, I think this is very substantially cheaper than any other hosted option.

I hadn’t realised that I wouldn’t be able to host PsychoPy online locally, probably because I have done it before (pre Pavlovia).

Fair enough. though does that mean there Export HTML function is now redundant?

Cheers,

Wakefield

No, so you can still use that to examine the full code for the experiment, and you can actually still run the study locally to test (PsychoPy now has a debug button on the new Runner view to allow local debugging of an experiment before pushing to pavlovia and that uses a built-in python web server) but that local run will end with a save-file dialog box for the participant, rather than automatically saving to the server. It’s there to allow debugging but not running experiments.