Can't open jsPsych study with jatos.onLoad(function()
Hi!
I can't open my jsPsych study after I have implemented/jatosified the code to the following:
jatos.onLoad(function() {
jsPsych.init({
timeline: timeline
on_finish: function() {
var resultJson = jsPsych.data.get().json();
jatos.submitResultData(resultJson, jatos.startNextComponent);
}
});
});
I get an "Uncaught SyntaxError: Unexpected identifier" at the line on_finish: function() { in both my Edge browser as well as in Chrome when I try to run it on both the local server (jatos version 3.5.8) as well as an extern server (jatos version 3.5.5).
I tried to include "data": on_finish: function(data) but that doesn't work either...
Do you have an idea on how to solve this issue?
Thanks a lot in advance!
Best regards,
Martin
Comments
Hi Martin,
I might be wrong but I think you're simply missing a comma after `timeline: timeline`
In any case the error points to a syntax error in your javascript. If this doesn't help, people at the jsPsych google group should be able to help you better.
Best
Elisa
Hi Elisa,
Thank you so much for the quick response. It now runs just as it should be running.
Best,
Martin