﻿<?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  » Select Random Trial</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Sun, 31 May 2026 16:41:23 GMT</lastBuildDate><ttl>20</ttl><item><title>Select Random Trial</title><link>https://forums.millisecond.com/Topic17448.aspx</link><description>Hi there,&lt;br/&gt;&lt;br/&gt;So I am new to Inquisit and I am not even sure if this is possible, but what I'm looking to accomplish is randomly have a trial selected once all the trials have been completed. As a bit of background, the goal of this experiment is to choose between a guaranteed monetary amount and lottery where the participant has a chance to win more. There are 100+ trials all with varying lottery percentages and winning amounts, and after the experiment is over, a trial is selected at random and the participant wins the amount of money that was given to them on that specific trial. Is there any language that can allow me to do this?&amp;nbsp;&lt;br/&gt;&lt;br/&gt;Thanks</description><pubDate>Wed, 21 Oct 2015 11:16:26 GMT</pubDate><dc:creator>nonamenick</dc:creator></item><item><title>RE: Select Random Trial</title><link>https://forums.millisecond.com/Topic17449.aspx</link><description>You need to store every trial's payout amount somewhere (in a &amp;lt;list&amp;gt; or &amp;lt;item&amp;gt; element) at runtime and then retrieve one of the entries at random at the end of the experiment. Simple example:&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ fixedwin = 100&lt;br/&gt;/ randomwin = 0&lt;br/&gt;/ winamount = 0&lt;br/&gt;/ score = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list randomwins&amp;gt;&lt;br/&gt;/ items = (10, 25, 50, 75, 150, 300, 450, 600)&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial choicetrial&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.randomwin=list.randomwins.nextvalue]&lt;br/&gt;/ ontrialend = [if (trial.choicetrial.response=="fixed_amount") values.winamount = values.fixedwin else &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.winamount = values.randomwin; ]&lt;br/&gt;/ ontrialend = [item.storedwinnings.appenditem(values.winamount); values.score+=values.winamount; ]&lt;br/&gt;/ stimulusframes = [1=question,fixed_amount, random_amount, score]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ validresponse = (fixed_amount, random_amount)&lt;br/&gt;/ branch = [trial.resulttrial]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial resulttrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1=winamount, score]&lt;br/&gt;/ validresponse = (0)&lt;br/&gt;/ trialduration = 1000&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial payouttrial&amp;gt;&lt;br/&gt;/ stimulusframes = [1=payoutmsg, payout, trialmsg]&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block choiceblock&amp;gt;&lt;br/&gt;/ trials = [1-8=choicetrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block payoutblock&amp;gt;&lt;br/&gt;/ trials = [1=payouttrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;expt&amp;gt;&lt;br/&gt;/ blocks = [1=choiceblock; 2=payoutblock]&lt;br/&gt;&amp;lt;/expt&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item storedwinnings&amp;gt;&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text fixed_amount&amp;gt;&lt;br/&gt;/ items = ("FIXED WIN")&lt;br/&gt;/ position = (25%, 75%)&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text random_amount&amp;gt;&lt;br/&gt;/ items = ("RANDOM WIN")&lt;br/&gt;/ position = (75%, 75%)&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text question&amp;gt;&lt;br/&gt;/ items = ("Would you like to win a FIXED or RANDOM amount?")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text score&amp;gt;&lt;br/&gt;/ items = ("Total: &amp;lt;%values.score%&amp;gt;")&lt;br/&gt;/ position = (50%, 25%)&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text winamount&amp;gt;&lt;br/&gt;/ items = ("You won &amp;lt;%values.winamount%&amp;gt;.")&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text payoutmsg&amp;gt;&lt;br/&gt;/ items = ("Your payout is")&lt;br/&gt;/ position = (50%, 40%)&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text payout&amp;gt;&lt;br/&gt;/ items = storedwinnings&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text trialmsg&amp;gt;&lt;br/&gt;/ items = ("which is the amount you won in trial #&amp;lt;%text.payout.currentitemnumber%&amp;gt;.")&lt;br/&gt;/ position = (50%, 60%)&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;</description><pubDate>Wed, 21 Oct 2015 11:16:26 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>