Dear Jessica,
Kristian might have to correct me but your PHP files won’t work with JATOS, not at least in a straightforward way.
You are right, JATOS won’t let you get data out of the database from the client side, but this is important for privacy: if a participant were able to read the result data stored in the mysql database it could be a potential data privacy breach for other participants. Instead, to run longitudinal studies you have to store data in the Batch session. (
http://www.jatos.org/Session-Data-Three-Types.html). For the same data-privacy reasons, make sure you don’t store any personal data here, as this is visible from the client side.
The batch session outlives a study run so you can have the same participant get data from (say) several days back.
We have one example study that uses the batch session for a slightly different purpose (to counterbalance conditions between subjects) see the “Randomize Tasks Between Workers” example study here:
http://www.jatos.org/Example-Studies.html
One word of warning, writing to the Batch Session can get confusing because JATOS has to be sure that there are no two simultaneous events writing different things into it. The best way to avoid this is to write to the Batch Session only once in your component.
In case it helps, I’m actually doing something similar lately for a longitudinal experiment that we're about to test. I have three components in my study.
-Component 1 is called "Assign Conditions". All workers will always land here, and get sorted to the next two components, depending on whether they are a new participant or not.
-Component 2 is (say) Task on Day 1
-Component 3 is Task on Day 2
I’ve attached the HTML/JS file for my AssignConditions. It's not the cleanest in the world, and it's a bit idiosyncratic because we have to counterbalance several different factors. But hopefully it will be helpful as a starting point for how exactly to set things.
Hope all this helps, let me know if you have any more questions
Best
Elisa