JATOS running on AWS: studySessionData not updating
I'm running a study that works perfectly fine when I run it locally. jatos.studySessionData
loads normally and I can use it for inter-component logic. I set up my EC2 instance such that JATOS is used with Apache2. Everything seems fine on that side in that I can access the website and the experiment loads when I generate study links. My only issue is that for some reason, the jatos.studySessionData
is not updating as intended. It was working for some time but for some reason, it stopped working and I can't understand why. The only thing that changed is that I setup an actual domain name and HTTPS (I used namecheap) whereas before I was just using the ip address and not redirecting to port 443 in the Apache conf file.
Below is an example of code that uses studySessionData.
<script> jatos.onLoad(() => { /* Initialize jsPsych*/ var jsPsych = initJsPsych({ show_progress_bar: true, on_trial_start: function () { jatos.addAbortButton({ action: revert_batch }); }, on_finish: function() { // finished block jatos.studySessionData.last_ax_block_num += 1 if (jatos.studySessionData.last_ax_block_num == 4 && jatos.studySessionData.block_stage == 'after') { jatos.endStudy(jsPsych.data.get().json()); } else if (jatos.studySessionData.last_ax_block_num == 4 && jatos.studySessionData.block_stage == 'before') { jatos.studySessionData.max_pause = 300000; jatos.studySessionData.block_stage = 'cat'; jatos.startLastComponent(jsPsych.data.get().json()); } else { jatos.startLastComponent(jsPsych.data.get().json()); } } }); jsPsych.data.addProperties({ workerID: jatos.workerId }); /* create timeline*/ var timeline = []; /*Reset pause timer*/ jatos.studySessionData.max_pause = 60000; //first block logic if (jatos.studySessionData.last_ax_block_num == 0 && jatos.studySessionData.block_stage == 'before') { /* more experiment code ... */ } </script>