Millisecond Forums

batch script with dropdown branches

https://forums.millisecond.com/Topic31210.aspx

By troyh - 3/30/2021

Hello,

I cannot seem to get my branch scripts to abort if they are not selected from a dropdown menu. This is my starting script 

<parameters>
/ id = 0
</parameters>

<values>
/ id_selected = 0
</values>

<batch select>
/ file = "branchesnew1_3.iqx"

/ file = "3.1_5f9c35.iqx"
/ file = "3.1_5f023.iqx"
/ file = "1.1_601017ce4.iqx"
/ file = "1.1_5e2cbee9.iqx"
/ file = "1.1_5e8b4f9.iqx"
/ file = "3.1_60365d8.iqx"
/ file = "1.1_60478deac0.iqx"
/ file = "1.1_5eb8fff8.iqx"
/ file = "3.1_57c975.iqx"
/ file = "3.1_5c923.iqx"
/ file = "3.1_5fb3e1.iqx"
/ file = "3.1_5c122.iqx"
/ file = "3.1_5ce3de.iqx"
/ file = "3.1_6050ae.iqx"
/ file = "1.1_5f8c6949.iqx"
/ file = "1.1_5bfee33.iqx"
/ file = "3.1_5ea9f38.iqx"
/ file = "1.1_56ad0e4.iqx"
/ file = "1.1_59b4235.iqx"
/ file = "1.1_577ff17.iqx"
/ file = "1.1_5f807.iqx"
/ file = "1.1_5fac746.iqx"
/ file = "1.1_600568e9.iqx"
/ file = "1.1_59431391f2.iqx"
/ file = "1.1_601a7c9.iqx"
/ file = "3.1_5e7cd.iqx"
/ file = "3.1_5ea944.iqx"
/ file = "3.1_5ef2359.iqx"
/ file = "3.1_5d02c0.iqx"
/ file = "3.1_5f11e7.iqx"
/ file = "3.1_5fbae8.iqx"
/ file = "1.1_5efddc13.iqx"
/ file = "3.1_60461fc.iqx"
/ file = "3.1_6009eec.iqx"
/ file = "3.1_602b4.iqx"
/ file = "1.1_5ae5e66.iqx"
/ file = "1.1_5c6c403.iqx"
/ file = "1.1_5ce475.iqx"
/ file = "1.1_5bb179.iqx"
/ file = "1.1_5d29f1.iqx"

/ onscriptend = [
  if (batch.select.currentscript == "branchesnew1_3.iqx")
  {
   parameters.id = values.id_selected;
  }
]
</batch>


And this is the dropdown menu script

<parameters>
/ id = 0
</parameters>

<values>
/ id_selected = 0
</values>

%%%%%% ID
<text ID>
/items = ("Please enter your Prolific ID")
/position = (50%,40%)
</text>
<openended ID>
/ stimulusframes = [1=ID]
/ charlimit = 24

</openended>

<block selectidblock>
/ trials = [1=ID; 2=selectidpage]
</block>

<surveypage selectidpage>
/ ontrialend = [
  values.id_selected = dropdown.selectid.response;
]
/ questions = [1=selectid]
/ showpagenumbers = false
/ showquestionnumbers = false
</surveypage>

<dropdown selectid>
/ caption = "Please select your Prolific ID:"
/ options = ("6060fb525f262e237d167361","5c8d085a22f8f10014babf95","5fcffa471347ca01dd6ab937","603c956b3d9b16a4d297b71b","600f52c7dde4b5127f1f859e","5fb45df6ce203a13f34ac0af","5f2b2eb9d41fa153c81892ad","5f6bc58e1ee0b612c95a5ff3","604bd866aaf76cee7a7af909","5f85a0538f44f02584cd474","5fcd4d3784c8d41e341236d2","5fb005bcce940732eca0ec62","57f95ac9b603d900019460e6","5d43c42599f83a00152ba604","5c7ceb3a419b560001020f61","5c021b989b7d4e0001aa764e","594c69ee4b07c400013aa466","5f00b01d61fa111d7796e996","5bb6faf4f6d0bd00019e12f4","59f8a0bbf4217300016cc405","5f2e0bc767a4ed17d55942c7","6060a03527b618b6b8bcb298","5ce0c380d0ac7b001c8795c4","58c565298a3f870001c0e70d","55c11e44fdf99b545042e732","6039069d982298e730d4f35","601d1a51f8ab7f060c6638fe","6060cc2bf9ba38d90b1a6f12","600701b8ea617912572d9ccd","5b6b6e1d1f93bf000173b2c0","605de3af48d7a575adb95b09","5bc65ab6fc5fdb0001409196","5f6dfe80423f152bb7a96a6f","5ec5faacab872c67dfb0f505","5f36b3370303960ad419ba9a","5e8fc651d1aa0d2ba33717c9","5f178795ec2e75000daaaa09","5ea04bf0549a55078a07eb5d","58b2eb375b64db00017f5bf8","601785dd817de29d1f1cf000")
/ optionvalues = ("1", "2", "3", "4", "5", "6", "7", "8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40")
</dropdown>

And, in <expt> for each script, I have /onexptbegin = [ if(parameters.id != e.g.#) script.abort(false); values.id_selected = e.g.# ;

The problem is that no matter which value I select from the dropdown, all the scripts are run in sequence. Any help would be so much appreciated!

I attached a zip folder (i believe).
By Dave - 3/30/2021

troyh - 3/30/2021
Hello,

I cannot seem to get my branch scripts to abort if they are not selected from a dropdown menu. This is my starting script 

<parameters>
/ id = 0
</parameters>

<values>
/ id_selected = 0
</values>

<batch select>
/ file = "branchesnew1_3.iqx"

/ file = "3.1_5f9c35.iqx"
/ file = "3.1_5f023.iqx"
/ file = "1.1_601017ce4.iqx"
/ file = "1.1_5e2cbee9.iqx"
/ file = "1.1_5e8b4f9.iqx"
/ file = "3.1_60365d8.iqx"
/ file = "1.1_60478deac0.iqx"
/ file = "1.1_5eb8fff8.iqx"
/ file = "3.1_57c975.iqx"
/ file = "3.1_5c923.iqx"
/ file = "3.1_5fb3e1.iqx"
/ file = "3.1_5c122.iqx"
/ file = "3.1_5ce3de.iqx"
/ file = "3.1_6050ae.iqx"
/ file = "1.1_5f8c6949.iqx"
/ file = "1.1_5bfee33.iqx"
/ file = "3.1_5ea9f38.iqx"
/ file = "1.1_56ad0e4.iqx"
/ file = "1.1_59b4235.iqx"
/ file = "1.1_577ff17.iqx"
/ file = "1.1_5f807.iqx"
/ file = "1.1_5fac746.iqx"
/ file = "1.1_600568e9.iqx"
/ file = "1.1_59431391f2.iqx"
/ file = "1.1_601a7c9.iqx"
/ file = "3.1_5e7cd.iqx"
/ file = "3.1_5ea944.iqx"
/ file = "3.1_5ef2359.iqx"
/ file = "3.1_5d02c0.iqx"
/ file = "3.1_5f11e7.iqx"
/ file = "3.1_5fbae8.iqx"
/ file = "1.1_5efddc13.iqx"
/ file = "3.1_60461fc.iqx"
/ file = "3.1_6009eec.iqx"
/ file = "3.1_602b4.iqx"
/ file = "1.1_5ae5e66.iqx"
/ file = "1.1_5c6c403.iqx"
/ file = "1.1_5ce475.iqx"
/ file = "1.1_5bb179.iqx"
/ file = "1.1_5d29f1.iqx"

/ onscriptend = [
  if (batch.select.currentscript == "branchesnew1_3.iqx")
  {
   parameters.id = values.id_selected;
  }
]
</batch>


And this is the dropdown menu script

<parameters>
/ id = 0
</parameters>

<values>
/ id_selected = 0
</values>

%%%%%% ID
<text ID>
/items = ("Please enter your Prolific ID")
/position = (50%,40%)
</text>
<openended ID>
/ stimulusframes = [1=ID]
/ charlimit = 24

</openended>

<block selectidblock>
/ trials = [1=ID; 2=selectidpage]
</block>

<surveypage selectidpage>
/ ontrialend = [
  values.id_selected = dropdown.selectid.response;
]
/ questions = [1=selectid]
/ showpagenumbers = false
/ showquestionnumbers = false
</surveypage>

<dropdown selectid>
/ caption = "Please select your Prolific ID:"
/ options = ("6060fb525f262e237d167361","5c8d085a22f8f10014babf95","5fcffa471347ca01dd6ab937","603c956b3d9b16a4d297b71b","600f52c7dde4b5127f1f859e","5fb45df6ce203a13f34ac0af","5f2b2eb9d41fa153c81892ad","5f6bc58e1ee0b612c95a5ff3","604bd866aaf76cee7a7af909","5f85a0538f44f02584cd474","5fcd4d3784c8d41e341236d2","5fb005bcce940732eca0ec62","57f95ac9b603d900019460e6","5d43c42599f83a00152ba604","5c7ceb3a419b560001020f61","5c021b989b7d4e0001aa764e","594c69ee4b07c400013aa466","5f00b01d61fa111d7796e996","5bb6faf4f6d0bd00019e12f4","59f8a0bbf4217300016cc405","5f2e0bc767a4ed17d55942c7","6060a03527b618b6b8bcb298","5ce0c380d0ac7b001c8795c4","58c565298a3f870001c0e70d","55c11e44fdf99b545042e732","6039069d982298e730d4f35","601d1a51f8ab7f060c6638fe","6060cc2bf9ba38d90b1a6f12","600701b8ea617912572d9ccd","5b6b6e1d1f93bf000173b2c0","605de3af48d7a575adb95b09","5bc65ab6fc5fdb0001409196","5f6dfe80423f152bb7a96a6f","5ec5faacab872c67dfb0f505","5f36b3370303960ad419ba9a","5e8fc651d1aa0d2ba33717c9","5f178795ec2e75000daaaa09","5ea04bf0549a55078a07eb5d","58b2eb375b64db00017f5bf8","601785dd817de29d1f1cf000")
/ optionvalues = ("1", "2", "3", "4", "5", "6", "7", "8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40")
</dropdown>

And, in <expt> for each script, I have /onexptbegin = [ if(parameters.id != e.g.#) script.abort(false); values.id_selected = e.g.# ;

The problem is that no matter which value I select from the dropdown, all the scripts are run in sequence. Any help would be so much appreciated!

I attached a zip folder (i believe).

Actually attach the ZIP, please. It's not there.
By Dave - 3/30/2021

Dave - 3/30/2021
troyh - 3/30/2021
Hello,

I cannot seem to get my branch scripts to abort if they are not selected from a dropdown menu. This is my starting script 

<parameters>
/ id = 0
</parameters>

<values>
/ id_selected = 0
</values>

<batch select>
/ file = "branchesnew1_3.iqx"

/ file = "3.1_5f9c35.iqx"
/ file = "3.1_5f023.iqx"
/ file = "1.1_601017ce4.iqx"
/ file = "1.1_5e2cbee9.iqx"
/ file = "1.1_5e8b4f9.iqx"
/ file = "3.1_60365d8.iqx"
/ file = "1.1_60478deac0.iqx"
/ file = "1.1_5eb8fff8.iqx"
/ file = "3.1_57c975.iqx"
/ file = "3.1_5c923.iqx"
/ file = "3.1_5fb3e1.iqx"
/ file = "3.1_5c122.iqx"
/ file = "3.1_5ce3de.iqx"
/ file = "3.1_6050ae.iqx"
/ file = "1.1_5f8c6949.iqx"
/ file = "1.1_5bfee33.iqx"
/ file = "3.1_5ea9f38.iqx"
/ file = "1.1_56ad0e4.iqx"
/ file = "1.1_59b4235.iqx"
/ file = "1.1_577ff17.iqx"
/ file = "1.1_5f807.iqx"
/ file = "1.1_5fac746.iqx"
/ file = "1.1_600568e9.iqx"
/ file = "1.1_59431391f2.iqx"
/ file = "1.1_601a7c9.iqx"
/ file = "3.1_5e7cd.iqx"
/ file = "3.1_5ea944.iqx"
/ file = "3.1_5ef2359.iqx"
/ file = "3.1_5d02c0.iqx"
/ file = "3.1_5f11e7.iqx"
/ file = "3.1_5fbae8.iqx"
/ file = "1.1_5efddc13.iqx"
/ file = "3.1_60461fc.iqx"
/ file = "3.1_6009eec.iqx"
/ file = "3.1_602b4.iqx"
/ file = "1.1_5ae5e66.iqx"
/ file = "1.1_5c6c403.iqx"
/ file = "1.1_5ce475.iqx"
/ file = "1.1_5bb179.iqx"
/ file = "1.1_5d29f1.iqx"

/ onscriptend = [
  if (batch.select.currentscript == "branchesnew1_3.iqx")
  {
   parameters.id = values.id_selected;
  }
]
</batch>


And this is the dropdown menu script

<parameters>
/ id = 0
</parameters>

<values>
/ id_selected = 0
</values>

%%%%%% ID
<text ID>
/items = ("Please enter your Prolific ID")
/position = (50%,40%)
</text>
<openended ID>
/ stimulusframes = [1=ID]
/ charlimit = 24

</openended>

<block selectidblock>
/ trials = [1=ID; 2=selectidpage]
</block>

<surveypage selectidpage>
/ ontrialend = [
  values.id_selected = dropdown.selectid.response;
]
/ questions = [1=selectid]
/ showpagenumbers = false
/ showquestionnumbers = false
</surveypage>

<dropdown selectid>
/ caption = "Please select your Prolific ID:"
/ options = ("6060fb525f262e237d167361","5c8d085a22f8f10014babf95","5fcffa471347ca01dd6ab937","603c956b3d9b16a4d297b71b","600f52c7dde4b5127f1f859e","5fb45df6ce203a13f34ac0af","5f2b2eb9d41fa153c81892ad","5f6bc58e1ee0b612c95a5ff3","604bd866aaf76cee7a7af909","5f85a0538f44f02584cd474","5fcd4d3784c8d41e341236d2","5fb005bcce940732eca0ec62","57f95ac9b603d900019460e6","5d43c42599f83a00152ba604","5c7ceb3a419b560001020f61","5c021b989b7d4e0001aa764e","594c69ee4b07c400013aa466","5f00b01d61fa111d7796e996","5bb6faf4f6d0bd00019e12f4","59f8a0bbf4217300016cc405","5f2e0bc767a4ed17d55942c7","6060a03527b618b6b8bcb298","5ce0c380d0ac7b001c8795c4","58c565298a3f870001c0e70d","55c11e44fdf99b545042e732","6039069d982298e730d4f35","601d1a51f8ab7f060c6638fe","6060cc2bf9ba38d90b1a6f12","600701b8ea617912572d9ccd","5b6b6e1d1f93bf000173b2c0","605de3af48d7a575adb95b09","5bc65ab6fc5fdb0001409196","5f6dfe80423f152bb7a96a6f","5ec5faacab872c67dfb0f505","5f36b3370303960ad419ba9a","5e8fc651d1aa0d2ba33717c9","5f178795ec2e75000daaaa09","5ea04bf0549a55078a07eb5d","58b2eb375b64db00017f5bf8","601785dd817de29d1f1cf000")
/ optionvalues = ("1", "2", "3", "4", "5", "6", "7", "8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40")
</dropdown>

And, in <expt> for each script, I have /onexptbegin = [ if(parameters.id != e.g.#) script.abort(false); values.id_selected = e.g.# ;

The problem is that no matter which value I select from the dropdown, all the scripts are run in sequence. Any help would be so much appreciated!

I attached a zip folder (i believe).

Actually attach the ZIP, please. It's not there.

Attached is a set of working example scripts. They make use of the first three ID #s: Script A will be run for ID #1, script B for ID #2, script C for ID #3.

The batch script and dropdown script code is unchanged, you may refer to scripts A to C for the proper /onexptbegin logic (not included in your post); note that the ID parameter ought to be defined in those scripts, otherwise they will have no access to the parameter value set by the dropdown / selection script.
By troyh - 3/30/2021

Thanks!! That helps. Sorry about the ZIP. On multiple occasions, Inquisit always tells me my upload space is full even when there is nothing in it.