You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've done a couple of surveys via jsPsych distributed using Prolific, and I have a couple of issues yet to be resolved, and any tips will be highly appreciated!
(1) Data saving with parallel users. I save my data about 2-3 times towards the end of my ~25 minute experiment using the php script below. This seems to work well for me and when I do short pilot batches, but I do end up getting a few 0byte files at times. My understanding is that this is related to multiple users invoking this file at the same time, but even so, I don't quite understand why a datafile by either user would get wiped out, since filenames are generated as a random alphanumeric string and two strings are pretty unlikely to be exactly the same. Or is there something I'm missing here. I've been considering running this using jQuery.ajax() which halts a page till this file finishes running, but not sure how this is going to be in a bigger batch.
<?php
// get the data from the POST message
$post_data = json_decode(file_get_contents('php://input'), true);
$data = $post_data['filedata'];
// generate a unique ID for the file
$file = uniqid("sub-");
$name = "data_follow_version/new_data/participant-{$file}.csv";
// write the file to disk
file_put_contents($name, $data);
?>
(2) Experiment page reloading: The project page reloads to the start page when participants are deep in the task, and so participants end up not being able to complete the survey. This too seems to happen towards the end of surveys and also kinda rarely. Is there a way to prevent this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I've done a couple of surveys via jsPsych distributed using Prolific, and I have a couple of issues yet to be resolved, and any tips will be highly appreciated!
(1) Data saving with parallel users. I save my data about 2-3 times towards the end of my ~25 minute experiment using the php script below. This seems to work well for me and when I do short pilot batches, but I do end up getting a few 0byte files at times. My understanding is that this is related to multiple users invoking this file at the same time, but even so, I don't quite understand why a datafile by either user would get wiped out, since filenames are generated as a random alphanumeric string and two strings are pretty unlikely to be exactly the same. Or is there something I'm missing here. I've been considering running this using jQuery.ajax() which halts a page till this file finishes running, but not sure how this is going to be in a bigger batch.
(2) Experiment page reloading: The project page reloads to the start page when participants are deep in the task, and so participants end up not being able to complete the survey. This too seems to happen towards the end of surveys and also kinda rarely. Is there a way to prevent this?
Thanks again!
Rekha
Beta Was this translation helpful? Give feedback.
All reactions