Assigning group number using subject ID


Author
Message
cast0095
cast0095
Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)
Group: Forum Members
Posts: 6, Visits: 34
Hi, 
I'm quite new to Inquisit and I was wondering if I could (re)assign group number at the start of an experiment using specific subject ID's contained in a list:

Define two lists of specific subject ID's
<list subID_A>
/ items = (2345, 4456, 6458, 6855)
</list>

<list subID_B>
/items = (1243, 5697, 8096, 9054)
</list>

But now is the part I'm not sure on as I don't think there is an 'any()' function in Inquisit
<values>
/if(groupnumber == any(subID_A))
/groupnumber = 1
/then(groupnumber == any(subID_B))
/groupnumber = 2
/else
/groupnumber = 3
</values>

Any help would be greatly appreciated!

Thanks,
Ben
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
cast0095 - Tuesday, May 9, 2017
Hi, 
I'm quite new to Inquisit and I was wondering if I could (re)assign group number at the start of an experiment using specific subject ID's contained in a list:

Define two lists of specific subject ID's
<list subID_A>
/ items = (2345, 4456, 6458, 6855)
</list>

<list subID_B>
/items = (1243, 5697, 8096, 9054)
</list>

But now is the part I'm not sure on as I don't think there is an 'any()' function in Inquisit
<values>
/if(groupnumber == any(subID_A))
/groupnumber = 1
/then(groupnumber == any(subID_B))
/groupnumber = 2
/else
/groupnumber = 3
</values>

Any help would be greatly appreciated!

Thanks,
Ben

Not sure I entirely understand the question / the intent, but this thread might be useful: https://www.millisecond.com/forums/FindPost19667.aspx

Perhaps this one, too: https://www.millisecond.com/forums/FindPost17599.aspx

Beyond that, I'd probably need a little more context such as what you would ultimately want to do with the re-assigned groupnumber (which isn't really the groupnumber).



Edited 7 Years Ago by Dave
cast0095
cast0095
Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)
Group: Forum Members
Posts: 6, Visits: 34
Dave - Tuesday, May 9, 2017
cast0095 - Tuesday, May 9, 2017
Hi, 
I'm quite new to Inquisit and I was wondering if I could (re)assign group number at the start of an experiment using specific subject ID's contained in a list:

Define two lists of specific subject ID's
<list subID_A>
/ items = (2345, 4456, 6458, 6855)
</list>

<list subID_B>
/items = (1243, 5697, 8096, 9054)
</list>

But now is the part I'm not sure on as I don't think there is an 'any()' function in Inquisit
<values>
/if(groupnumber == any(subID_A))
/groupnumber = 1
/then(groupnumber == any(subID_B))
/groupnumber = 2
/else
/groupnumber = 3
</values>

Any help would be greatly appreciated!

Thanks,
Ben

Not sure I entirely understand the question / the intent, but this thread might be useful: https://www.millisecond.com/forums/FindPost19667.aspx

Perhaps this one, too: https://www.millisecond.com/forums/FindPost17599.aspx

Beyond that, I'd probably need a little more context such as what you would ultimately want to do with the re-assigned groupnumber (which isn't really the groupnumber).



Thanks for the reply Dave, those threads are helpful although I'm doing something slightly different - In one of my tasks I have 4 different run conditions:
<expt>
/ preinstructions = (generalintro)
/ postinstructions = (generaloutro)
/ blocks = [e.g. block_order1]
/ subjects = (1 of 4)
/ groupassignment = groupnumber
/onexptend = [values.completed = 1]
</expt>

<expt>
/ preinstructions = (generalintro)
/ postinstructions = (generaloutro)
/ blocks = [e.g. block_order2]
/ subjects = (2 of 4)
/ groupassignment = groupnumber
/onexptend = [values.completed = 1]
</expt>

<expt>
/ preinstructions = (generalintro)
/ postinstructions = (generaloutro)
/ blocks = [block_order3]
/ subjects = (3 of 4)
/ groupassignment = groupnumber
/onexptend = [values.completed = 1]
</expt>

<expt>
/ preinstructions = (generalintro)
/ postinstructions = (generaloutro)
/ blocks = [block_order4]
/ subjects = (4 of 4)
/ groupassignment = groupnumber
/onexptend = [values.completed = 1]
</expt>

However, the way I have set up the batch file with other tasks in the experiment means that I need to counterbalance the block order within this individual task script.

As a result I want to change groupnumber depending on specific subject ID's (e.g if subID == matches any subject ID in list A of subID's then groupnumber = 1,
else subID == matches any subject ID in list B of subID's then groupnumber =  2 etc...) such that this task runs with particular counterbalancing rules.

Hope this makes sense, thanks for your help.



Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
cast0095 - Tuesday, May 9, 2017
Dave - Tuesday, May 9, 2017
cast0095 - Tuesday, May 9, 2017
Hi, 
I'm quite new to Inquisit and I was wondering if I could (re)assign group number at the start of an experiment using specific subject ID's contained in a list:

Define two lists of specific subject ID's
<list subID_A>
/ items = (2345, 4456, 6458, 6855)
</list>

<list subID_B>
/items = (1243, 5697, 8096, 9054)
</list>

But now is the part I'm not sure on as I don't think there is an 'any()' function in Inquisit
<values>
/if(groupnumber == any(subID_A))
/groupnumber = 1
/then(groupnumber == any(subID_B))
/groupnumber = 2
/else
/groupnumber = 3
</values>

Any help would be greatly appreciated!

Thanks,
Ben

Not sure I entirely understand the question / the intent, but this thread might be useful: https://www.millisecond.com/forums/FindPost19667.aspx

Perhaps this one, too: https://www.millisecond.com/forums/FindPost17599.aspx

Beyond that, I'd probably need a little more context such as what you would ultimately want to do with the re-assigned groupnumber (which isn't really the groupnumber).



Thanks for the reply Dave, those threads are helpful although I'm doing something slightly different - In one of my tasks I have 4 different run conditions:
<expt>
/ preinstructions = (generalintro)
/ postinstructions = (generaloutro)
/ blocks = [e.g. block_order1]
/ subjects = (1 of 4)
/ groupassignment = groupnumber
/onexptend = [values.completed = 1]
</expt>

<expt>
/ preinstructions = (generalintro)
/ postinstructions = (generaloutro)
/ blocks = [e.g. block_order2]
/ subjects = (2 of 4)
/ groupassignment = groupnumber
/onexptend = [values.completed = 1]
</expt>

<expt>
/ preinstructions = (generalintro)
/ postinstructions = (generaloutro)
/ blocks = [block_order3]
/ subjects = (3 of 4)
/ groupassignment = groupnumber
/onexptend = [values.completed = 1]
</expt>

<expt>
/ preinstructions = (generalintro)
/ postinstructions = (generaloutro)
/ blocks = [block_order4]
/ subjects = (4 of 4)
/ groupassignment = groupnumber
/onexptend = [values.completed = 1]
</expt>

However, the way I have set up the batch file with other tasks in the experiment means that I need to counterbalance the block order within this individual task script.

As a result I want to change groupnumber depending on specific subject ID's (e.g if subID == matches any subject ID in list A of subID's then groupnumber = 1,
else subID == matches any subject ID in list B of subID's then groupnumber =  2 etc...) such that this task runs with particular counterbalancing rules.

Hope this makes sense, thanks for your help.



Okay, thanks. That's not possible -- you cannot re-assign or change the groupnumber once the thing has started, and specifically you can't do condition assignment based on a <value> like that.

cast0095
cast0095
Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)
Group: Forum Members
Posts: 6, Visits: 34
Dave - Wednesday, May 10, 2017
cast0095 - Tuesday, May 9, 2017
Dave - Tuesday, May 9, 2017
cast0095 - Tuesday, May 9, 2017
Hi, 
I'm quite new to Inquisit and I was wondering if I could (re)assign group number at the start of an experiment using specific subject ID's contained in a list:

Define two lists of specific subject ID's
<list subID_A>
/ items = (2345, 4456, 6458, 6855)
</list>

<list subID_B>
/items = (1243, 5697, 8096, 9054)
</list>

But now is the part I'm not sure on as I don't think there is an 'any()' function in Inquisit
<values>
/if(groupnumber == any(subID_A))
/groupnumber = 1
/then(groupnumber == any(subID_B))
/groupnumber = 2
/else
/groupnumber = 3
</values>

Any help would be greatly appreciated!

Thanks,
Ben

Not sure I entirely understand the question / the intent, but this thread might be useful: https://www.millisecond.com/forums/FindPost19667.aspx

Perhaps this one, too: https://www.millisecond.com/forums/FindPost17599.aspx

Beyond that, I'd probably need a little more context such as what you would ultimately want to do with the re-assigned groupnumber (which isn't really the groupnumber).



Thanks for the reply Dave, those threads are helpful although I'm doing something slightly different - In one of my tasks I have 4 different run conditions:
<expt>
/ preinstructions = (generalintro)
/ postinstructions = (generaloutro)
/ blocks = [e.g. block_order1]
/ subjects = (1 of 4)
/ groupassignment = groupnumber
/onexptend = [values.completed = 1]
</expt>

<expt>
/ preinstructions = (generalintro)
/ postinstructions = (generaloutro)
/ blocks = [e.g. block_order2]
/ subjects = (2 of 4)
/ groupassignment = groupnumber
/onexptend = [values.completed = 1]
</expt>

<expt>
/ preinstructions = (generalintro)
/ postinstructions = (generaloutro)
/ blocks = [block_order3]
/ subjects = (3 of 4)
/ groupassignment = groupnumber
/onexptend = [values.completed = 1]
</expt>

<expt>
/ preinstructions = (generalintro)
/ postinstructions = (generaloutro)
/ blocks = [block_order4]
/ subjects = (4 of 4)
/ groupassignment = groupnumber
/onexptend = [values.completed = 1]
</expt>

However, the way I have set up the batch file with other tasks in the experiment means that I need to counterbalance the block order within this individual task script.

As a result I want to change groupnumber depending on specific subject ID's (e.g if subID == matches any subject ID in list A of subID's then groupnumber = 1,
else subID == matches any subject ID in list B of subID's then groupnumber =  2 etc...) such that this task runs with particular counterbalancing rules.

Hope this makes sense, thanks for your help.



Okay, thanks. That's not possible -- you cannot re-assign or change the groupnumber once the thing has started, and specifically you can't do condition assignment based on a <value> like that.

No worries, I've ended up using the solution in the first link you had provided by creating a few helper scripts with the element <include> /precondition.

Thanks for your help Dave.
cast0095
cast0095
Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)
Group: Forum Members
Posts: 6, Visits: 34
cast0095 - Wednesday, May 10, 2017
Dave - Wednesday, May 10, 2017
cast0095 - Tuesday, May 9, 2017
Dave - Tuesday, May 9, 2017
cast0095 - Tuesday, May 9, 2017
Hi, 
I'm quite new to Inquisit and I was wondering if I could (re)assign group number at the start of an experiment using specific subject ID's contained in a list:

Define two lists of specific subject ID's
<list subID_A>
/ items = (2345, 4456, 6458, 6855)
</list>

<list subID_B>
/items = (1243, 5697, 8096, 9054)
</list>

But now is the part I'm not sure on as I don't think there is an 'any()' function in Inquisit
<values>
/if(groupnumber == any(subID_A))
/groupnumber = 1
/then(groupnumber == any(subID_B))
/groupnumber = 2
/else
/groupnumber = 3
</values>

Any help would be greatly appreciated!

Thanks,
Ben

Not sure I entirely understand the question / the intent, but this thread might be useful: https://www.millisecond.com/forums/FindPost19667.aspx

Perhaps this one, too: https://www.millisecond.com/forums/FindPost17599.aspx

Beyond that, I'd probably need a little more context such as what you would ultimately want to do with the re-assigned groupnumber (which isn't really the groupnumber).



Thanks for the reply Dave, those threads are helpful although I'm doing something slightly different - In one of my tasks I have 4 different run conditions:
<expt>
/ preinstructions = (generalintro)
/ postinstructions = (generaloutro)
/ blocks = [e.g. block_order1]
/ subjects = (1 of 4)
/ groupassignment = groupnumber
/onexptend = [values.completed = 1]
</expt>

<expt>
/ preinstructions = (generalintro)
/ postinstructions = (generaloutro)
/ blocks = [e.g. block_order2]
/ subjects = (2 of 4)
/ groupassignment = groupnumber
/onexptend = [values.completed = 1]
</expt>

<expt>
/ preinstructions = (generalintro)
/ postinstructions = (generaloutro)
/ blocks = [block_order3]
/ subjects = (3 of 4)
/ groupassignment = groupnumber
/onexptend = [values.completed = 1]
</expt>

<expt>
/ preinstructions = (generalintro)
/ postinstructions = (generaloutro)
/ blocks = [block_order4]
/ subjects = (4 of 4)
/ groupassignment = groupnumber
/onexptend = [values.completed = 1]
</expt>

However, the way I have set up the batch file with other tasks in the experiment means that I need to counterbalance the block order within this individual task script.

As a result I want to change groupnumber depending on specific subject ID's (e.g if subID == matches any subject ID in list A of subID's then groupnumber = 1,
else subID == matches any subject ID in list B of subID's then groupnumber =  2 etc...) such that this task runs with particular counterbalancing rules.

Hope this makes sense, thanks for your help.



Okay, thanks. That's not possible -- you cannot re-assign or change the groupnumber once the thing has started, and specifically you can't do condition assignment based on a <value> like that.

No worries, I've ended up using the solution in the first link you had provided by creating a few helper scripts with the element <include> /precondition.

Thanks for your help Dave.

Hi again Dave, 

I'm still having a bit of trouble with the script, this is my main launch script:

<values>
/ subIDtrialorder1 = ",1752,3693,3624,5341,1728,9525,7814,5745,5978,5269,9582,3427,6822,8275,6824,3425,9234,8263,6894,3455,6742,8579,3852,9213,1632,9263,5926,3641,7642,4835,2894,1367,7618,7963,2976,5923,4826,2641,7132,6527,6214,3147,5792,4397,4692,4721,6294,3783,9232,9165,3762,5191,2752,5713,5692,7263,2358,5623,9624,9527,"

/ subIDtrialorder2 = ",6952,9635,9168,8439,5982,2875,9846,7481,1726,4953,7344,9637,8432,7153,7896,1753,7984,3525,8922,1829,8394,3879,5946,1345,4974,9385,6974,6931,6534,1897,4532,1835,7264,8567,8572,3811,4828,6251,9612,5237,7416,6739,8244,3753,1256,5239,7314,8755,2632,8379,1784,1561,1872,4697,4728,4839,9622,8731,2384,5297,"
/ normalizedid = ""
</values>

<expressions>
/ normalizedid = values.normalizedid = toupper(concat(concat(",", script.subjectid), ","));
</expressions>

<include>
/ precondition = [if(contains(values.subIDtrialorder1, values.normalizedid)), file = "batch_taskorder1.iqx"]
</include>

<include>
/ precondition = [if(contains(values.subIDtrialorder2, values.normalizedid)), file = "batch_taskorder2.iqx"]
</include>

However when I run it it says "Expression 'values.subIDtaskorder1' is invalid. Expression contains an unknown element or property name" - any thoughts on why this may be? 

Thanks again,

Ben



Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
cast0095 - Thursday, May 11, 2017

Hi again Dave, 

I'm still having a bit of trouble with the script, this is my main launch script:

<values>
/ subIDtrialorder1 = ",1752,3693,3624,5341,1728,9525,7814,5745,5978,5269,9582,3427,6822,8275,6824,3425,9234,8263,6894,3455,6742,8579,3852,9213,1632,9263,5926,3641,7642,4835,2894,1367,7618,7963,2976,5923,4826,2641,7132,6527,6214,3147,5792,4397,4692,4721,6294,3783,9232,9165,3762,5191,2752,5713,5692,7263,2358,5623,9624,9527,"

/ subIDtrialorder2 = ",6952,9635,9168,8439,5982,2875,9846,7481,1726,4953,7344,9637,8432,7153,7896,1753,7984,3525,8922,1829,8394,3879,5946,1345,4974,9385,6974,6931,6534,1897,4532,1835,7264,8567,8572,3811,4828,6251,9612,5237,7416,6739,8244,3753,1256,5239,7314,8755,2632,8379,1784,1561,1872,4697,4728,4839,9622,8731,2384,5297,"
/ normalizedid = ""
</values>

<expressions>
/ normalizedid = values.normalizedid = toupper(concat(concat(",", script.subjectid), ","));
</expressions>

<include>
/ precondition = [if(contains(values.subIDtrialorder1, values.normalizedid)), file = "batch_taskorder1.iqx"]
</include>

<include>
/ precondition = [if(contains(values.subIDtrialorder2, values.normalizedid)), file = "batch_taskorder2.iqx"]
</include>

However when I run it it says "Expression 'values.subIDtaskorder1' is invalid. Expression contains an unknown element or property name" - any thoughts on why this may be? 

Thanks again,

Ben



For one thing, the syntax in your <include> elements is invalid. That, however, is ultimately irrelevant because you can't use <expressions> or <values> in an <include>'s /precondition. What <include> effectively does is paste the contents of one file into another. <include> is parsed (and has to be) pretty much at the very start, *before* any other elements such as <expressions> or <values>, i.e. its /precondition does not "know" about those.

You'll have to reformulate as show in the post I linked earlier ( https://www.millisecond.com/forums/Topic19661.aspx#bm19667 ), i.e. the first <include> should read

<include>
/ precondition = [script.subjectid == "1752" || script.subjectid == "3693" || script.subjectid == "3624" || ...]
/ file = "batch_taskorder1.iqx"
</include>

and the one for ""batch_taskorder2.iqx" analogously.


cast0095
cast0095
Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)
Group: Forum Members
Posts: 6, Visits: 34
Thanks Dave,

I should have said that I had tried that method, however due to the limitations you mentioned here https://www.millisecond.com/forums/Topic8594.aspx#bm8598 with the include element being overwhelmed (I think in this case by too many expressions in the /precondition attribute, i.e. around 60 script.subjectid == "xxxx" expressions).

Please disregard my last post as I've now worked around these limitations by splitting the number of /precondition expressions into another include element i.e:

<include>
/ precondition = [script.subjectid == "xxxx".... 30 of these elements ]
/ file = "batch_taskorder1.iqx"
</include>

<include>
/ precondition = [script.subjectid == "1752"... the other 30 elements]
/ file = "batch_taskorder1.iqx"
</include>

<include>
/ precondition = [script.subjectid == "xxxx".... 30 of these elements ]
/ file = "batch_taskorder2.iqx"
</include>

<include>
/ precondition = [script.subjectid == "1752"... the other 30 elements]
/ file = "batch_taskorder2.iqx"
</include>

This is all working well now, however I've encountered another problem: the <batch> scripts that are referenced from the <include> elements (e.g. / file = "batch_taskorder1.iqx") are not executing.

When I run the above <include> script, it extracts elements from the appropriate <batch> script, however the <batch> script does not run.

When I reference an individual task script in the <include> element as you said in your last post (https://www.millisecond.com/forums/Topic19661.aspx#bm19667) it works, however due to the way I am counterbalancing I need it to reference a batch script.

Any thoughts on this? I've attached the <include> script (start_script_include) and the batch scripts for reference.

Thanks once again!


Attachments
start_script_include.iqx (645 views, 5.00 KB)
batch_taskorder1.iqx (632 views, 373 bytes)
batch_taskorder2.iqx (605 views, 374 bytes)
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
cast0095 - Thursday, May 11, 2017
Thanks Dave,

I should have said that I had tried that method, however due to the limitations you mentioned here https://www.millisecond.com/forums/Topic8594.aspx#bm8598 with the include element being overwhelmed (I think in this case by too many expressions in the /precondition attribute, i.e. around 60 script.subjectid == "xxxx" expressions).

Please disregard my last post as I've now worked around these limitations by splitting the number of /precondition expressions into another include element i.e:

<include>
/ precondition = [script.subjectid == "xxxx".... 30 of these elements ]
/ file = "batch_taskorder1.iqx"
</include>

<include>
/ precondition = [script.subjectid == "1752"... the other 30 elements]
/ file = "batch_taskorder1.iqx"
</include>

<include>
/ precondition = [script.subjectid == "xxxx".... 30 of these elements ]
/ file = "batch_taskorder2.iqx"
</include>

<include>
/ precondition = [script.subjectid == "1752"... the other 30 elements]
/ file = "batch_taskorder2.iqx"
</include>

This is all working well now, however I've encountered another problem: the <batch> scripts that are referenced from the <include> elements (e.g. / file = "batch_taskorder1.iqx") are not executing.

When I run the above <include> script, it extracts elements from the appropriate <batch> script, however the <batch> script does not run.

When I reference an individual task script in the <include> element as you said in your last post (https://www.millisecond.com/forums/Topic19661.aspx#bm19667) it works, however due to the way I am counterbalancing I need it to reference a batch script.

Any thoughts on this? I've attached the <include> script (start_script_include) and the batch scripts for reference.

Thanks once again!


Sorry, you can't <include> <batch>-scripts. <batch> scripts work somewhat differently than regular / "actual" scripts -- they control the execution of regular scripts -- and hence run in a different "control thread" if you will. You basically can't start (another) such control thread once you're in the "regular" script execution thread, which is where "start_script_include.iqx" is executed.

I know this is frustrating.

Going back to your 2nd post ( https://www.millisecond.com/forums/FindPost21536.aspx ), your concern was that you couldn't use the groupnumber for <batch> condition assignment because one of the scripts run by the <batch> elements also relies on the groupnumber to counterbalance block order. It is not strictly true that this precludes using groupnumber in <batch>es. You can put

// order 1
<batch>
/ subjects = (1,2,3,4 of 8)
/ groupassignment = groupnumber
/ file = "a.iqx"
/ file = "b.iqx"
/ file = "c.iqx"
</batch>

// order 2
<batch>
/ subjects = (5,6,7,8 of 8)
/ groupassignment = groupnumber
/ file = "b.iqx"
/ file = "c.iqx"
/ file = "a.iqx"
</batch>

in a single batch script file. This will ensure that the scripts run by the respective batches *also* get varying groupnumbers and hence can counterbalance blocks and the like based on the groupnumber. More on how condition assignment works mathematically is here: https://www.millisecond.com/forums/Topic13856.aspx

Would that approach help / solve the problem?


cast0095
cast0095
Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)Partner Member (771 reputation)
Group: Forum Members
Posts: 6, Visits: 34
Dave - Thursday, May 11, 2017
cast0095 - Thursday, May 11, 2017
Thanks Dave,

I should have said that I had tried that method, however due to the limitations you mentioned here https://www.millisecond.com/forums/Topic8594.aspx#bm8598 with the include element being overwhelmed (I think in this case by too many expressions in the /precondition attribute, i.e. around 60 script.subjectid == "xxxx" expressions).

Please disregard my last post as I've now worked around these limitations by splitting the number of /precondition expressions into another include element i.e:

<include>
/ precondition = [script.subjectid == "xxxx".... 30 of these elements ]
/ file = "batch_taskorder1.iqx"
</include>

<include>
/ precondition = [script.subjectid == "1752"... the other 30 elements]
/ file = "batch_taskorder1.iqx"
</include>

<include>
/ precondition = [script.subjectid == "xxxx".... 30 of these elements ]
/ file = "batch_taskorder2.iqx"
</include>

<include>
/ precondition = [script.subjectid == "1752"... the other 30 elements]
/ file = "batch_taskorder2.iqx"
</include>

This is all working well now, however I've encountered another problem: the <batch> scripts that are referenced from the <include> elements (e.g. / file = "batch_taskorder1.iqx") are not executing.

When I run the above <include> script, it extracts elements from the appropriate <batch> script, however the <batch> script does not run.

When I reference an individual task script in the <include> element as you said in your last post (https://www.millisecond.com/forums/Topic19661.aspx#bm19667) it works, however due to the way I am counterbalancing I need it to reference a batch script.

Any thoughts on this? I've attached the <include> script (start_script_include) and the batch scripts for reference.

Thanks once again!


Sorry, you can't <include> <batch>-scripts. <batch> scripts work somewhat differently than regular / "actual" scripts -- they control the execution of regular scripts -- and hence run in a different "control thread" if you will. You basically can't start (another) such control thread once you're in the "regular" script execution thread, which is where "start_script_include.iqx" is executed.

I know this is frustrating.

Going back to your 2nd post ( https://www.millisecond.com/forums/FindPost21536.aspx ), your concern was that you couldn't use the groupnumber for <batch> condition assignment because one of the scripts run by the <batch> elements also relies on the groupnumber to counterbalance block order. It is not strictly true that this precludes using groupnumber in <batch>es. You can put

// order 1
<batch>
/ subjects = (1,2,3,4 of 8)
/ groupassignment = groupnumber
/ file = "a.iqx"
/ file = "b.iqx"
/ file = "c.iqx"
</batch>

// order 2
<batch>
/ subjects = (5,6,7,8 of 8)
/ groupassignment = groupnumber
/ file = "b.iqx"
/ file = "c.iqx"
/ file = "a.iqx"
</batch>

in a single batch script file. This will ensure that the scripts run by the respective batches *also* get varying groupnumbers and hence can counterbalance blocks and the like based on the groupnumber. More on how condition assignment works mathematically is here: https://www.millisecond.com/forums/Topic13856.aspx

Would that approach help / solve the problem?


Ok that's a shame - I thought I nearly had it there!

I'm not sure that solution would work - I've attached my counterbalancing sheet with the issues I will have if I try to counterbalance one of my tasks (Task2) with a sequential groupnumber - effectively I've got 8 different conditions (looking at the combinations of Task_order and Task2_version in the sheet) with 6 participants in each condition.

I could write 8 different batch files 

// Task_order_1 Task2_Version1
<batch>
/ subjects = (1,2,3,4,5,6 of 48)
/ groupassignment = groupnumber
/ file = "Task1.iqx"
/ file = "Task2_version1.iqx"
/ file = "Task3.iqx"
</batch>

// Task_order_2 Task2_Version1
<batch>
/ subjects = (7,8,9,10,11,12 of 48)
/ groupassignment = groupnumber
/ file = "Task1.iqx"
/ file = "Task3.iqx"
/ file = "Task2_version1.iqx"
</batch>

// Task_order_1 Task2_Version2
<batch>
/ subjects = (13,14,15,16,17,18 of 48)
/ groupassignment = groupnumber
/ file = "Task1.iqx"
/ file = "Task2_version2.iqx"
/ file = "Task3.iqx"
</batch>

etc... but then I'd be worried that if for some reason one administration of the web experiment didn't work/crashed and had to be done again, the subsequent groupnumber (i.e. the groupnumber on readministration of the task) would  not match up with the appropriate counterbalancing groupnumber (as it would be  correct groupnumber +1) - is this correct?

As a result I've decided to go for the manual option and pass the appropriate groupnumber for Task2 (read from the counterbalancing sheet) through the URL parameter on the web script.

Thanks for all of your help. 
Attachments
Counterbalanced_tasks.xlsx (267 views, 18.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search