﻿<?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 6  » Using stimulustimes: can you have a variable instead of an integer?</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Sun, 20 Sep 2026 02:53:08 GMT</lastBuildDate><ttl>20</ttl><item><title>Using stimulustimes: can you have a variable instead of an integer?</title><link>https://forums.millisecond.com/Topic29837.aspx</link><description>Hello,&lt;br/&gt;&lt;br/&gt;I would like my stimuli to be displayed at different times depending on previous user performance. &lt;br/&gt;&lt;br/&gt;My code worked fine before, when I had: &lt;br/&gt;/ stimulustimes = [0=target;200=wordyellowcolorredup; 1800=target]&lt;br/&gt;&lt;br/&gt;It doesn't work when I have:&lt;br/&gt;/ stimulustimes = [0=target; 200=wordyellowcolorredup; values.buttonRT=target]&lt;br/&gt;&lt;br/&gt;Is this a limitation of Inquisit? Do you have any suggestions for how I can dynamically update my stimulus timing?&lt;br/&gt;&lt;br/&gt;Thanks so much,&lt;br/&gt;Abby</description><pubDate>Thu, 08 Oct 2020 01:24:19 GMT</pubDate><dc:creator>AbigailNovick</dc:creator></item><item><title>RE: Using stimulustimes: can you have a variable instead of an integer?</title><link>https://forums.millisecond.com/Topic29843.aspx</link><description>&lt;blockquote data-id="29840" class="if-quote-wrapper" unselectable="on" data-guid="1602120245008" contenteditable="false" id="if_insertedNode_1602120243227"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29840" 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="29840" 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="29840" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 10/7/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29840"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;&lt;blockquote data-id="29839" class="if-quote-wrapper" unselectable="on" data-guid="1602120245008" id="if_insertedNode_1602096701511" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29839" 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="29839" 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="29839" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;AbigailNovick - 10/7/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29839"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;Thanks for pointing me to this function!&lt;br/&gt;&lt;br/&gt;Unfortunately I don't think it's working. I tried making a giant white rectangle to mask out the stimulus right after it was displayed. The rectangle never appears, and the stimulus is visible for the entire duration of the trial (when I only want it to be visible for a few milliseconds). Am I doing something wrong here?&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/buttonRT = 205&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape whiteRectangle&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = white&lt;br/&gt;/ size = (1000, 1000)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial example&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp; trial.example.resetstimulusframes():&lt;br/&gt;&amp;nbsp; trial.example.insertstimulustime(shape.whiteRectangle, values.buttonRT);&lt;br/&gt;]&lt;br/&gt;/ stimulustimes = [0=target; 200=values.wordredcolorredup]&lt;br/&gt;/ trialduration = 1800&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="29839"&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;There's a typo in the code (which originated with my example).&lt;br/&gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;  trial.example.resetstimulusframes()&lt;font size="6"&gt;:&lt;/font&gt;&lt;br/&gt;  trial.example.insertstimulustime(shape.whiteRectangle, values.buttonRT);&lt;br/&gt;]&lt;br/&gt;&lt;br/&gt;needs to be&lt;br/&gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;trial.example.resetstimulusframes()&lt;font size="6"&gt;;&lt;/font&gt;&lt;br/&gt;trial.example.insertstimulustime(shape.whiteRectangle, values.buttonRT);&lt;br/&gt;]&lt;br/&gt;&lt;br/&gt;to work.&lt;br/&gt;&lt;br/&gt;Another problem is the chosen timing: Your display would have to be running at 200Hz for a 5ms display onset difference between the stimulus and the rectangle to be possible. If your display is running at a lower rate, which is likely, then the stimulus and the rectangle will be drawn to the screen at the exact same time, i.e. you'll never see the target to begin with.&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/buttonRT = 210&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape whiteRectangle&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = white&lt;br/&gt;/ size = (100%, 100%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial example&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;  trial.example.resetstimulusframes();&lt;br/&gt;  trial.example.insertstimulustime(shape.whiteRectangle, values.buttonRT);&lt;br/&gt;]&lt;br/&gt;/ stimulustimes = [0=target; 200=red]&lt;br/&gt;/ trialduration = 1800&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text target&amp;gt;&lt;br/&gt;/ items = ("Target")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text red&amp;gt;&lt;br/&gt;/ items = ("STIMULUS")&lt;br/&gt;/ txcolor = red&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block my&amp;gt;&lt;br/&gt;/ trials = [1-4 = example]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="29840"&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;That did the trick ;) Thanks again, Dave!</description><pubDate>Thu, 08 Oct 2020 01:24:19 GMT</pubDate><dc:creator>AbigailNovick</dc:creator></item><item><title>RE: Using stimulustimes: can you have a variable instead of an integer?</title><link>https://forums.millisecond.com/Topic29840.aspx</link><description>&lt;blockquote data-id="29839" class="if-quote-wrapper" unselectable="on" data-guid="1602096702870" id="if_insertedNode_1602096701511" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29839" 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="29839" 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="29839" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;AbigailNovick - 10/7/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29839"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;Thanks for pointing me to this function!&lt;br/&gt;&lt;br/&gt;Unfortunately I don't think it's working. I tried making a giant white rectangle to mask out the stimulus right after it was displayed. The rectangle never appears, and the stimulus is visible for the entire duration of the trial (when I only want it to be visible for a few milliseconds). Am I doing something wrong here?&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/buttonRT = 205&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape whiteRectangle&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = white&lt;br/&gt;/ size = (1000, 1000)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial example&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp; trial.example.resetstimulusframes():&lt;br/&gt;&amp;nbsp; trial.example.insertstimulustime(shape.whiteRectangle, values.buttonRT);&lt;br/&gt;]&lt;br/&gt;/ stimulustimes = [0=target; 200=values.wordredcolorredup]&lt;br/&gt;/ trialduration = 1800&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="29839"&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;There's a typo in the code (which originated with my example).&lt;br/&gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;  trial.example.resetstimulusframes()&lt;font size="6"&gt;:&lt;/font&gt;&lt;br/&gt;  trial.example.insertstimulustime(shape.whiteRectangle, values.buttonRT);&lt;br/&gt;]&lt;br/&gt;&lt;br/&gt;needs to be&lt;br/&gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;trial.example.resetstimulusframes()&lt;font size="6"&gt;;&lt;/font&gt;&lt;br/&gt;trial.example.insertstimulustime(shape.whiteRectangle, values.buttonRT);&lt;br/&gt;]&lt;br/&gt;&lt;br/&gt;to work.&lt;br/&gt;&lt;br/&gt;Another problem is the chosen timing: Your display would have to be running at 200Hz for a 5ms display onset difference between the stimulus and the rectangle to be possible. If your display is running at a lower rate, which is likely, then the stimulus and the rectangle will be drawn to the screen at the exact same time, i.e. you'll never see the target to begin with.&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/buttonRT = 210&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape whiteRectangle&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = white&lt;br/&gt;/ size = (100%, 100%)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial example&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;  trial.example.resetstimulusframes();&lt;br/&gt;  trial.example.insertstimulustime(shape.whiteRectangle, values.buttonRT);&lt;br/&gt;]&lt;br/&gt;/ stimulustimes = [0=target; 200=red]&lt;br/&gt;/ trialduration = 1800&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text target&amp;gt;&lt;br/&gt;/ items = ("Target")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text red&amp;gt;&lt;br/&gt;/ items = ("STIMULUS")&lt;br/&gt;/ txcolor = red&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block my&amp;gt;&lt;br/&gt;/ trials = [1-4 = example]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Wed, 07 Oct 2020 19:00:06 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Using stimulustimes: can you have a variable instead of an integer?</title><link>https://forums.millisecond.com/Topic29839.aspx</link><description>Hi Dave,&lt;br/&gt;&lt;br/&gt;Thanks for pointing me to this function!&lt;br/&gt;&lt;br/&gt;Unfortunately I don't think it's working. I tried making a giant white rectangle to mask out the stimulus right after it was displayed. The rectangle never appears, and the stimulus is visible for the entire duration of the trial (when I only want it to be visible for a few milliseconds). Am I doing something wrong here?&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/buttonRT = 205&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;shape whiteRectangle&amp;gt;&lt;br/&gt;/ shape = rectangle&lt;br/&gt;/ color = white&lt;br/&gt;/ size = (1000, 1000)&lt;br/&gt;&amp;lt;/shape&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial example&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp; trial.example.resetstimulusframes():&lt;br/&gt;&amp;nbsp; trial.example.insertstimulustime(shape.whiteRectangle, values.buttonRT);&lt;br/&gt;]&lt;br/&gt;/ stimulustimes = [0=target; 200=values.wordredcolorredup]&lt;br/&gt;/ trialduration = 1800&lt;br/&gt;&amp;lt;/trial&amp;gt;</description><pubDate>Wed, 07 Oct 2020 18:11:51 GMT</pubDate><dc:creator>AbigailNovick</dc:creator></item><item><title>RE: Using stimulustimes: can you have a variable instead of an integer?</title><link>https://forums.millisecond.com/Topic29838.aspx</link><description>&lt;blockquote data-id="29837" class="if-quote-wrapper" unselectable="on" data-guid="1602087173178" id="if_insertedNode_1602087171700" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="29837" 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="29837" 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="29837" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;AbigailNovick - 10/7/2020&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-29837"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello,&lt;br/&gt;&lt;br/&gt;I would like my stimuli to be displayed at different times depending on previous user performance. &lt;br/&gt;&lt;br/&gt;My code worked fine before, when I had: &lt;br/&gt;/ stimulustimes = [0=target;200=wordyellowcolorredup; 1800=target]&lt;br/&gt;&lt;br/&gt;It doesn't work when I have:&lt;br/&gt;/ stimulustimes = [0=target; 200=wordyellowcolorredup; values.buttonRT=target]&lt;br/&gt;&lt;br/&gt;Is this a limitation of Inquisit? Do you have any suggestions for how I can dynamically update my stimulus timing?&lt;br/&gt;&lt;br/&gt;Thanks so much,&lt;br/&gt;Abby&lt;a class="if-quote-goto quote-link" href="#" data-id="29837"&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;The way to do this is via the insertstimulustime() function:&lt;br/&gt;&lt;br/&gt;&amp;lt;trial example&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.example.resetstimulusframes():&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;trial.example.insertstimulustime(text.target, values.buttonRT);&lt;br/&gt;]&lt;br/&gt;/ stimulustimes = [0=target; 200=wordyellowcolorredup;]&lt;br/&gt;...&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a href="https://www.millisecond.com/support/docs/v6/html/language/functions/insertstimulustime.htm"&gt;https://www.millisecond.com/support/docs/v6/html/language/functions/insertstimulustime.htm&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Wed, 07 Oct 2020 16:15:57 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>