If you leave the `possible subject numbers` field empty in the osweb extension then the jatos component result ID will be used as the subject_nr. You should be able to set the worker ID yourself at the start of your experiment using an inline_javascript containing:
Point 2 is a bit more difficult. You can supply the subject_nr as an URL parameter (e.g. yourjatosserver.com/publix/etc/etc?subject_nr=123 ) but I don't know how to do this from within another component. Maybe @kri knows this?
I agree with Daniel, the Study Session can be used in this case to transfer information from one component to another. And the example Daniel gave is perfect ;)
Unfortunately that solution doesn't work for me. I included the following line into the first line of the prepare phase of the counterbalancing- inline java script:
But OS Web (1.3.13.0) just ignores it and continues using the "default ID", which is the componentResultId.
Since my experiment consists of two parts and the OSWeb-part is the second one, it always gets an even componentResultId and therefore an even subject_nr. So the counterbalancing doesn't work.
My rather suboptimal solution for that problem was to modify the corresponding line in jatos.js from
let subject_nr = jatos.componentResultId
to
let subject_nr = jatos.studyResultId
But I rather not modify the jatos.js and would really prefer to have it all done in OSWeb. So I was wondering, where that problem might come from.
Comments
Hi @drorgarbi
If you leave the `possible subject numbers` field empty in the osweb extension then the jatos component result ID will be used as the subject_nr. You should be able to set the worker ID yourself at the start of your experiment using an inline_javascript containing:
(or any other ID described on http://www.jatos.org/jatos.js-Reference.html#ids).
Point 2 is a bit more difficult. You can supply the subject_nr as an URL parameter (e.g.
yourjatosserver.com/publix/etc/etc?subject_nr=123) but I don't know how to do this from within another component. Maybe @kri knows this?the inline script works great, now I just need to understard how to do the same on lab.js / find out the solution to point 2
thanks
Dror
I just thought of something. Jatos also allows you to set session variables, see http://www.jatos.org/jatos.js-Reference.html#studys-session-data. What if you create such a session variable in the lab.js script, e.g.:
and then in osweb (similar to the first solution):
That way, you should be able to transfer the subject_id variable across components.
I agree with Daniel, the Study Session can be used in this case to transfer information from one component to another. And the example Daniel gave is perfect ;)
Best,
Kristian
Hey there.
Unfortunately that solution doesn't work for me. I included the following line into the first line of the prepare phase of the counterbalancing- inline java script:
But OS Web (1.3.13.0) just ignores it and continues using the "default ID", which is the componentResultId.
Since my experiment consists of two parts and the OSWeb-part is the second one, it always gets an even componentResultId and therefore an even subject_nr. So the counterbalancing doesn't work.
My rather suboptimal solution for that problem was to modify the corresponding line in jatos.js from
let subject_nr = jatos.componentResultIdto
let subject_nr = jatos.studyResultIdBut I rather not modify the jatos.js and would really prefer to have it all done in OSWeb. So I was wondering, where that problem might come from.
Thanks, Wolf