﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 6  » Run Batch file based on participant ID and session number</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Thu, 04 Jun 2026 06:19:38 GMT</lastBuildDate><ttl>20</ttl><item><title>Run Batch file based on participant ID and session number</title><link>https://forums.millisecond.com/Topic28662.aspx</link><description>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!&lt;br/&gt;&lt;br/&gt;&amp;lt;batch Task1&amp;gt;&lt;br/&gt;/ sessions = (1 of 3)&lt;br/&gt;/ file="Task1.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt; &lt;br/&gt;&amp;lt;batch Task2A&amp;gt;&lt;br/&gt;/ subjects = (1 of 2)&lt;br/&gt;/ sessions = (2 of 3)&lt;br/&gt;/ file="Task2A.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;batch Task2B&amp;gt;&lt;br/&gt;/ subjects = (2 of 2)&lt;br/&gt;/ sessions = (2 of 3)&lt;br/&gt;/ file="Task2B.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;batch Task3&amp;gt;&lt;br/&gt;/ sessions = (3 of 3)&lt;br/&gt;/ file="Task3.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Thu, 02 Apr 2020 00:40:19 GMT</pubDate><dc:creator>jparong</dc:creator></item><item><title>RE: Run Batch file based on participant ID and session number</title><link>https://forums.millisecond.com/Topic28664.aspx</link><description>&lt;blockquote data-id="28663" class="if-quote-wrapper" unselectable="on" data-guid="1585787995714" contenteditable="false" id="if_insertedNode_1585787994265"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="28663" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="28663" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="28663" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 4/2/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-28663"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="28662" class="if-quote-wrapper" unselectable="on" data-guid="1585787995714" id="if_insertedNode_1585785927986" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="28662" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="28662" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="28662" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;jparong - 4/1/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-28662"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;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!&lt;br/&gt;&lt;br/&gt;&amp;lt;batch Task1&amp;gt;&lt;br/&gt;/ sessions = (1 of 3)&lt;br/&gt;/ file="Task1.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt; &lt;br/&gt;&amp;lt;batch Task2A&amp;gt;&lt;br/&gt;/ subjects = (1 of 2)&lt;br/&gt;/ sessions = (2 of 3)&lt;br/&gt;/ file="Task2A.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;batch Task2B&amp;gt;&lt;br/&gt;/ subjects = (2 of 2)&lt;br/&gt;/ sessions = (2 of 3)&lt;br/&gt;/ file="Task2B.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;batch Task3&amp;gt;&lt;br/&gt;/ sessions = (3 of 3)&lt;br/&gt;/ file="Task3.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="28662"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;The way you've defined the &amp;lt;batch&amp;gt; elements, &lt;br/&gt;&lt;br/&gt;&amp;lt;batch Task2A&amp;gt;&lt;br/&gt;/ subjects = (1 of 2)&lt;br/&gt;/ sessions = (2 of 3)&lt;br/&gt;/ file="Task2A.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;will be executed if &lt;strong&gt;either&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;/ subjects = (1 of 2)&lt;br/&gt;&lt;br/&gt;is true (i.e. the subject number is odd)&lt;strong&gt;, or&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;/ sessions = (2 of 3)&lt;br/&gt;&lt;br/&gt;is true., or both.&lt;br/&gt;&lt;br/&gt;The way to do this, then, is to simply define three sessions&lt;br/&gt;&lt;br/&gt;&amp;lt;batch Task1&amp;gt;&lt;br/&gt;/ sessions = (1 of 3)&lt;br/&gt;/ file="Task1.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;batch Task2&amp;gt;&lt;br/&gt;/ sessions = (2 of 3)&lt;br/&gt;/ file="Task2.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;batch Task3&amp;gt;&lt;br/&gt;/ sessions = (3 of 3)&lt;br/&gt;/ file="Task3.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;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:&lt;br/&gt;&lt;br/&gt;&amp;lt;include&amp;gt;&lt;br/&gt;/ precondition = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mod(script.subjectid, 2) == 1;&lt;br/&gt;]&lt;br/&gt;/ file = "task2a.iqx"&lt;br/&gt;&amp;lt;/include&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;include&amp;gt;&lt;br/&gt;/ precondition = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mod(script.subjectid, 2) == 0;&lt;br/&gt;]&lt;br/&gt;/ file = "task2b.iqx"&lt;br/&gt;&amp;lt;/include&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="28663"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Thank you for the quick reply, Dave!</description><pubDate>Thu, 02 Apr 2020 00:40:19 GMT</pubDate><dc:creator>jparong</dc:creator></item><item><title>RE: Run Batch file based on participant ID and session number</title><link>https://forums.millisecond.com/Topic28663.aspx</link><description>&lt;blockquote data-id="28662" class="if-quote-wrapper" unselectable="on" data-guid="1585785929158" id="if_insertedNode_1585785927986" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="28662" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="28662" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="28662" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;jparong - 4/1/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-28662"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;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!&lt;br/&gt;&lt;br/&gt;&amp;lt;batch Task1&amp;gt;&lt;br/&gt;/ sessions = (1 of 3)&lt;br/&gt;/ file="Task1.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt; &lt;br/&gt;&amp;lt;batch Task2A&amp;gt;&lt;br/&gt;/ subjects = (1 of 2)&lt;br/&gt;/ sessions = (2 of 3)&lt;br/&gt;/ file="Task2A.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;batch Task2B&amp;gt;&lt;br/&gt;/ subjects = (2 of 2)&lt;br/&gt;/ sessions = (2 of 3)&lt;br/&gt;/ file="Task2B.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;batch Task3&amp;gt;&lt;br/&gt;/ sessions = (3 of 3)&lt;br/&gt;/ file="Task3.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="28662"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;The way you've defined the &amp;lt;batch&amp;gt; elements, &lt;br/&gt;&lt;br/&gt;&amp;lt;batch Task2A&amp;gt;&lt;br/&gt;/ subjects = (1 of 2)&lt;br/&gt;/ sessions = (2 of 3)&lt;br/&gt;/ file="Task2A.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;will be executed if &lt;strong&gt;either&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;/ subjects = (1 of 2)&lt;br/&gt;&lt;br/&gt;is true (i.e. the subject number is odd)&lt;strong&gt;, or&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;/ sessions = (2 of 3)&lt;br/&gt;&lt;br/&gt;is true., or both.&lt;br/&gt;&lt;br/&gt;The way to do this, then, is to simply define three sessions&lt;br/&gt;&lt;br/&gt;&amp;lt;batch Task1&amp;gt;&lt;br/&gt;/ sessions = (1 of 3)&lt;br/&gt;/ file="Task1.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;batch Task2&amp;gt;&lt;br/&gt;/ sessions = (2 of 3)&lt;br/&gt;/ file="Task2.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;batch Task3&amp;gt;&lt;br/&gt;/ sessions = (3 of 3)&lt;br/&gt;/ file="Task3.iqx"&lt;br/&gt;&amp;lt;/batch&amp;gt;&lt;br/&gt;&lt;br/&gt;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:&lt;br/&gt;&lt;br/&gt;&amp;lt;include&amp;gt;&lt;br/&gt;/ precondition = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mod(script.subjectid, 2) == 1;&lt;br/&gt;]&lt;br/&gt;/ file = "task2a.iqx"&lt;br/&gt;&amp;lt;/include&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;include&amp;gt;&lt;br/&gt;/ precondition = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mod(script.subjectid, 2) == 0;&lt;br/&gt;]&lt;br/&gt;/ file = "task2b.iqx"&lt;br/&gt;&amp;lt;/include&amp;gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Thu, 02 Apr 2020 00:28:30 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>