﻿<?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 4  » Branch syntax</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Wed, 16 Sep 2026 13:41:31 GMT</lastBuildDate><ttl>20</ttl><item><title>Branch syntax</title><link>https://forums.millisecond.com/Topic16585.aspx</link><description>Hi, Mr Dave,&lt;br/&gt;May I ask a question about Branch syntax? I grouped three trials into a block, and I made several of these blocks. I wonder if I can let inquisit to start&lt;br/&gt;blocks depending on how participants performed on the previous block? it seems branch can only do this on trials level.&lt;br/&gt; Like:&lt;br/&gt;&amp;lt;trial 1&amp;gt;&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&amp;lt;trial 2&amp;gt;&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&amp;lt;trial 3&amp;gt;&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&amp;lt;block 1&amp;gt;&lt;br/&gt;trials=[1;2;3]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&amp;lt;trial 4&amp;gt;&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&amp;lt;trial 5&amp;gt;&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&amp;lt;trial 6&amp;gt;&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&amp;lt;block 1&amp;gt;&lt;br/&gt;trials=[4;5;6]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;...&lt;br/&gt;Best Wishes,&lt;br/&gt;Nakayama&lt;br/&gt;&lt;br/&gt;</description><pubDate>Tue, 30 Jun 2015 05:43:15 GMT</pubDate><dc:creator>nakayama</dc:creator></item><item><title>RE: Branch syntax</title><link>https://forums.millisecond.com/Topic16626.aspx</link><description>Thank you Dave, I got it!</description><pubDate>Tue, 30 Jun 2015 05:43:15 GMT</pubDate><dc:creator>nakayama</dc:creator></item><item><title>RE: Branch syntax</title><link>https://forums.millisecond.com/Topic16625.aspx</link><description>&amp;lt;block 1&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ branch=[if (&lt;strong&gt;condition&lt;/strong&gt;) block.1]&lt;br/&gt;&amp;lt;/block&amp;gt;			    							    &lt;br/&gt;&lt;br/&gt;where condition could be something like&lt;br/&gt;&lt;br/&gt;&amp;lt;block 1&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ branch=[if (&lt;strong&gt;values.timeout &amp;lt; 2200&lt;/strong&gt;) block.1]&lt;br/&gt;&amp;lt;/block&amp;gt;			    							    &lt;br/&gt;&lt;br/&gt;or nothing at all&lt;br/&gt;&lt;br/&gt;&amp;lt;block 1&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ branch=[block.1]&lt;br/&gt;&amp;lt;/block&amp;gt;			    							    &lt;br/&gt;&lt;br/&gt;etc.&lt;br/&gt;</description><pubDate>Tue, 30 Jun 2015 04:01:08 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Branch syntax</title><link>https://forums.millisecond.com/Topic16623.aspx</link><description>Thank you for your help ! Dave.&lt;br/&gt;I am sorry I am little bit confused. So would you show me how to run block 1 again using branch?&amp;nbsp;&lt;br/&gt;Best,&lt;br/&gt;Nakayama&lt;br/&gt;&lt;br/&gt;</description><pubDate>Mon, 29 Jun 2015 18:04:06 GMT</pubDate><dc:creator>nakayama</dc:creator></item><item><title>RE: Branch syntax</title><link>https://forums.millisecond.com/Topic16622.aspx</link><description>Apologies, I mistakenly edited your last post. Intended response is below:&lt;br/&gt;&lt;br/&gt;You run &amp;lt;block 1&amp;gt; a single time via your &amp;lt;expt&amp;gt;:&lt;br/&gt;&lt;br/&gt;&amp;lt;expt&amp;gt;&lt;br/&gt;/preinstructions = (instruction)&lt;br/&gt;/postinstructions = (result)&lt;br/&gt;&lt;strong&gt;/blocks = [1 = 1;]&lt;/strong&gt;&lt;br/&gt;&amp;lt;/expt&amp;gt;&lt;br/&gt;&lt;br/&gt;Since there is no /branch or the like in the &amp;lt;block&amp;gt; or anywhere else&lt;br/&gt;&lt;br/&gt;&amp;lt;block 1&amp;gt;&lt;br/&gt;/ trials = [1= practice1;2=practice2;3=question]&lt;br/&gt;/ stop = [values.timeout==2200]&lt;br/&gt;/ postinstructions = (practiceend)&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;the script then terminates as expected. If you want to run &amp;lt;block 1&amp;gt; again, use /branch as discussed previously.</description><pubDate>Mon, 29 Jun 2015 09:32:21 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Branch syntax</title><link>https://forums.millisecond.com/Topic16619.aspx</link><description>[Post mistakenly edited, resulting in loss of contents. Apologies. -Dave]&lt;br/&gt;</description><pubDate>Mon, 29 Jun 2015 07:34:38 GMT</pubDate><dc:creator>nakayama</dc:creator></item><item><title>RE: Branch syntax</title><link>https://forums.millisecond.com/Topic16611.aspx</link><description>Of course you can do it on the &amp;lt;trial&amp;gt;-level:&lt;br/&gt;&lt;br/&gt;&amp;lt;trial question&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ ontrialend = [if (trial.question.error) values.timeout += 100 else values.timeout -= 100]&lt;br/&gt;...&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block 1&amp;gt;&lt;br/&gt;/ stop = [values.timeout == 2200]&lt;br/&gt;...&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;</description><pubDate>Mon, 29 Jun 2015 00:40:09 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Branch syntax</title><link>https://forums.millisecond.com/Topic16605.aspx</link><description>Hi, Dave,&lt;br/&gt;I almost got the concept of branch syntax, but still not very skillful. Would you help me with this? &lt;br/&gt;I am doing an adaptive method on temporal stimulus, since the variable is "timeout', I guess I can't do it on trial level.&amp;nbsp;&lt;br/&gt;The rule is like this:&lt;br/&gt;Once subject makes a wrong response in "question", the timeout of "target" goes up by 100ms, else goes down by 100ms.&lt;br/&gt;The block keeps running until the "timeout" of target is equals to the "timeout" of standard.&lt;br/&gt;I tried to write syntax like this, but it just stopped by one run.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial standard&amp;gt;&lt;br/&gt;/ stimulustimes = [1=fixation;2000=target;]&lt;br/&gt;/ recorddata = true&lt;br/&gt;/ timeout = 2200&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial target&amp;gt;&lt;br/&gt;/ stimulustimes = [1=fixation;2000=target;]&lt;br/&gt;/ recorddata = true&lt;br/&gt;/ timeout = values.timeout&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/timeout=3000&lt;br/&gt;/block=10&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block 1&amp;gt;&lt;br/&gt;/ onblockbegin = [if (values.block&amp;gt;10)values.timeout+=100 else values.timeout-=100 ]&lt;br/&gt;/ trials = [1= standard;2=target;3=question]&lt;br/&gt;/ branch = [if(trial.question.correct) values.block-=1 &amp;amp;&amp;amp; block.1 else values.block+=1 &amp;amp;&amp;amp; block.1]&lt;br/&gt;/ onblockend = [values.block=1]&lt;br/&gt;/postinstructions = (practiceend)&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;expt&amp;gt;&lt;br/&gt;/preinstructions = (instruction)&lt;br/&gt;/postinstructions = (result)&lt;br/&gt;/blocks = [1 = 1;]&lt;br/&gt;&amp;lt;/expt&amp;gt;&amp;nbsp; &amp;nbsp;&lt;br/&gt;&lt;br/&gt;Best Wishes,&lt;br/&gt;nakayama</description><pubDate>Sat, 27 Jun 2015 02:06:11 GMT</pubDate><dc:creator>nakayama</dc:creator></item><item><title>RE: Branch syntax</title><link>https://forums.millisecond.com/Topic16601.aspx</link><description>It works! Thank you!</description><pubDate>Fri, 26 Jun 2015 09:11:31 GMT</pubDate><dc:creator>nakayama</dc:creator></item><item><title>RE: Branch syntax</title><link>https://forums.millisecond.com/Topic16598.aspx</link><description>&amp;lt;block 1&amp;gt;&lt;br/&gt;/ trials = [1= practice1;2=practice2;3=instruction1]&lt;br/&gt;/ postinstructions = (practiceend)&lt;br/&gt;/ branch=[if (&lt;strong&gt;trial.instruction1.correct&lt;/strong&gt;) block.2]&lt;br/&gt;&amp;lt;/block&amp;gt;</description><pubDate>Thu, 25 Jun 2015 09:35:14 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Branch syntax</title><link>https://forums.millisecond.com/Topic16597.aspx</link><description>Thank you for your reply.&lt;br/&gt;That is the past I can't get.&lt;br/&gt;Participants make responses at "instruction1" trial, "practice1" and "practice2" just for stimulus presentation.&lt;br/&gt;How can I choose the block I want to perform depending on whether participants make a correct response in "instruction1" trial?&lt;br/&gt;&amp;lt;block 1&amp;gt;&lt;br/&gt;/ trials = [1= practice1;2=practice2;3=instruction1]&lt;br/&gt;/ postinstructions = (practiceend)&lt;br/&gt;/ branch=[if (block.1.?) block.2]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;Best Wishes,&lt;br/&gt;Nakayama</description><pubDate>Thu, 25 Jun 2015 09:15:36 GMT</pubDate><dc:creator>nakayama</dc:creator></item><item><title>RE: Branch syntax</title><link>https://forums.millisecond.com/Topic16591.aspx</link><description>Of course you can /branch at the &amp;lt;block&amp;gt; level. The respective /branch ought to reside at the &amp;lt;block&amp;gt; level, i.e.&lt;br/&gt;&lt;br/&gt;&amp;lt;block a&amp;gt;&lt;br/&gt;...&lt;br/&gt;/ branch = [if (condition) block.b]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;</description><pubDate>Thu, 25 Jun 2015 04:19:07 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>