﻿<?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  » Random Time Interval Generation as task for Inquisit </title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Thu, 02 Jul 2026 00:02:00 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Random Time Interval Generation as task for Inquisit</title><link>https://forums.millisecond.com/Topic11834.aspx</link><description>&lt;p&gt;[quote]&amp;lt;trial task&amp;gt;&lt;br /&gt;/ ontrialbegin = [if(trial.task.trialcount==0)values.start=script.elapsedtime&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else values.start=values.timeoflastresponse]&lt;br /&gt;&lt;span style="color: #ff0000;"&gt;&lt;span style="text-decoration: underline;"&gt;/ ontrialbegin = [values.bcount = 0]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;/ ontrialend = [values.timeoflastresponse=script.elapsedtime]&lt;br /&gt;/ ontrialend = [values.timebetweenresponses=values.timeoflastresponse-values.start]&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;/ ontrialend = [values.bcount = &lt;b&gt;what should I type here?]&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;/ stimulustimes = [0 = start]&lt;br /&gt;/ validresponse = ("b")&lt;br /&gt;/ responsetime = 0&lt;br /&gt;/ branch = [trial.task]&lt;br /&gt;&amp;lt;/trial&amp;gt;[/quote]&lt;/p&gt;
&lt;p&gt;#1: You *don't* want to reset that value to zero in every trial. You'll want to reset it at the beginning of a block (if at all).&lt;/p&gt;
&lt;p&gt;[quote]&amp;lt;trial task&amp;gt;&lt;br /&gt;/ ontrialbegin = [if(trial.task.trialcount==0)values.start=script.elapsedtime&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else values.start=values.timeoflastresponse]&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;/ ontrialbegin = [values.bcount = 0]&lt;/span&gt;&lt;br /&gt;/ ontrialend = [values.timeoflastresponse=script.elapsedtime]&lt;br /&gt;/ ontrialend = [values.timebetweenresponses=values.timeoflastresponse-values.start]&lt;br /&gt;&lt;span style="color: #ff0000;"&gt;&lt;span style="text-decoration: underline;"&gt;/ ontrialend = [values.bcount = &lt;b&gt;what should I type here?]&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;/ stimulustimes = [0 = start]&lt;br /&gt;/ validresponse = ("b")&lt;br /&gt;/ responsetime = 0&lt;br /&gt;/ branch = [trial.task]&lt;br /&gt;&amp;lt;/trial&amp;gt;[/quote]&lt;/p&gt;
&lt;p&gt;#2: Simply increase it by one:&lt;/p&gt;
&lt;p&gt;/ontrialend = [values.bcount += 1]&lt;/p&gt;</description><pubDate>Mon, 09 Dec 2013 03:40:11 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Random Time Interval Generation as task for Inquisit</title><link>https://forums.millisecond.com/Topic11833.aspx</link><description>&lt;p&gt;Yes, I know that.&lt;/p&gt;

&lt;p&gt;I have something like that:&lt;/p&gt;
&lt;p&gt;&amp;lt;trial task&amp;gt;&lt;br /&gt;/ ontrialbegin = [if(trial.task.trialcount==0)values.start=script.elapsedtime&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else values.start=values.timeoflastresponse]&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;/ ontrialbegin = [values.bcount = 0]&lt;/span&gt;&lt;br /&gt;/ ontrialend = [values.timeoflastresponse=script.elapsedtime]&lt;br /&gt;/ ontrialend = [values.timebetweenresponses=values.timeoflastresponse-values.start]&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;/ ontrialend = [values.bcount = &lt;b&gt;what should I type here?]&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;/ stimulustimes = [0 = start]&lt;br /&gt;/ validresponse = ("b")&lt;br /&gt;/ responsetime = 0&lt;br /&gt;/ branch = [trial.task]&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;/p&gt;
&lt;p&gt;But don't know what to write in place of "what..."&lt;/p&gt;</description><pubDate>Mon, 09 Dec 2013 03:32:24 GMT</pubDate><dc:creator>pawelstrojny</dc:creator></item><item><title>RE: Random Time Interval Generation as task for Inquisit</title><link>https://forums.millisecond.com/Topic11832.aspx</link><description>&lt;p&gt;You can do that using &amp;lt;values&amp;gt; and/or &amp;lt;expressions&amp;gt; as well as a bit of conditional logic via event attribiutes (/ontrialbegin, /ontrialend, etc.).&lt;/p&gt;</description><pubDate>Mon, 09 Dec 2013 03:26:52 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Random Time Interval Generation as task for Inquisit</title><link>https://forums.millisecond.com/Topic11831.aspx</link><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have one more question:&lt;/p&gt;
&lt;p&gt;I need to verify if subjects are pressing the button more than 5 times (to calculate the level of randomness later), I figured out that I need to add branch which will decide about the feedback (if he pressed less than 6 times - feedback "you need to press more" or if 6 or more&amp;nbsp; - no feedback).&lt;/p&gt;
&lt;p&gt;Which I don't know is how can I make Inquisit count the number of valid responses in a trial?&lt;/p&gt;
&lt;p&gt;Because I need an expression in branch (e.g.) ... [responsecount] &amp;gt; 5 ... Am I correct?&lt;/p&gt;</description><pubDate>Mon, 09 Dec 2013 03:19:06 GMT</pubDate><dc:creator>pawelstrojny</dc:creator></item><item><title>RE: Random Time Interval Generation as task for Inquisit</title><link>https://forums.millisecond.com/Topic11565.aspx</link><description>&lt;p&gt;Yes it is (and it works as expected), but that's irrelevant to your problem. With &amp;lt;trial&amp;gt;-level /timeout, the specified /timeout *applies to every instance of the given trial* -- whenever a new trial starts, that trial has 10 secs to complete. That's the way it should be. And your script will run an infinite amount of trials due to the /branch, it'll never stop (and it should not).&lt;/p&gt;</description><pubDate>Thu, 31 Oct 2013 04:43:21 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Random Time Interval Generation as task for Inquisit</title><link>https://forums.millisecond.com/Topic11564.aspx</link><description>&lt;p&gt;Ok, so I can do that.&lt;/p&gt;
&lt;p&gt;But in documentation about trial element the "timeout" command is present...&lt;/p&gt;</description><pubDate>Thu, 31 Oct 2013 04:27:30 GMT</pubDate><dc:creator>pawelstrojny</dc:creator></item><item><title>RE: Random Time Interval Generation as task for Inquisit</title><link>https://forums.millisecond.com/Topic11563.aspx</link><description>&lt;p&gt;Yes, of course.&lt;/p&gt;</description><pubDate>Thu, 31 Oct 2013 04:24:08 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Random Time Interval Generation as task for Inquisit</title><link>https://forums.millisecond.com/Topic11561.aspx</link><description>&lt;p&gt;So if I want to have sequence in block (eg. task - feedback) I need to use two blocks?&lt;/p&gt;

&lt;p&gt;I mean:&lt;/p&gt;
&lt;p&gt;&amp;lt;block block1&amp;gt;&lt;br /&gt;/ trials = [1=task; 2=control]&lt;br /&gt;&amp;lt;/block&amp;gt;&lt;/p&gt;
&lt;p&gt;referring to:&lt;/p&gt;
&lt;p&gt;&amp;lt;trial task&amp;gt;&lt;br /&gt;/ timeout = 10000&lt;br /&gt;/ ontrialbegin = [if(trial.task.trialcount==0)values.start=script.elapsedtime&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else values.start=values.timeoflastresponse]&lt;br /&gt;/ ontrialend = [values.timeoflastresponse=script.elapsedtime]&lt;br /&gt;/ ontrialend = [values.timebetweenresponses=values.timeoflastresponse-values.start]&lt;br /&gt;/ stimulustimes = [0 = start]&lt;br /&gt;/ validresponse = ("b")&lt;br /&gt;/ responsetime = 0&lt;br /&gt;/ branch = [trial.task]&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;&amp;lt;survey control&amp;gt;&lt;br /&gt;/ pages = [1=control]&lt;br /&gt;/ itemspacing = 2%&lt;br /&gt;/ showpagenumbers = false&lt;br /&gt;/ responsefontstyle = ("Arial", 1.1%, false, false, false, false, 5)&lt;br /&gt;/ itemfontstyle = ("Arial", 1.5%, false, false, false, false, 5)&lt;br /&gt;/ pagefontstyle = ("Arial", 1.8%, false, false, false, false, 5)&lt;br /&gt;&amp;lt;/survey&amp;gt;&lt;/p&gt;
&lt;p&gt;And I want to have 10 sec task and then survey element.&lt;/p&gt;</description><pubDate>Thu, 31 Oct 2013 04:21:49 GMT</pubDate><dc:creator>pawelstrojny</dc:creator></item><item><title>RE: Random Time Interval Generation as task for Inquisit</title><link>https://forums.millisecond.com/Topic11560.aspx</link><description>&lt;p&gt;The /timeout needs to be at the &amp;lt;block&amp;gt; level just as in the example I gave you.&lt;/p&gt;</description><pubDate>Thu, 31 Oct 2013 04:17:05 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Random Time Interval Generation as task for Inquisit</title><link>https://forums.millisecond.com/Topic11557.aspx</link><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Basing on Dave's solution I prepared script but something isn't working properly.&lt;/p&gt;
&lt;p&gt;Problematic script elements:&lt;/p&gt;
&lt;p&gt;&amp;lt;block practice&amp;gt;&lt;br /&gt;/ trials = [1=practice]&lt;br /&gt;&amp;lt;/block&amp;gt;&lt;/p&gt;
&lt;p&gt;which refers to:&lt;/p&gt;
&lt;p&gt;&amp;lt;trial practice&amp;gt;&lt;br /&gt;/ timeout = 10000&lt;br /&gt;/ ontrialbegin = [if(trial.practice.trialcount==0)values.start=script.elapsedtime&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else values.start=values.timeoflastresponse]&lt;br /&gt;/ ontrialend = [values.timeoflastresponse=script.elapsedtime]&lt;br /&gt;/ ontrialend = [values.timebetweenresponses=values.timeoflastresponse-values.start]&lt;br /&gt;/ stimulustimes = [0 = start]&lt;br /&gt;/ validresponse = ("b")&lt;br /&gt;/ responsetime = 0&lt;br /&gt;/ branch = [trial.practice]&lt;br /&gt;/ recorddata = false&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;/p&gt;
&lt;p&gt;When I test only trial element (blue "play" triangle) - everything works, when I test block (again blue triangle) or a whole script - trial doesn't ends after 10 seconds (the message is being displayed until I reset script by Alt+Esc)&lt;/p&gt;
&lt;p&gt;Where is the mistake?&lt;/p&gt;</description><pubDate>Thu, 31 Oct 2013 01:03:10 GMT</pubDate><dc:creator>pawelstrojny</dc:creator></item><item><title>RE: Random Time Interval Generation as task for Inquisit</title><link>https://forums.millisecond.com/Topic11514.aspx</link><description>&lt;p&gt;Thank you!&lt;/p&gt;</description><pubDate>Wed, 23 Oct 2013 07:29:34 GMT</pubDate><dc:creator>pawelstrojny</dc:creator></item><item><title>RE: Random Time Interval Generation as task for Inquisit</title><link>https://forums.millisecond.com/Topic11513.aspx</link><description>&lt;p style="padding-left: 30px;"&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;lt;values&amp;gt;&lt;br /&gt;/ start = 0&lt;br /&gt;/ timeoflastresponse = 0&lt;br /&gt;/ timebetweenresponses = 0&lt;br /&gt;&amp;lt;/values&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;expt LoseFail&amp;gt;&lt;br /&gt;/ blocks = [&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 = Instruction;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 = Task;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3 = End_Debriefing&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ]&lt;br /&gt;&amp;lt;/expt&amp;gt;&lt;br /&gt;&lt;br /&gt;***Blocks***&lt;br /&gt;&lt;br /&gt;&amp;lt;block instruction&amp;gt;&lt;br /&gt;/ trials = [1=instruction]&lt;br /&gt;&amp;lt;/block&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;block task&amp;gt;&lt;br /&gt;/ trials = [1=task]&lt;br /&gt;&lt;span style="color: #ff0000;"&gt;/ timeout = 10000&lt;/span&gt;&lt;br /&gt;&amp;lt;/block&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;block end_debriefing&amp;gt;&lt;br /&gt;/ trials = [1=debriefing]&lt;br /&gt;&amp;lt;/block&amp;gt;&lt;br /&gt;&lt;br /&gt;***Trials***&lt;br /&gt;&lt;br /&gt;&amp;lt;trial instruction&amp;gt;&lt;br /&gt;/ stimulusframes = [1=instructions]&lt;br /&gt;/ validresponse = (" ")&lt;br /&gt;/ recorddata = false&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;trial task&amp;gt;&lt;br /&gt;&lt;span style="color: #ff0000;"&gt;/ ontrialbegin = [if(trial.task.trialcount==0)values.start=script.elapsedtime&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else values.start=values.timeoflastresponse]&lt;br /&gt;/ ontrialend = [values.timeoflastresponse=script.elapsedtime]&lt;br /&gt;/ ontrialend = [values.timebetweenresponses=values.timeoflastresponse-values.start]&lt;/span&gt;&lt;br /&gt;/ stimulustimes = [0 = start]&lt;br /&gt;/ validresponse = ("b")&lt;br /&gt;/ responsetime = 0&lt;br /&gt;&lt;span style="color: #ff0000;"&gt;/ branch = [trial.task]&lt;/span&gt;&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;trial debriefing&amp;gt;&lt;br /&gt;/ stimulusframes = [1=debriefing]&lt;br /&gt;/ validresponse = (" ")&lt;br /&gt;/ recorddata = false&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;br /&gt;&lt;br /&gt;***Items***&lt;br /&gt;&lt;br /&gt;&amp;lt;text instructions&amp;gt;&lt;br /&gt;/ items = ("instructions")&lt;br /&gt;/ size = (75%, 75%)&lt;br /&gt;/ hjustify = left&lt;br /&gt;&amp;lt;/text&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;text start&amp;gt;&lt;br /&gt;/ items = ("Please push ~"b~" as random as you can")&lt;br /&gt;/ erase = false&lt;br /&gt;/ size = (75%, 75%)&lt;br /&gt;/ hjustify = left&lt;br /&gt;&amp;lt;/text&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;text debriefing&amp;gt;&lt;br /&gt;/ items = ("debriefing")&lt;br /&gt;/ size = (75%, 75%)&lt;br /&gt;/ hjustify = left&lt;br /&gt;&amp;lt;/text&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;data&amp;gt;&lt;br /&gt;/ columns = [trialnum, values.start, values.timeoflastresponse, values.timebetweenresponses]&lt;br /&gt;&amp;lt;/data&amp;gt;&lt;/span&gt;&lt;/p&gt;</description><pubDate>Wed, 23 Oct 2013 05:17:05 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>Random Time Interval Generation as task for Inquisit </title><link>https://forums.millisecond.com/Topic11512.aspx</link><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I need to write a simple (?) script in which subjects will be asked to push one button (lets say "b") for some amount of time (lets say 10s = 10000ms) as "randomly"/arrhythmical as possible.&lt;/p&gt;
&lt;p&gt;The one and only thing I need from this script is to measure response time of every push &lt;/p&gt;
&lt;p&gt;- e.g. if subject pushed 3 times; (1st in t1; 2nd in t2; 3rd in t3) &lt;/p&gt;
&lt;p&gt;script should record 3 response times (t1 - start; t2 - t1 and t3 - t2) - &lt;/p&gt;
&lt;p&gt;basically I need the time gap between every two reactions.&lt;/p&gt;
&lt;p&gt;I tried to write it like below, but I don't know how to make it record every push (not only the first one).&lt;/p&gt;
&lt;p&gt;****script*****&lt;/p&gt;
&lt;p&gt;&amp;lt;expt LoseFail&amp;gt;&lt;br /&gt;/ blocks = [ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 1 = Instruction;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 2 = Task; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 3 = End_Debriefing&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ]&lt;br /&gt;&amp;lt;/expt&amp;gt;&lt;br /&gt;&lt;br /&gt;***Blocks***&lt;br /&gt;&lt;br /&gt;&amp;lt;block instruction&amp;gt;&lt;br /&gt;/ trials = [1=instruction]&lt;br /&gt;&amp;lt;/block&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;block task&amp;gt;&lt;br /&gt;/ trials = [1=task]&lt;br /&gt;&amp;lt;/block&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;block end_debriefing&amp;gt;&lt;br /&gt;/ trials = [1=debriefing]&lt;br /&gt;&amp;lt;/block&amp;gt;&lt;br /&gt;&lt;br /&gt;***Trials***&lt;br /&gt;&lt;br /&gt;&amp;lt;trial instruction&amp;gt;&lt;br /&gt;/ stimulusframes = [1=instructions]&lt;br /&gt;/ validresponse = (" ")&lt;br /&gt;/ recorddata = false&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;trial task&amp;gt;&lt;br /&gt;/ stimulustimes = [0 = start]&lt;br /&gt;/ validresponse = ("b")&lt;br /&gt;/ responsetime = 0&lt;br /&gt;/ trialduration = 10000&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;trial debriefing&amp;gt;&lt;br /&gt;/ stimulusframes = [1=debriefing]&lt;br /&gt;/ validresponse = (" ")&lt;br /&gt;/ recorddata = false&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;br /&gt;&lt;br /&gt;***Items***&lt;br /&gt;&lt;br /&gt;&amp;lt;text instructions&amp;gt;&lt;br /&gt;/ items = ("instructions")&lt;br /&gt;/ size = (75%, 75%)&lt;br /&gt;/ hjustify = left&lt;br /&gt;&amp;lt;/text&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;text start&amp;gt;&lt;br /&gt;/ items = ("Please push "b" as random as you can")&lt;br /&gt;/ erase = false&lt;br /&gt;/ size = (75%, 75%)&lt;br /&gt;/ hjustify = left&lt;br /&gt;&amp;lt;/text&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;text debriefing&amp;gt;&lt;br /&gt;/ items = ("debriefing")&lt;br /&gt;/ size = (75%, 75%)&lt;br /&gt;/ hjustify = left&lt;br /&gt;&amp;lt;/text&amp;gt;&lt;/p&gt;
&lt;p&gt;*********&lt;/p&gt;
&lt;p&gt;Could you please help me with that?&lt;/p&gt;</description><pubDate>Wed, 23 Oct 2013 04:52:07 GMT</pubDate><dc:creator>pawelstrojny</dc:creator></item></channel></rss>