Saving jsPsych data as JSON file #3148
pelintanberg
started this conversation in
General
Replies: 1 comment 1 reply
-
Hi @pelinTan, If the jsPsych script is sending JSON and the extension in this file is .json it should work. (This is how I've run many studies in my lab, so I'm confident that it can work.) I would just double check that the versions on the live server match what you're expecting and that its not some cache/version issue. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
Is it possible to save jsPsych data, using PHP, as a JSON file onto the server? Right now, I can do a local save as JSON but participants cannot do that with online experiments. Using the PHP code below, I changed .csv to JSON but it still saves the file as a CSV file.
<?php $post_data = json_decode(file_get_contents('php://input'), true); $name = "data/".$post_data['filename'].".csv"; $data = $post_data['filedata']; // write the file to disk file_put_contents($name, $data); ?>
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions