﻿<?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 5  » weird branching issue</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Mon, 09 Mar 2026 18:34:04 GMT</lastBuildDate><ttl>20</ttl><item><title>weird branching issue</title><link>https://forums.millisecond.com/Topic35123.aspx</link><description>I am doing an experiment where I need to assign participants to one of two prime conditions based on their sub id (even or odd) and response to a question. I am using a branch function to assign this, and all conditions, except for the last work correctly and generate the appropriate prime condition. The branch is&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage TESTpage&amp;gt;&lt;br/&gt;/ questions = [1=Parent1; 2=Parent2]&lt;br/&gt;/ branch = [if(radiobuttons.Parent1.response=="Black / African American") if (mod(script.subjectid, 1)==0)surveypage.Parent1Prime]&lt;br/&gt;/ branch = [else if(radiobuttons.Parent1.response=="White / Caucasian") if (mod(script.subjectid, 2)==0)surveypage.Parent1Prime]&lt;br/&gt;/ branch = [else if(radiobuttons.Parent2.response=="Black / African American") if (mod(script.subjectid, 1)==0)surveypage.Parent2Prime]&lt;br/&gt;/ branch = [else if(radiobuttons.Parent2.response=="White / Caucasian") if (mod(script.subjectid, 2)==0)surveypage.Parent2Prime]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;this last branch goes to Parent1Prime even though I ask it to go to Parent2Prime condition. All the other branches work, so I am not sure where the issue might be? Any guidance on how to fix this is so appreciated! :)</description><pubDate>Wed, 18 Jan 2023 22:06:51 GMT</pubDate><dc:creator>csteck</dc:creator></item><item><title>RE: weird branching issue</title><link>https://forums.millisecond.com/Topic35130.aspx</link><description>&lt;blockquote data-id="35129" class="if-quote-wrapper" unselectable="on" data-guid="1674079518816" id="if_insertedNode_1674079517591" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="35129" 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="35129" 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="35129" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 1/18/2023&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-35129"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="35124" class="if-quote-wrapper" unselectable="on" data-guid="1674079518816" id="if_insertedNode_1674078897686" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="35124" 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="35124" 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="35124" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 1/18/2023&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-35124"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="35123" class="if-quote-wrapper" unselectable="on" data-guid="1674079518816" id="if_insertedNode_1674078230337" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="35123" 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="35123" 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="35123" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;csteck - 1/18/2023&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-35123"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;I am doing an experiment where I need to assign participants to one of two prime conditions based on their sub id (even or odd) and response to a question. I am using a branch function to assign this, and all conditions, except for the last work correctly and generate the appropriate prime condition. The branch is&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage TESTpage&amp;gt;&lt;br/&gt;/ questions = [1=Parent1; 2=Parent2]&lt;br/&gt;/ branch = [if(radiobuttons.Parent1.response=="Black / African American") if (mod(script.subjectid, 1)==0)surveypage.Parent1Prime]&lt;br/&gt;/ branch = [else if(radiobuttons.Parent1.response=="White / Caucasian") if (mod(script.subjectid, 2)==0)surveypage.Parent1Prime]&lt;br/&gt;/ branch = [else if(radiobuttons.Parent2.response=="Black / African American") if (mod(script.subjectid, 1)==0)surveypage.Parent2Prime]&lt;br/&gt;/ branch = [else if(radiobuttons.Parent2.response=="White / Caucasian") if (mod(script.subjectid, 2)==0)surveypage.Parent2Prime]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;this last branch goes to Parent1Prime even though I ask it to go to Parent2Prime condition. All the other branches work, so I am not sure where the issue might be? Any guidance on how to fix this is so appreciated! :)&lt;a class="if-quote-goto quote-link" href="#" data-id="35123"&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;What you have there is not valid branch syntax. I'm not even sure how&amp;nbsp; &lt;br/&gt;&lt;br/&gt;&lt;strong&gt;if&lt;/strong&gt;(radiobuttons.Parent1.response=="Black / African American")&lt;strong&gt; if &lt;/strong&gt;(mod(script.subjectid, 1)==0)&lt;br/&gt;&lt;br/&gt;is supposed to be interpreted. You can't jumble two ifs together like this. In plain language, what is the conditiion here supposed to be?&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="35124"&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;Also, the way you use mod() does not make sense. If you want to know whether an ID is odd or even, you take it modulo 2. Always. You then check the remainder, i.e,&lt;br/&gt;&lt;br/&gt;if (mod(script.subjectid, 2)==1) -&amp;gt; the ID is odd.&lt;br/&gt;if (mod(script.subjectid,2)==0)  -&amp;gt; the ID is even&lt;br/&gt;&lt;br/&gt;It never makes sense to take the iD modulo 1. The remainder of any integer taken modulo 1 is always 0. That is mod(script.subjectid, 1) is 0 for any ID, be it odd or even.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="35129"&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;&amp;gt; The condition is supposed to be if the response to Parent1 question is Black/African American and if the subject id is odd then the page shown should be parent 1 prime.&lt;br/&gt;&lt;br/&gt;/ branch = [if(radiobuttons.Parent1.response=="Black / African American" &amp;amp;&amp;amp; mod(script.subjectid, 2)==1)surveypage.Parent1Prime]&lt;br/&gt;&lt;br/&gt;</description><pubDate>Wed, 18 Jan 2023 22:06:51 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: weird branching issue</title><link>https://forums.millisecond.com/Topic35129.aspx</link><description>&lt;blockquote data-id="35124" class="if-quote-wrapper" unselectable="on" data-guid="1674078899568" id="if_insertedNode_1674078897686" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="35124" 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="35124" 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="35124" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 1/18/2023&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-35124"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="35123" class="if-quote-wrapper" unselectable="on" data-guid="1674078899568" id="if_insertedNode_1674078230337" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="35123" 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="35123" 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="35123" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;csteck - 1/18/2023&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-35123"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;I am doing an experiment where I need to assign participants to one of two prime conditions based on their sub id (even or odd) and response to a question. I am using a branch function to assign this, and all conditions, except for the last work correctly and generate the appropriate prime condition. The branch is&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage TESTpage&amp;gt;&lt;br/&gt;/ questions = [1=Parent1; 2=Parent2]&lt;br/&gt;/ branch = [if(radiobuttons.Parent1.response=="Black / African American") if (mod(script.subjectid, 1)==0)surveypage.Parent1Prime]&lt;br/&gt;/ branch = [else if(radiobuttons.Parent1.response=="White / Caucasian") if (mod(script.subjectid, 2)==0)surveypage.Parent1Prime]&lt;br/&gt;/ branch = [else if(radiobuttons.Parent2.response=="Black / African American") if (mod(script.subjectid, 1)==0)surveypage.Parent2Prime]&lt;br/&gt;/ branch = [else if(radiobuttons.Parent2.response=="White / Caucasian") if (mod(script.subjectid, 2)==0)surveypage.Parent2Prime]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;this last branch goes to Parent1Prime even though I ask it to go to Parent2Prime condition. All the other branches work, so I am not sure where the issue might be? Any guidance on how to fix this is so appreciated! :)&lt;a class="if-quote-goto quote-link" href="#" data-id="35123"&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;What you have there is not valid branch syntax. I'm not even sure how&amp;nbsp; &lt;br/&gt;&lt;br/&gt;&lt;strong&gt;if&lt;/strong&gt;(radiobuttons.Parent1.response=="Black / African American")&lt;strong&gt; if &lt;/strong&gt;(mod(script.subjectid, 1)==0)&lt;br/&gt;&lt;br/&gt;is supposed to be interpreted. You can't jumble two ifs together like this. In plain language, what is the conditiion here supposed to be?&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="35124"&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;Also, the way you use mod() does not make sense. If you want to know whether an ID is odd or even, you take it modulo 2. Always. You then check the remainder, i.e,&lt;br/&gt;&lt;br/&gt;if (mod(script.subjectid, 2)==1) -&amp;gt; the ID is odd.&lt;br/&gt;if (mod(script.subjectid,2)==0)  -&amp;gt; the ID is even&lt;br/&gt;&lt;br/&gt;It never makes sense to take the iD modulo 1. The remainder of any integer taken modulo 1 is always 0. That is mod(script.subjectid, 1) is 0 for any ID, be it odd or even.&lt;br/&gt;</description><pubDate>Wed, 18 Jan 2023 22:01:06 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: weird branching issue</title><link>https://forums.millisecond.com/Topic35128.aspx</link><description>The condition is supposed to be if the response to Parent1 question is Black/African American and if the subject id is odd then the page shown should be parent 1 prime.&lt;br/&gt;Does that make sense? &lt;br/&gt;</description><pubDate>Wed, 18 Jan 2023 21:55:52 GMT</pubDate><dc:creator>csteck</dc:creator></item><item><title>RE: weird branching issue</title><link>https://forums.millisecond.com/Topic35124.aspx</link><description>&lt;blockquote data-id="35123" class="if-quote-wrapper" unselectable="on" data-guid="1674078231235" id="if_insertedNode_1674078230337" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="35123" 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="35123" 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="35123" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;csteck - 1/18/2023&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-35123"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;I am doing an experiment where I need to assign participants to one of two prime conditions based on their sub id (even or odd) and response to a question. I am using a branch function to assign this, and all conditions, except for the last work correctly and generate the appropriate prime condition. The branch is&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage TESTpage&amp;gt;&lt;br/&gt;/ questions = [1=Parent1; 2=Parent2]&lt;br/&gt;/ branch = [if(radiobuttons.Parent1.response=="Black / African American") if (mod(script.subjectid, 1)==0)surveypage.Parent1Prime]&lt;br/&gt;/ branch = [else if(radiobuttons.Parent1.response=="White / Caucasian") if (mod(script.subjectid, 2)==0)surveypage.Parent1Prime]&lt;br/&gt;/ branch = [else if(radiobuttons.Parent2.response=="Black / African American") if (mod(script.subjectid, 1)==0)surveypage.Parent2Prime]&lt;br/&gt;/ branch = [else if(radiobuttons.Parent2.response=="White / Caucasian") if (mod(script.subjectid, 2)==0)surveypage.Parent2Prime]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;this last branch goes to Parent1Prime even though I ask it to go to Parent2Prime condition. All the other branches work, so I am not sure where the issue might be? Any guidance on how to fix this is so appreciated! :)&lt;a class="if-quote-goto quote-link" href="#" data-id="35123"&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;What you have there is not valid branch syntax. I'm not even sure how&amp;nbsp; &lt;br/&gt;&lt;br/&gt;&lt;strong&gt;if&lt;/strong&gt;(radiobuttons.Parent1.response=="Black / African American")&lt;strong&gt; if &lt;/strong&gt;(mod(script.subjectid, 1)==0)&lt;br/&gt;&lt;br/&gt;is supposed to be interpreted. You can't jumble two ifs together like this. In plain language, what is the conditiion here supposed to be?&lt;br/&gt;</description><pubDate>Wed, 18 Jan 2023 21:47:00 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>