﻿<?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 3  » Random duration of trial</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Fri, 17 Apr 2026 13:01:22 GMT</lastBuildDate><ttl>20</ttl><item><title>Random duration of trial</title><link>https://forums.millisecond.com/Topic19065.aspx</link><description>Hi,&lt;br/&gt;&lt;br/&gt;I have a couple of questions&lt;br/&gt;&lt;br/&gt;1) Is it possible to randomize a trial's duration (either using /trialduration or /response = timeout ())? I want to try and have my intertrial interval randomly vary between 500ms and 400ms on any given trial.&lt;br/&gt;&lt;br/&gt;2) I want a particular (mouse-click) response to give participants a 'reward' feedback trial on 80% of trials, while presenting the same mouse-click with a different 'no-reward' feedback trial on the other 20%. I'm not sure how to go about building in these percentages into the branch trials. What's the best way to do this?&lt;br/&gt;&lt;br/&gt;Thanks,&lt;br/&gt;&lt;br/&gt;Jay</description><pubDate>Thu, 12 May 2016 09:38:51 GMT</pubDate><dc:creator>***JayD***</dc:creator></item><item><title>RE: Random duration of trial</title><link>https://forums.millisecond.com/Topic19066.aspx</link><description>Re. #1: Yes. You can do something like&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ randomiti = 0&lt;br/&gt;...&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;with &lt;br/&gt;&lt;br/&gt;&amp;lt;trial iti&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.randomiti = round(rand(400,500))]&lt;br/&gt;...&lt;br/&gt;/ trialduration = values.randomiti&lt;br/&gt;...&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;/pre- and /posttrialpause, /timeout and /trialduration all accept values which you can set at will via /ontrialbegin etc.&lt;br/&gt;&lt;br/&gt;For the relationship between the various timing components involved in a &amp;lt;trial&amp;gt; see the "&lt;span class="header1"&gt;How to Control Trial Duration and Inter-Trial Intervals" topic in the documentation.&lt;br/&gt;&lt;br/&gt;Re. #2: Not sure why you would need any elaborate /branch logic, but the question is underspecified. For example, it's not clear if the "specific response" is the only allowed response; if not, you cannot possibly know how many times a participant will actually provide the "specific response", i.e., it may not even be possible to achieve the 80/20 split. Suppose the participant only provides the "specific" response twice across however many trials you have: You could at best achieve a 50/50 split in that situation.&lt;br/&gt;&lt;br/&gt;If, otoh, there is only that single "specific response", you can simply do&lt;br/&gt;&lt;br/&gt;&amp;lt;block someblock&amp;gt;&lt;br/&gt;/ trials = [1-10 = noreplace(rewardtrial, rewardtrial, rewardtrial, rewardtrial, norewardtrial)]&lt;br/&gt;...&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;which will run 8 "reward" trials and 2 "no reward" trials. No branching required.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/span&gt;</description><pubDate>Thu, 12 May 2016 09:38:51 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>