﻿<?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  » Conditional branching</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Sun, 13 Sep 2026 21:23:43 GMT</lastBuildDate><ttl>20</ttl><item><title>Conditional branching</title><link>https://forums.millisecond.com/Topic22925.aspx</link><description>Hi. I am trying to get a conditional branch to work. 3 sentences are presented. For only some of the sentences there is a comprehension question. I've tried to achieve this using a conditional statement so that the question trial is triggered only when the question item is not an empty string (/ branch = [if(text.question != "")trial.questionTrial]). However, the question trial is triggered all the time.&lt;br/&gt;&lt;br/&gt;Is there a problem with my conditional statement?&lt;br/&gt;&lt;br/&gt;Thanks&lt;br/&gt;&lt;br/&gt;Nick&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item sentences&amp;gt;&lt;br/&gt;/ 1 = "A dog is a canine"&lt;br/&gt;/ 2 = "A cat is a feline"&lt;br/&gt;/ 3 = "A bear is ursine"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item questions&amp;gt;&lt;br/&gt;/ 1 = ""&lt;br/&gt;/ 2 = "Did this sentence mention a cat?" &lt;br/&gt;/ 3 = ""&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text sentence&amp;gt;&lt;br/&gt;/ items  = sentences&lt;br/&gt;/ select = sequence&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text question&amp;gt;&lt;br/&gt;/ items = questions&lt;br/&gt;/ select = text.sentence.currentindex&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial sentenceTrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1 = sentence]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;/ branch = [if(text.question != "")trial.questionTrial]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial questionTrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1 = question]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block block&amp;gt;&lt;br/&gt;/ trials = [1-3 = sentenceTrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;expt expt&amp;gt;&lt;br/&gt;/ blocks = [1 = block]&lt;br/&gt;&amp;lt;/expt&amp;gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Wed, 22 Nov 2017 09:16:52 GMT</pubDate><dc:creator>Nick Riches</dc:creator></item><item><title>RE: Conditional branching</title><link>https://forums.millisecond.com/Topic22936.aspx</link><description>&lt;div data-id="22935" class="if-quote-wrapper" unselectable="on" data-guid="1511370981337"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="22935" 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="22935" 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="22935" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Wednesday, November 22, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-22935"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="22933" class="if-quote-wrapper" unselectable="on" data-guid="1511370981337"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="22933" 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="22933" 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="22933" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Nick Riches - Wednesday, November 22, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-22933"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="22926" class="if-quote-wrapper" unselectable="on" data-guid="1511370981337"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="22926" 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="22926" 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="22926" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Tuesday, November 21, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-22926"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="22925" class="if-quote-wrapper" unselectable="on" data-guid="1511370981337"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="22925" 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="22925" 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="22925" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Nick Riches - Tuesday, November 21, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-22925"&gt;&lt;div class="if-quote-message-margin"&gt;Hi. I am trying to get a conditional branch to work. 3 sentences are presented. For only some of the sentences there is a comprehension question. I've tried to achieve this using a conditional statement so that the question trial is triggered only when the question item is not an empty string (/ branch = [if(text.question != "")trial.questionTrial]). However, the question trial is triggered all the time.&lt;br/&gt;&lt;br/&gt;Is there a problem with my conditional statement?&lt;br/&gt;&lt;br/&gt;Thanks&lt;br/&gt;&lt;br/&gt;Nick&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item sentences&amp;gt;&lt;br/&gt;/ 1 = "A dog is a canine"&lt;br/&gt;/ 2 = "A cat is a feline"&lt;br/&gt;/ 3 = "A bear is ursine"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item questions&amp;gt;&lt;br/&gt;/ 1 = ""&lt;br/&gt;/ 2 = "Did this sentence mention a cat?" &lt;br/&gt;/ 3 = ""&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text sentence&amp;gt;&lt;br/&gt;/ items  = sentences&lt;br/&gt;/ select = sequence&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text question&amp;gt;&lt;br/&gt;/ items = questions&lt;br/&gt;/ select = text.sentence.currentindex&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial sentenceTrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1 = sentence]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;/ branch = [if(text.question != "")trial.questionTrial]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial questionTrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1 = question]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block block&amp;gt;&lt;br/&gt;/ trials = [1-3 = sentenceTrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;expt expt&amp;gt;&lt;br/&gt;/ blocks = [1 = block]&lt;br/&gt;&amp;lt;/expt&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="22925"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Sorry, this setup doesn't seem to make sense. First off.&lt;br/&gt;&lt;br/&gt;text.question doesn't return anything -- you're not accessing or reading any of the text element's properties.&lt;br/&gt;&lt;br/&gt;Moreover, &amp;lt;text question&amp;gt; is only used in &amp;lt;trial questiontrial&amp;gt;, which is the trial you wish to /branch to. How is &amp;lt;trial sentence&amp;gt; supposed to know about things that only happen later, in &amp;lt;trial questiontrial&amp;gt; and behave accordingly?&lt;br/&gt;&lt;br/&gt;What you can do to get this to work is:&lt;br/&gt;&lt;br/&gt;&amp;lt;item sentences&amp;gt;&lt;br/&gt;/ 1 = "A dog is a canine"&lt;br/&gt;/ 2 = "A cat is a feline"&lt;br/&gt;/ 3 = "A bear is ursine"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item questions&amp;gt;&lt;br/&gt;/ 1 = ""&lt;br/&gt;/ 2 = "Did this sentence mention a cat?"&lt;br/&gt;/ 3 = ""&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text sentence&amp;gt;&lt;br/&gt;/ items = sentences&lt;br/&gt;/ select = sequence&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text question&amp;gt;&lt;br/&gt;/ items = questions&lt;br/&gt;/ select = text.sentence.currentindex&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial sentenceTrial&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.question.hposition = -10%;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.question.vposition = -10%;&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1 = sentence, question]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;/ branch = [if(text.question.currentitem != "")trial.questionTrial]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial questionTrial&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.question.hposition = 50%;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.question.vposition = 50%;&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1 = question]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block block&amp;gt;&lt;br/&gt;/ trials = [1-3 = sentenceTrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;expt expt&amp;gt;&lt;br/&gt;/ blocks = [1 = block]&lt;br/&gt;&amp;lt;/expt&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="22926"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Many thanks. That does the trick.&lt;br/&gt;&lt;br/&gt;I'm still a bit confused why 'text.question' doesn't work in my example. This object has been defined. I presume one needs to reference it somewhere in the trial object, in order for it to be 'instantiated' as a trial which can then be referred to in the conditional statement? You've referred to it in the 'ontrialbegin' property, which appears to set the position of the text off-screen. I presume this allows one to link to the trial in the conditional statement. If this were a sound file, or image file, I presume I would need to find a different way to reference it?&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="22933"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&amp;gt; I'm still a bit confused why 'text.question' doesn't work in my example.&lt;br/&gt;&lt;br/&gt;text.question just references the &amp;lt;text&amp;gt; object called "question". text.question by itself does or says nothing: Which of the dozens pieces of information available about the object is it supposed to convey?&lt;br/&gt;A text object has many different properties, like its current item, its position, its size, its color, and so forth, so you need to specify _which_ piece of information (property) you wish to know about. If you want to know the currently selected item of the text object, you access the currentitem property&lt;br/&gt;&lt;br/&gt;text.question.currentitem &lt;br/&gt;&lt;br/&gt;Note that the object only selects an item once it is _actually_ used / displayed by a trial. If you want to know or change the text object's horizontal position, you access its hposition property&lt;br/&gt;&lt;br/&gt;text.question.hposition&lt;br/&gt;&lt;br/&gt;and so forth.&lt;br/&gt;&lt;br/&gt;&amp;gt; I presume one needs to reference it somewhere in the trial object, in order for it to be 'instantiated' as a trial which can then be referred to in the conditional statement?&lt;br/&gt;&lt;br/&gt;No, that's not exactly right. As a general rule, a stimulus object only performs item selection once it is actually _displayed_ via a &amp;lt;trial&amp;gt;'s /stimulustimes or -frames.&lt;br/&gt;&lt;br/&gt;&amp;gt;  If this were a sound file, or image file, I presume I would need to find a different way to reference it?&lt;br/&gt;&lt;br/&gt;Not necessarily. A &amp;lt;picture&amp;gt; object can be moved off-screen just as well. A &amp;lt;sound&amp;gt; object could be muted. But generally, the approach you used is not ideal and I'd rather do something like this:&lt;br/&gt;&lt;br/&gt;&amp;lt;item sentences&amp;gt;&lt;br/&gt;/ 1 = "A dog is a canine"&lt;br/&gt;/ 2 = "A cat is a feline"&lt;br/&gt;/ 3 = "A bear is ursine"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;&amp;lt;list has_followup&amp;gt;&lt;br/&gt;/ items = (false, true, false)&lt;br/&gt;/ selectionmode = text.sentence.currentindex&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item questions&amp;gt;&lt;br/&gt;/ 1 = ""&lt;br/&gt;/ 2 = "Did this sentence mention a cat?"&lt;br/&gt;/ 3 = ""&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text sentence&amp;gt;&lt;br/&gt;/ items = sentences&lt;br/&gt;/ select = sequence&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text question&amp;gt;&lt;br/&gt;/ items = questions&lt;br/&gt;/ select = text.sentence.currentindex&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial sentenceTrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1 = sentence]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;&lt;strong&gt;/ branch = [if(list.has_followup.nextvalue)trial.questionTrial]&lt;/strong&gt;&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial questionTrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1 = question]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block block&amp;gt;&lt;br/&gt;/ trials = [1-3 = sentenceTrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;expt expt&amp;gt;&lt;br/&gt;/ blocks = [1 = block]&lt;br/&gt;&amp;lt;/expt&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="22935"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;That's really incredibly useful, and the 'list' method looks like a much better way to do this. Thanks so much for this.&lt;br/&gt;</description><pubDate>Wed, 22 Nov 2017 09:16:52 GMT</pubDate><dc:creator>Nick Riches</dc:creator></item><item><title>RE: Conditional branching</title><link>https://forums.millisecond.com/Topic22935.aspx</link><description>&lt;div data-id="22933" class="if-quote-wrapper" unselectable="on" data-guid="1511369779910"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="22933" 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="22933" 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="22933" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Nick Riches - Wednesday, November 22, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-22933"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="22926" class="if-quote-wrapper" unselectable="on" data-guid="1511369779910"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="22926" 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="22926" 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="22926" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Tuesday, November 21, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-22926"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="22925" class="if-quote-wrapper" unselectable="on" data-guid="1511369779910"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="22925" 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="22925" 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="22925" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Nick Riches - Tuesday, November 21, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-22925"&gt;&lt;div class="if-quote-message-margin"&gt;Hi. I am trying to get a conditional branch to work. 3 sentences are presented. For only some of the sentences there is a comprehension question. I've tried to achieve this using a conditional statement so that the question trial is triggered only when the question item is not an empty string (/ branch = [if(text.question != "")trial.questionTrial]). However, the question trial is triggered all the time.&lt;br/&gt;&lt;br/&gt;Is there a problem with my conditional statement?&lt;br/&gt;&lt;br/&gt;Thanks&lt;br/&gt;&lt;br/&gt;Nick&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item sentences&amp;gt;&lt;br/&gt;/ 1 = "A dog is a canine"&lt;br/&gt;/ 2 = "A cat is a feline"&lt;br/&gt;/ 3 = "A bear is ursine"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item questions&amp;gt;&lt;br/&gt;/ 1 = ""&lt;br/&gt;/ 2 = "Did this sentence mention a cat?" &lt;br/&gt;/ 3 = ""&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text sentence&amp;gt;&lt;br/&gt;/ items  = sentences&lt;br/&gt;/ select = sequence&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text question&amp;gt;&lt;br/&gt;/ items = questions&lt;br/&gt;/ select = text.sentence.currentindex&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial sentenceTrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1 = sentence]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;/ branch = [if(text.question != "")trial.questionTrial]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial questionTrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1 = question]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block block&amp;gt;&lt;br/&gt;/ trials = [1-3 = sentenceTrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;expt expt&amp;gt;&lt;br/&gt;/ blocks = [1 = block]&lt;br/&gt;&amp;lt;/expt&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="22925"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Sorry, this setup doesn't seem to make sense. First off.&lt;br/&gt;&lt;br/&gt;text.question doesn't return anything -- you're not accessing or reading any of the text element's properties.&lt;br/&gt;&lt;br/&gt;Moreover, &amp;lt;text question&amp;gt; is only used in &amp;lt;trial questiontrial&amp;gt;, which is the trial you wish to /branch to. How is &amp;lt;trial sentence&amp;gt; supposed to know about things that only happen later, in &amp;lt;trial questiontrial&amp;gt; and behave accordingly?&lt;br/&gt;&lt;br/&gt;What you can do to get this to work is:&lt;br/&gt;&lt;br/&gt;&amp;lt;item sentences&amp;gt;&lt;br/&gt;/ 1 = "A dog is a canine"&lt;br/&gt;/ 2 = "A cat is a feline"&lt;br/&gt;/ 3 = "A bear is ursine"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item questions&amp;gt;&lt;br/&gt;/ 1 = ""&lt;br/&gt;/ 2 = "Did this sentence mention a cat?"&lt;br/&gt;/ 3 = ""&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text sentence&amp;gt;&lt;br/&gt;/ items = sentences&lt;br/&gt;/ select = sequence&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text question&amp;gt;&lt;br/&gt;/ items = questions&lt;br/&gt;/ select = text.sentence.currentindex&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial sentenceTrial&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.question.hposition = -10%;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.question.vposition = -10%;&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1 = sentence, question]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;/ branch = [if(text.question.currentitem != "")trial.questionTrial]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial questionTrial&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.question.hposition = 50%;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.question.vposition = 50%;&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1 = question]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block block&amp;gt;&lt;br/&gt;/ trials = [1-3 = sentenceTrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;expt expt&amp;gt;&lt;br/&gt;/ blocks = [1 = block]&lt;br/&gt;&amp;lt;/expt&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="22926"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Many thanks. That does the trick.&lt;br/&gt;&lt;br/&gt;I'm still a bit confused why 'text.question' doesn't work in my example. This object has been defined. I presume one needs to reference it somewhere in the trial object, in order for it to be 'instantiated' as a trial which can then be referred to in the conditional statement? You've referred to it in the 'ontrialbegin' property, which appears to set the position of the text off-screen. I presume this allows one to link to the trial in the conditional statement. If this were a sound file, or image file, I presume I would need to find a different way to reference it?&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="22933"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&amp;gt; I'm still a bit confused why 'text.question' doesn't work in my example.&lt;br/&gt;&lt;br/&gt;text.question just references the &amp;lt;text&amp;gt; object called "question". text.question by itself does or says nothing: Which of the dozens pieces of information available about the object is it supposed to convey?&lt;br/&gt;A text object has many different properties, like its current item, its position, its size, its color, and so forth, so you need to specify _which_ piece of information (property) you wish to know about. If you want to know the currently selected item of the text object, you access the currentitem property&lt;br/&gt;&lt;br/&gt;text.question.currentitem &lt;br/&gt;&lt;br/&gt;Note that the object only selects an item once it is _actually_ used / displayed by a trial. If you want to know or change the text object's horizontal position, you access its hposition property&lt;br/&gt;&lt;br/&gt;text.question.hposition&lt;br/&gt;&lt;br/&gt;and so forth.&lt;br/&gt;&lt;br/&gt;&amp;gt; I presume one needs to reference it somewhere in the trial object, in order for it to be 'instantiated' as a trial which can then be referred to in the conditional statement?&lt;br/&gt;&lt;br/&gt;No, that's not exactly right. As a general rule, a stimulus object only performs item selection once it is actually _displayed_ via a &amp;lt;trial&amp;gt;'s /stimulustimes or -frames.&lt;br/&gt;&lt;br/&gt;&amp;gt;  If this were a sound file, or image file, I presume I would need to find a different way to reference it?&lt;br/&gt;&lt;br/&gt;Not necessarily. A &amp;lt;picture&amp;gt; object can be moved off-screen just as well. A &amp;lt;sound&amp;gt; object could be muted. But generally, the approach you used is not ideal and I'd rather do something like this:&lt;br/&gt;&lt;br/&gt;&amp;lt;item sentences&amp;gt;&lt;br/&gt;/ 1 = "A dog is a canine"&lt;br/&gt;/ 2 = "A cat is a feline"&lt;br/&gt;/ 3 = "A bear is ursine"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;strong&gt;&amp;lt;list has_followup&amp;gt;&lt;br/&gt;/ items = (false, true, false)&lt;br/&gt;/ selectionmode = text.sentence.currentindex&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item questions&amp;gt;&lt;br/&gt;/ 1 = ""&lt;br/&gt;/ 2 = "Did this sentence mention a cat?"&lt;br/&gt;/ 3 = ""&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text sentence&amp;gt;&lt;br/&gt;/ items = sentences&lt;br/&gt;/ select = sequence&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text question&amp;gt;&lt;br/&gt;/ items = questions&lt;br/&gt;/ select = text.sentence.currentindex&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial sentenceTrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1 = sentence]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;&lt;strong&gt;/ branch = [if(list.has_followup.nextvalue)trial.questionTrial]&lt;/strong&gt;&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial questionTrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1 = question]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block block&amp;gt;&lt;br/&gt;/ trials = [1-3 = sentenceTrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;expt expt&amp;gt;&lt;br/&gt;/ blocks = [1 = block]&lt;br/&gt;&amp;lt;/expt&amp;gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Wed, 22 Nov 2017 09:12:36 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Conditional branching</title><link>https://forums.millisecond.com/Topic22933.aspx</link><description>&lt;div data-id="22926" class="if-quote-wrapper" unselectable="on" data-guid="1511337449092"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="22926" 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="22926" 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="22926" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - Tuesday, November 21, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-22926"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="22925" class="if-quote-wrapper" unselectable="on" data-guid="1511337449092"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="22925" 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="22925" 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="22925" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Nick Riches - Tuesday, November 21, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-22925"&gt;&lt;div class="if-quote-message-margin"&gt;Hi. I am trying to get a conditional branch to work. 3 sentences are presented. For only some of the sentences there is a comprehension question. I've tried to achieve this using a conditional statement so that the question trial is triggered only when the question item is not an empty string (/ branch = [if(text.question != "")trial.questionTrial]). However, the question trial is triggered all the time.&lt;br/&gt;&lt;br/&gt;Is there a problem with my conditional statement?&lt;br/&gt;&lt;br/&gt;Thanks&lt;br/&gt;&lt;br/&gt;Nick&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item sentences&amp;gt;&lt;br/&gt;/ 1 = "A dog is a canine"&lt;br/&gt;/ 2 = "A cat is a feline"&lt;br/&gt;/ 3 = "A bear is ursine"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item questions&amp;gt;&lt;br/&gt;/ 1 = ""&lt;br/&gt;/ 2 = "Did this sentence mention a cat?" &lt;br/&gt;/ 3 = ""&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text sentence&amp;gt;&lt;br/&gt;/ items  = sentences&lt;br/&gt;/ select = sequence&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text question&amp;gt;&lt;br/&gt;/ items = questions&lt;br/&gt;/ select = text.sentence.currentindex&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial sentenceTrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1 = sentence]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;/ branch = [if(text.question != "")trial.questionTrial]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial questionTrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1 = question]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block block&amp;gt;&lt;br/&gt;/ trials = [1-3 = sentenceTrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;expt expt&amp;gt;&lt;br/&gt;/ blocks = [1 = block]&lt;br/&gt;&amp;lt;/expt&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="22925"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Sorry, this setup doesn't seem to make sense. First off.&lt;br/&gt;&lt;br/&gt;text.question doesn't return anything -- you're not accessing or reading any of the text element's properties.&lt;br/&gt;&lt;br/&gt;Moreover, &amp;lt;text question&amp;gt; is only used in &amp;lt;trial questiontrial&amp;gt;, which is the trial you wish to /branch to. How is &amp;lt;trial sentence&amp;gt; supposed to know about things that only happen later, in &amp;lt;trial questiontrial&amp;gt; and behave accordingly?&lt;br/&gt;&lt;br/&gt;What you can do to get this to work is:&lt;br/&gt;&lt;br/&gt;&amp;lt;item sentences&amp;gt;&lt;br/&gt;/ 1 = "A dog is a canine"&lt;br/&gt;/ 2 = "A cat is a feline"&lt;br/&gt;/ 3 = "A bear is ursine"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item questions&amp;gt;&lt;br/&gt;/ 1 = ""&lt;br/&gt;/ 2 = "Did this sentence mention a cat?"&lt;br/&gt;/ 3 = ""&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text sentence&amp;gt;&lt;br/&gt;/ items = sentences&lt;br/&gt;/ select = sequence&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text question&amp;gt;&lt;br/&gt;/ items = questions&lt;br/&gt;/ select = text.sentence.currentindex&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial sentenceTrial&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.question.hposition = -10%;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.question.vposition = -10%;&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1 = sentence, question]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;/ branch = [if(text.question.currentitem != "")trial.questionTrial]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial questionTrial&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.question.hposition = 50%;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.question.vposition = 50%;&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1 = question]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block block&amp;gt;&lt;br/&gt;/ trials = [1-3 = sentenceTrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;expt expt&amp;gt;&lt;br/&gt;/ blocks = [1 = block]&lt;br/&gt;&amp;lt;/expt&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="22926"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Many thanks. That does the trick.&lt;br/&gt;&lt;br/&gt;I'm still a bit confused why 'text.question' doesn't work in my example. This object has been defined. I presume one needs to reference it somewhere in the trial object, in order for it to be 'instantiated' as a trial which can then be referred to in the conditional statement? You've referred to it in the 'ontrialbegin' property, which appears to set the position of the text off-screen. I presume this allows one to link to the trial in the conditional statement. If this were a sound file, or image file, I presume I would need to find a different way to reference it?&lt;br/&gt;</description><pubDate>Wed, 22 Nov 2017 00:12:53 GMT</pubDate><dc:creator>Nick Riches</dc:creator></item><item><title>RE: Conditional branching</title><link>https://forums.millisecond.com/Topic22926.aspx</link><description>&lt;div data-id="22925" class="if-quote-wrapper" unselectable="on" data-guid="1511284392909"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="22925" 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="22925" 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="22925" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Nick Riches - Tuesday, November 21, 2017&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-22925"&gt;&lt;div class="if-quote-message-margin"&gt;Hi. I am trying to get a conditional branch to work. 3 sentences are presented. For only some of the sentences there is a comprehension question. I've tried to achieve this using a conditional statement so that the question trial is triggered only when the question item is not an empty string (/ branch = [if(text.question != "")trial.questionTrial]). However, the question trial is triggered all the time.&lt;br/&gt;&lt;br/&gt;Is there a problem with my conditional statement?&lt;br/&gt;&lt;br/&gt;Thanks&lt;br/&gt;&lt;br/&gt;Nick&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item sentences&amp;gt;&lt;br/&gt;/ 1 = "A dog is a canine"&lt;br/&gt;/ 2 = "A cat is a feline"&lt;br/&gt;/ 3 = "A bear is ursine"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item questions&amp;gt;&lt;br/&gt;/ 1 = ""&lt;br/&gt;/ 2 = "Did this sentence mention a cat?" &lt;br/&gt;/ 3 = ""&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text sentence&amp;gt;&lt;br/&gt;/ items  = sentences&lt;br/&gt;/ select = sequence&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text question&amp;gt;&lt;br/&gt;/ items = questions&lt;br/&gt;/ select = text.sentence.currentindex&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial sentenceTrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1 = sentence]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;/ branch = [if(text.question != "")trial.questionTrial]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial questionTrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1 = question]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block block&amp;gt;&lt;br/&gt;/ trials = [1-3 = sentenceTrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;expt expt&amp;gt;&lt;br/&gt;/ blocks = [1 = block]&lt;br/&gt;&amp;lt;/expt&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="22925"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Sorry, this setup doesn't seem to make sense. First off.&lt;br/&gt;&lt;br/&gt;text.question doesn't return anything -- you're not accessing or reading any of the text element's properties.&lt;br/&gt;&lt;br/&gt;Moreover, &amp;lt;text question&amp;gt; is only used in &amp;lt;trial questiontrial&amp;gt;, which is the trial you wish to /branch to. How is &amp;lt;trial sentence&amp;gt; supposed to know about things that only happen later, in &amp;lt;trial questiontrial&amp;gt; and behave accordingly?&lt;br/&gt;&lt;br/&gt;What you can do to get this to work is:&lt;br/&gt;&lt;br/&gt;&amp;lt;item sentences&amp;gt;&lt;br/&gt;/ 1 = "A dog is a canine"&lt;br/&gt;/ 2 = "A cat is a feline"&lt;br/&gt;/ 3 = "A bear is ursine"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item questions&amp;gt;&lt;br/&gt;/ 1 = ""&lt;br/&gt;/ 2 = "Did this sentence mention a cat?"&lt;br/&gt;/ 3 = ""&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text sentence&amp;gt;&lt;br/&gt;/ items = sentences&lt;br/&gt;/ select = sequence&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text question&amp;gt;&lt;br/&gt;/ items = questions&lt;br/&gt;/ select = text.sentence.currentindex&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial sentenceTrial&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.question.hposition = -10%;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.question.vposition = -10%;&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1 = sentence, question]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;/ branch = [if(text.question.currentitem != "")trial.questionTrial]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial questionTrial&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.question.hposition = 50%;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text.question.vposition = 50%;&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1 = question]&lt;br/&gt;/ validresponse = ("Y", "N")&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block block&amp;gt;&lt;br/&gt;/ trials = [1-3 = sentenceTrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;expt expt&amp;gt;&lt;br/&gt;/ blocks = [1 = block]&lt;br/&gt;&amp;lt;/expt&amp;gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Tue, 21 Nov 2017 09:18:32 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>