setting up with experiment with single vs multiple components

274 views
Skip to first unread message

Becky Gilbert

unread,
Jun 27, 2017, 6:30:30 AM6/27/17
to JATOS
Hi JATOS users,

I'm using JATOS with jsPsych and am debating whether to set up my studies with multiple components/HTML files (one per task) or as a single component. 

I'd prefer to set things up with multiple components, but jsPsych seems to work best when it's run with a whole-experiment timeline. For instance, you can have jsPsych ask the user to enter full screen mode at the start of the study, but if you chain together multiple jsPsych task timelines that use this full screen feature, then the experiment will exit full screen after each task, and ask the user to enter it again. As another example, jsPsych can create a progress bar for the whole study, but this is only for the timeline that it knows about. This means that you can have a whole-expeirment progress bar with a whole-experiment jsPsych timeline, but with multiple components/timelines you would get task-specific progress bars.

So, are there any major disadvantages to running an experiment (with multiple tasks) as a single JATOS component? I assume I can still send the data back at regular intervals during the experiment using jatos.submitResultData, and just omit jatos.startNextComponent as the onSuccess parameter. Does anyone know of other potential issues or solutions?

Thanks!
Becky

Elisa Filevich

unread,
Jun 27, 2017, 6:47:40 AM6/27/17
to Becky Gilbert, JATOS
Hi Becky,

You’re right, perhaps this is the strongest incompatibility/difference between JATOS and jsPsych. 

I can’t think of any disadvantages if, as you say, you regularly submit data to JATOS (after what would otherwise be a finished component). Perhaps keep in mind that if you have different tasks with different kinds of data saved, (say demographics for the first component and responses and reaction times for the second), then it will be slightly harder to deal with when you export it, because you’ll have to parse things out of the JSON string with your results. And this will probably mean you can’t save it as a CSV, in case you want to. 

However, while I haven’t tried this, it should in principle be possible to prevent a whole-screen exit at the end of each component. I would think that it’s just a matter of modifying slightly jsPsych’s fullscreen plugin. I don’t know jsPsych well enough but this looks relevant: 
or perhaps the function called with jsPsych.finishTrial(trial_data);

Maybe Kristian and I can look into this within the next few days and see if we can modify the plugin.   

Hope this helps! 
Best
  
--
You received this message because you are subscribed to the Google Groups "JATOS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jatos+un...@googlegroups.com.
To post to this group, send email to ja...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jatos/b4e2a051-a67c-4d04-847c-2b6d28ff0de3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Becky Gilbert

unread,
Jun 27, 2017, 9:41:42 AM6/27/17
to Elisa Filevich, JATOS
Hi Elisa,

Thanks for your thoughts. As usual this is super helpful :)

Yes, I see your point about the data being messier and harder to parse when everything is stored together. I really like JATOS' component structure for a number of reasons, one of which is that it makes the data very managable. (FWIW I don't bother trying to store the data in CSV format because it seems like JSON is more robust, and I've found the jsonlite R package easy to use for parsing the results.)

Ah, it hadn't occurred to me that I might be able prevent the browser from automatically exiting fullscreen at the end of jsPsych timelines, when switching from one component to another. Thanks for the suggestion, this would be an ideal solution if it works! I'll have a look at this and let you know if I can figure it out. 

Thanks again,
Becky


To unsubscribe from this group and stop receiving emails from it, send an email to jatos+unsubscribe@googlegroups.com.

Kristian Lange

unread,
Jun 27, 2017, 9:46:55 AM6/27/17
to Elisa Filevich, Becky Gilbert, JATOS
Hi Becky,

I wouldn't call it an incompatibility of JATOS and jsPsych - it's more a different philosophy. Both is possible and JATOS supports both. You could also combine a jsPsych component with an prior component that does the introduction / consent form in pure JS/HTML/CSS. 

I just want to add, that the jatos.js function jatos.submitResultData stores the data only once - it does not appand. What I want to say: if you use jatos.submitResultData twice in the same component the first result data will be overwritten in the database. But this isn't a problem. Just store all your result data in a global JS variable and post this variable in the end of your jsPsych timeline (= end of JATOS component).

Best
Kristian

Becky Gilbert

unread,
Jun 28, 2017, 4:42:00 AM6/28/17
to JATOS, elisa.f...@gmail.com, beckyann...@gmail.com
Hi Kristian,

Ah, yes that's a good point. At the very least I can create separate components for the parts of an experiment where I don't need jsPsych (e.g. consent, questionnaires) and the jsPsych tasks. 

Ok thanks for clarifying. I was wondering whether the jatos.submitResultData would append or overwrite the data each time it's called within the same component, but I hadn't had a chance to test this yet. It'd be nice to have the option to save the data to the database periodically during the experiment rather than all at the end, particularly for components that take a long time to complete. I suppose I could do this by calling the jatos.submitResultData function with a variable that stores *all* the data for that component (rather than just the new data since the last save), and overwrite the previously-saved data each time. 

Thanks!
Becky 

Kristian Lange

unread,
Jun 28, 2017, 5:58:38 AM6/28/17
to Becky Gilbert, JATOS, elisa.f...@gmail.com
Hi Becky,

yes you could use the jatos.submitResultData to save your data periodically in a component. Just make sure that you always save the whole of your data and not just the new ones. Maybe if it is a common requirement I could add something like a jatos.appendResultData function that would do what you are missing in jatos.js. 

Best,
Kristian

Becky Gilbert

unread,
Jul 3, 2017, 10:19:55 AM7/3/17
to Kristian Lange, JATOS, Elisa Filevich
Hi Kristian and Elisa,

I looked into the fullscreen issue and found out that this is a browser feature, so nothing to do with jsPsych. Apparently the browser exits fullscreen automatically when a URL redirect is done via JavaScript (but not when it's initiated by the user) - see here. So I don't think there's any way for the worker to stay in fullscreen between components. 

One of the suggested solutions that I've seen is to have the user click a link to go to the next html page (i.e. next component). However I'm not sure how this would work with JATOS because I assume that would bypass some of the stuff JATOS needs to do when a worker finishes one component and starts the next one, right? So if that solution doesn't work, then the jatos.appendResultData option would be great. Should I add a feature request on GitHub? 

Thanks,
Becky


To unsubscribe from this group and stop receiving emails from it, send an email to jatos+unsubscribe@googlegroups.com.

Kristian Lange

unread,
Jul 3, 2017, 12:11:28 PM7/3/17
to Becky Gilbert, JATOS, Elisa Filevich
Hi Becky,

I just checked with a couple of the example studies and the browser stayed in the fullscreen mode with me as long as it initiated by the user (as you said). So regardless whether it was a button or a link and whatever jatos.js doing behind the curtain it seems as one can use jatos.startNextComponent, jatos.submitResultData(data, jatos.startNextComponent), or similar jatos.js functions that jump to a different component without leaving the fullscreen.

Isn't this what you want to achieve? I'm a bit unsure about your study layout?

So, it shouldn't be necessary to implement jatos.appendResultData (although I might do it anyway because it's not a lot of work). 

Best,
Kristian

--
You received this message because you are subscribed to the Google Groups "JATOS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jatos+un...@googlegroups.com.
To post to this group, send email to ja...@googlegroups.com.

Kristian Lange

unread,
Jul 3, 2017, 5:00:11 PM7/3/17
to Becky Gilbert, JATOS, Elisa Filevich
Hi again,
I thought about your issue again. Now I understand it better, I think. You want to start the components in full screen mode automatically via JS. This is indeed a problem and putting all in one component might be the best solution. In any case I'll work on the jatos.appendResultData function.
Best,
Kristian  

Becky Gilbert

unread,
Jul 4, 2017, 4:04:52 AM7/4/17
to JATOS, beckyann...@gmail.com, elisa.f...@gmail.com
Hi Kristian,

Yes, that's right. The appendResultData function would be great, if you get a chance. 

Thanks very much!
Becky

Kristian Lange

unread,
Jul 4, 2017, 5:10:58 PM7/4/17
to Becky Gilbert, JATOS, elisa.f...@gmail.com
Hi Becky,
I just released JATOS version 3.1.7 with the jatos.js function jatos.appendResultData.
Best
Kristian

Becky Gilbert

unread,
Jul 5, 2017, 3:56:26 AM7/5/17
to Kristian Lange, JATOS, Elisa Filevich
Hi Krisian,
Fantastic - thank you!
Becky


To unsubscribe from this group and stop receiving emails from it, send an email to jatos+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages