Data file ends with comma instead of square bracket
Hi,
I have runed some task online with JATOS built with OSweb.
All data from 'FINISHED' runs ends with a comma instead of closing the square bracket that is the first symbol in the file.
For example:
[{"ID":" ... "width":1024},
If I change the last comma to a square bracket I can parse the file as a json.
I have a logger at the end of a loop block set to log all variables.
Dose any one know why my data files are like this?
Comments
Hi, that sounds more like an OpenSesame/OSWeb issue. JATOS just stores whatever text it gets in the database or file system. I will move your question in their category.
Best,
Kristian
Thanks kri!
I should add that this is on OSweb 2.0.1.0 and I have not tested this on the latest OSweb.
Hi @sebastiaan, do you know whats is happening here?
@SpacePenguins OSWeb incrementally logs data during the experiment, in which case it has the kind of incomplete JSON format that you are describing. This is to make sure that not all data is lost when the experiment doesn't finish. However, when the experiment does finish, all data is sent again, overwriting the incomplete JSON with a valid JSON object that also includes some context information (about the browser etc.).
In your case this last step apparently doesn't happen, and I'm not sure why. One thing that comes to mind is that you explicitly end the JATOS session in an
inline_javascriptitem, thus bypassing the final data transfer that OSWeb normally does. Could that be it?Check out SigmundAI.eu for our OpenSesame AI assistant!
@sebastiaan Thank you, this is correct. I have a javascript that ends the study in jatos and redirect to a nother url.
jatos.endStudyAndRedirect(url);Is there another way of doing this and get a complete data file?
Is there another way of doing this and get a complete data file?
@SpacePenguins Not really, but it may not be necessary.
In principle, you have all the data, even if the JSON is invalid. The only thing that is missing is "context" information, which refers to browser information etc. In many cases, this information is not of interest anyway, and if it is you could explicitly get this information in the experiment and assign it to variables so that it will be logged as a regular variables.
Alternatively, you can use the regular end-redirect URL as specified in OSWeb/ JATOS. The only reason not to use this that I can think of is when you flexibly determine the URL in a script during the experiment.
Check out SigmundAI.eu for our OpenSesame AI assistant!
The only reason not to use this that I can think of is when you flexibly determine the URL in a script during the experiment.
@sebastiaan This is what I'm doing. Participant first fill in a questionnaire in REDCap, then get a link to one of the tasks, the link includes a URL query parameter with a unique URL that i fetch with:
And then use as argument in:
JATOS actually has a mechanism for this. You can include references to URL parameters that the task was started with in the end-redirect URL using
[this_notation]:Check out SigmundAI.eu for our OpenSesame AI assistant!
Thanks sebastiaan! I missed that I could use variables in the End Redirect URL filed.