Skip to content

jsPsych+JATOS saving data trial by trial #811

Answered by becky-gilbert
CGaele asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks @kristian-lange! Just to add to his response: in jsPsych, it is possible to send the data back after every trial using the trial's on_finish function. It would look something like this:

var trial = {
  ...
  on_finish: function(data) {
    // convert the data object to a JSON string
    var trial_json_results = JSON.stringify(data);
    // append this data to the end of the current results in JATOS
    jatos.appendResultData(trial_json_results);
  }
};

However I haven't actually tested this code so not 100% sure it works.

If you want to send the data back after every trial in the experiment, you could instead put the above code to save the data into jsPsych's on_trial_finish parame…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@jodeleeuw
Comment options

@becky-gilbert
Comment options

@jodeleeuw
Comment options

Answer selected by jodeleeuw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants