URL of experiment:
Description of the problem:
I’ve coded my experiment in jspsych but provide external .json condition files for each participant. The problem here is that I need a way to reference a new file for every new participant. I figured a way to do this is to have a function that counts the number of files in the data folder and assigns file number based on that.
subj_number = length(files in data)
condition_file = subject_file + subj_number + .json
From what I’ve gathered there’s no way of doing this directly using js code.
I’ve found a way to do this calling a .php script. And it works on my computer (on a local XAMPP server), however after I upload the whole experiment to Pavlovia if throws out an error reading the .php file :
Uncaught SyntaxError: Unexpected token <
I assume the issue is that Pavlovia doesn’t have a .php backend (but correct me if I’m wrong, I’m not very familiar with the topic).
So my question is, what is the easiest way around this issue? Can I somehow install php manually? Or can I write a python script that counts up the files and link it to the index.js file somehow? Or maybe there is another simpler solution?
P.S/ I’m not putting a link to URL, since currently uploaded version is working (since doesn’t include the .php call; I was making sure everything works fine)