By jparong - 4/1/2020
I am trying to run a batch script and assign files based on participant ID and session number. I want to have all participants do the tasks in session 1, split the groups to do 2 different versions of tasks in session 2 with odd participant IDs doing version A and even participant IDs doing version B, and then all participants would do all the tasks again in session 3. I tried the script below and it doesn't seem to work. Any advice would be very appreciated! Thanks!
<batch Task1> / sessions = (1 of 3) / file="Task1.iqx" </batch> <batch Task2A> / subjects = (1 of 2) / sessions = (2 of 3) / file="Task2A.iqx" </batch>
<batch Task2B> / subjects = (2 of 2) / sessions = (2 of 3) / file="Task2B.iqx" </batch>
<batch Task3> / sessions = (3 of 3) / file="Task3.iqx" </batch>
|
By Dave - 4/1/2020
+xI am trying to run a batch script and assign files based on participant ID and session number. I want to have all participants do the tasks in session 1, split the groups to do 2 different versions of tasks in session 2 with odd participant IDs doing version A and even participant IDs doing version B, and then all participants would do all the tasks again in session 3. I tried the script below and it doesn't seem to work. Any advice would be very appreciated! Thanks! <batch Task1> / sessions = (1 of 3) / file="Task1.iqx" </batch> <batch Task2A> / subjects = (1 of 2) / sessions = (2 of 3) / file="Task2A.iqx" </batch> <batch Task2B> / subjects = (2 of 2) / sessions = (2 of 3) / file="Task2B.iqx" </batch> <batch Task3> / sessions = (3 of 3) / file="Task3.iqx" </batch> The way you've defined the <batch> elements,
<batch Task2A> / subjects = (1 of 2) / sessions = (2 of 3) / file="Task2A.iqx" </batch>
will be executed if either
/ subjects = (1 of 2)
is true (i.e. the subject number is odd), or
/ sessions = (2 of 3)
is true., or both.
The way to do this, then, is to simply define three sessions
<batch Task1> / sessions = (1 of 3) / file="Task1.iqx" </batch>
<batch Task2> / sessions = (2 of 3) / file="Task2.iqx" </batch>
<batch Task3> / sessions = (3 of 3) / file="Task3.iqx" </batch>
and have "Task2.iqx" be a simple shim that runs either version A or version B based on the subject number being odd vs even:
<include> / precondition = [ mod(script.subjectid, 2) == 1; ] / file = "task2a.iqx" </include>
<include> / precondition = [ mod(script.subjectid, 2) == 0; ] / file = "task2b.iqx" </include>
|
By jparong - 4/1/2020
+x+xI am trying to run a batch script and assign files based on participant ID and session number. I want to have all participants do the tasks in session 1, split the groups to do 2 different versions of tasks in session 2 with odd participant IDs doing version A and even participant IDs doing version B, and then all participants would do all the tasks again in session 3. I tried the script below and it doesn't seem to work. Any advice would be very appreciated! Thanks! <batch Task1> / sessions = (1 of 3) / file="Task1.iqx" </batch> <batch Task2A> / subjects = (1 of 2) / sessions = (2 of 3) / file="Task2A.iqx" </batch> <batch Task2B> / subjects = (2 of 2) / sessions = (2 of 3) / file="Task2B.iqx" </batch> <batch Task3> / sessions = (3 of 3) / file="Task3.iqx" </batch> The way you've defined the <batch> elements, <batch Task2A> / subjects = (1 of 2) / sessions = (2 of 3) / file="Task2A.iqx" </batch> will be executed if either/ subjects = (1 of 2) is true (i.e. the subject number is odd) , or/ sessions = (2 of 3) is true., or both. The way to do this, then, is to simply define three sessions <batch Task1> / sessions = (1 of 3) / file="Task1.iqx" </batch> <batch Task2> / sessions = (2 of 3) / file="Task2.iqx" </batch> <batch Task3> / sessions = (3 of 3) / file="Task3.iqx" </batch> and have "Task2.iqx" be a simple shim that runs either version A or version B based on the subject number being odd vs even: <include> / precondition = [ mod(script.subjectid, 2) == 1; ] / file = "task2a.iqx" </include> <include> / precondition = [ mod(script.subjectid, 2) == 0; ] / file = "task2b.iqx" </include> Thank you for the quick reply, Dave!
|
|