0

I wrote a Javascript program using a psychology experiment tool called JSPsych. I need to run the program on a server and have the data produced from the experiment trials saved to the server itself.

I downloaded XAMPP and somewhat succeeded in running the program through XAMPP, but I do not know how to have the data saved.

Can anyone help?

Bharata
  • 13,509
  • 6
  • 36
  • 50
Sean
  • 1
  • 1

2 Answers2

1

JATOS might be a solution for you. JATOS cares for the server-side - while jsPsych cares for the client-side (what happens in the browser) and you can easily turn your experiment into a JATOS study. Then it has a database (H2 or MySQL) to store your experiment's result data. From your JavaScript code you connect to JATOS through jatos.js.

(Disclaimer: I'm the developer behind JATOS)

Kris
  • 4,595
  • 7
  • 32
  • 50
0

You'll need to setup some kind of server-side script that communicates with a database or writes files to disk. Typically you would call the script with an XMLHttpRequest in JavaScript, passing the results of jsPsych.data.get().json() or jsPsych.data.get().csv() as an argument.

In my lab we currently use this small PHP library that I wrote to save data from jsPsych experiments. The README provides an overview of how to use it.

Josh
  • 2,105
  • 1
  • 14
  • 14