-
We collect demographic data using the What do I need to do to get this to work there?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I have always been curious as to how exactly cognition.run approaches the saving of data, as there is no additional code that you need to add in order for that to work. So without knowing that I am not really sure what the answer to this issue would be. Where in the timeline of your experiment do you have the demographics? One thing I noticed is that cognition.run saves on a trial by trial basis, so it would make sense that you do not see the data added at least for trials before the demographics form. One thing I would try is create an on_finish() function for a specific trial and add some dummy data just to see if that is handled (see here). |
Beta Was this translation helpful? Give feedback.
@ChristopheBossens Thanks for this. Yes, it seems that it is saving data trial by trial, which would account for the data not being written using the experiment level
on_finish
parameter. Experimenting a bit, it seems that if I simply add my function to theon_finish
parameter of the demographic trial itself, it correctly adds the date to each subsequent trial. The key phrase in the documentation ofjsPsych.data.addProperties
(which I hadn't noticed before) is (emphasis mine):This means that my demographic trial can simply be: