﻿<?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 5  » enable experimenter to decide the number of trials per type in a block</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Sat, 04 Jul 2026 12:44:03 GMT</lastBuildDate><ttl>20</ttl><item><title>enable experimenter to decide the number of trials per type in a block</title><link>https://forums.millisecond.com/Topic25556.aspx</link><description>Hi Dave,&lt;br/&gt;&lt;br/&gt;In a block with two different type of trials I would like to "enable" the experimenter to choose how many trials per type to run.&lt;br/&gt;The trials will need to be randomised in the block.&lt;br/&gt;&lt;br/&gt;I have done this presenting in the instructions a textbox where the experimenter type the total number of trials and then a slide when s/he can specify the probability a certain type of trial is presented.&lt;br/&gt;&lt;br/&gt;It works fine-ish with a list and setting the pool as the total number of trials and the item probabilities as a slider in the instructions that the experimenter can select.&lt;br/&gt;&lt;br/&gt;However, rather than using the decimal value as itemprobabilities I would like to use the exact number of trials per type, so I can make sure that the exact number of trials is presented per type.&lt;br/&gt;&lt;br/&gt;As one option I was thinking to allow the experimenter to exact the number of trials per type (as integer) and then transforming it in decimal points (that similar to what I am doing) but I was wondering if there was another options.&lt;br/&gt;&lt;br/&gt;Thanks&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Thu, 20 Sep 2018 07:36:04 GMT</pubDate><dc:creator>tecnika</dc:creator></item><item><title>RE: enable experimenter to decide the number of trials per type in a block</title><link>https://forums.millisecond.com/Topic25568.aspx</link><description>&lt;div data-id="25567" class="if-quote-wrapper" unselectable="on" data-guid="1537453450351"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="25567" 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="25567" 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="25567" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;tecnika - Thursday, September 20, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25567"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div class="if-quote-wrapper" unselectable="on" data-id="25563" data-guid="1537453450351"&gt;&lt;a title="Move Cursor Below" class="quote-para" style="display: none;" href="#" unselectable="on" data-id="25563" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a title="Delete Quote" class="quote-delete" style="display: none;" href="#" unselectable="on" data-id="25563" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span class="quote-markup" unselectable="on"&gt;[quote]&lt;/span&gt;&lt;div class="if-quote-header" unselectable="on" contenteditable="false"&gt;&lt;div class="if-quote-toggle-wrapper" unselectable="on"&gt;&lt;a title=" " class="if-quote-toggle quote-link" href="#" data-id="25563"&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="quote-markup" unselectable="on"&gt;[b]&lt;/span&gt;Dave - Wednesday, September 19, 2018&lt;span class="quote-markup" unselectable="on"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25563"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div class="if-quote-wrapper" unselectable="on" data-id="25562" data-guid="1537453450351"&gt;&lt;a title="Move Cursor Below" class="quote-para" style="display: none;" href="#" unselectable="on" data-id="25562" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a title="Delete Quote" class="quote-delete" style="display: none;" href="#" unselectable="on" data-id="25562" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span class="quote-markup" unselectable="on"&gt;[quote]&lt;/span&gt;&lt;div class="if-quote-header" unselectable="on" contenteditable="false"&gt;&lt;div class="if-quote-toggle-wrapper" unselectable="on"&gt;&lt;a title=" " class="if-quote-toggle quote-link" href="#" data-id="25562"&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="quote-markup" unselectable="on"&gt;[b]&lt;/span&gt;tecnika - Wednesday, September 19, 2018&lt;span class="quote-markup" unselectable="on"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25562"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div class="if-quote-wrapper" unselectable="on" data-id="25561" data-guid="1537453450351"&gt;&lt;a title="Move Cursor Below" class="quote-para" style="display: none;" href="#" unselectable="on" data-id="25561" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a title="Delete Quote" class="quote-delete" style="display: none;" href="#" unselectable="on" data-id="25561" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span class="quote-markup" unselectable="on"&gt;[quote]&lt;/span&gt;&lt;div class="if-quote-header" unselectable="on" contenteditable="false"&gt;&lt;div class="if-quote-toggle-wrapper" unselectable="on"&gt;&lt;a title=" " class="if-quote-toggle quote-link" href="#" data-id="25561"&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="quote-markup" unselectable="on"&gt;[b]&lt;/span&gt;tecnika - Wednesday, September 19, 2018&lt;span class="quote-markup" unselectable="on"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25561"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]Dave - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]tecnika - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]Dave - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]tecnika - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]tecnika - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;In a block with two different type of trials I would like to "enable" the experimenter to choose how many trials per type to run.&lt;br/&gt;The trials will need to be randomised in the block.&lt;br/&gt;&lt;br/&gt;I have done this presenting in the instructions a textbox where the experimenter type the total number of trials and then a slide when s/he can specify the probability a certain type of trial is presented.&lt;br/&gt;&lt;br/&gt;It works fine-ish with a list and setting the pool as the total number of trials and the item probabilities as a slider in the instructions that the experimenter can select.&lt;br/&gt;&lt;br/&gt;However, rather than using the decimal value as itemprobabilities I would like to use the exact number of trials per type, so I can make sure that the exact number of trials is presented per type.&lt;br/&gt;&lt;br/&gt;As one option I was thinking to allow the experimenter to exact the number of trials per type (as integer) and then transforming it in decimal points (that similar to what I am doing) but I was wondering if there was another options.&lt;br/&gt;&lt;br/&gt;Thanks&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a href="#" data-id="25556" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;&amp;lt;trial TestInstructions&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.probabilityCue1 = 0]&lt;br/&gt;/ ontrialbegin = [values.probabilityCue2 = 0]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = TestInstructions, Buttons]&lt;br/&gt;/ validresponse = (Buttons)&lt;br/&gt;/ recorddata = false&lt;br/&gt;/ branch = [trial.ITI]&lt;br/&gt;/ ontrialend = [values.pCue1 = textbox.probabilitiesCueGnG.response/textbox.nrTrialsTest.response]&lt;br/&gt;/ ontrialend = [values.pCue2 = format("%.2f", 1.00-values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue1 = format("%.2f", values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue2 = values.pCue2]&lt;br/&gt;/ ontrialend = [values.expBlock = "Test"]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list Cue_random&amp;gt;&lt;br/&gt;/ items = (1, 2)&lt;br/&gt;/ poolsize = 2&lt;br/&gt;/ replace = false&lt;br/&gt;/ selectionmode = random&lt;br/&gt;/ itemprobabilities = [values.probabilityCue1; values.probabilityCue2]&lt;br/&gt;&lt;br/&gt;and here's one example of trial&lt;br/&gt;&lt;br/&gt;&amp;lt;trial 1_tap_V_Cue_Test&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.selectedResp  = 0;]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "Go_noGo") values.selectedResp  = radiobuttons.ResponseStimulusGnG.response]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "skip") values.selectedResp  = "skip"]&lt;br/&gt; &lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {values.currentCue=list.Cue_random.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "predetermined") {values.currentCue=list.Cue_sequence.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.poolsize = textbox.nrTrialsTest.response;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.1 = values.probabilityCue1;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.2 = values.probabilityCue2;}]&lt;br/&gt;/ ontrialbegin = [values.GnG_timeout = textbox.timeoutGnG.response]&lt;br/&gt;/ ontrialbegin = [values.nr_testTrial += 1]&lt;br/&gt;/ ontrialbegin = [values.nr_practiceTrial = 0]&lt;br/&gt;/ ontrialbegin = [picture.Visual_Cue.hposition = 50%; picture.Visual_Cue.vposition = 20%;]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = Go_noGo; 200 = Visual_Cue, Go_noGo, skip]&lt;br/&gt;&lt;br/&gt;/ iscorrectresponse = [(values.currentcue != values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "Go_noGo") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "skip") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == 0)]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [if (values.currentCue == values.GnG_responseImage) &lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_falseAlarms += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_correctRejections += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_correctRejections += 1;}}]&lt;br/&gt;/ ontrialend = [if (values.currentCue != values.GnG_responseImage)&lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_hits += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_misses += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_misses += 1;}}]&lt;br/&gt;&lt;br/&gt;/ timeout = values.GnG_timeout*1000 + 200&lt;br/&gt;/ showmousecursor = true&lt;br/&gt;/ validresponse = (Go_noGo, skip)&lt;br/&gt;/ branch = [if (values.nr_testTrial &amp;lt; textbox.nrTrialsTest.response) trial.1_tap_V_Cue_test else trial.End] &lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a href="#" data-id="25557" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;Item probabilities have to be specified as decimals, so your approach seems like the one to pursue, i.e. convert number of trials indicated to decimals. At least I can't really think of a better one.&lt;br/&gt;&lt;a href="#" data-id="25558" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;thank you Dave for your reply. The fact is the number is never exact ... for instance, if the probability is 0.20 sometimes I got 3 out of then trials of on type... and I cannot explain that. Maybe is there something that need to be specifies in the list?&lt;br/&gt;&lt;a href="#" data-id="25559" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;The list should have a proper poolsize specified or set, i.e. poolsize should be set equal to the total amount of trials. Otherwise something's off with your calculations.&lt;br/&gt;&lt;a href="#" data-id="25560" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;This is how it should be already, shouldn't it?&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.poolsize = textbox.nrTrialsTest.response;}]&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25561"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&amp;lt;textbox nrTrialsTest&amp;gt;&lt;br/&gt;/ caption = "&lt;br/&gt;NR TEST TRIALS - The number of trials in the Test is:"&lt;br/&gt;/ required = true&lt;br/&gt;/ position = (10%, 85%)&lt;br/&gt;/ mask = integer&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&lt;br/&gt;(Sorry for the multiple post, but I could not paste into the forum).&lt;br/&gt;When I set up itemprobabilities (0.20, 0.80) on 10 trials, I would expect 2 items of one type and 8 of the other type. What I can see in one or more occasion are 3 items of one type and 7 of the other type...&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25562"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Found the issue, should have realized this yesterday:&lt;br/&gt;&lt;br/&gt;&amp;lt;list Cue_random&amp;gt;&lt;br/&gt;/ items = (1, 2)&lt;br/&gt;/ poolsize = 2&lt;br/&gt;/ replace = false&lt;br/&gt;/ selectionmode = random&lt;br/&gt;&lt;strong&gt;/ itemprobabilities = [values.probabilityCue1; values.probabilityCue2]&lt;/strong&gt;&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;This won't work, because the list keeps the state values.probabilityCue1 and values.probabilityCue2 were in when the list was initially parsed. That's actually intended / by design. The proper way to change the item probabilities is to set the two properties as in:&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ probabilityCue1 = 0.5&lt;br/&gt;/ probabilityCue2 = 0.5&lt;br/&gt;/ cuenum = 1&lt;br/&gt;/ trialcount = 0&lt;br/&gt;/ ntrials = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list Cue_random&amp;gt;&lt;br/&gt;/ items = (1, 2)&lt;br/&gt;/ poolsize = 2&lt;br/&gt;/ replace = false&lt;br/&gt;/ selectionmode = random&lt;br/&gt;/ itemprobabilities = [values.probabilityCue1; values.probabilityCue2]&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage settings&amp;gt;&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.probabilityCue1 = textbox.p1.response;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.probabilityCue2 = textbox.p2.response;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.ntrials = textbox.ntrials.response;&lt;br/&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.Cue_random.itemprobabilities.1 = values.probabilityCue1;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.Cue_random.itemprobabilities.2 = values.probabilityCue2;&lt;/strong&gt;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.Cue_random.poolsize = values.ntrials;&lt;br/&gt;]&lt;br/&gt;/ questions = [1=p1; 2=p2; 3=ntrials]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;textbox p1&amp;gt;&lt;br/&gt;/ caption = "prob1:"&lt;br/&gt;/ mask = decimal&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&amp;lt;textbox p2&amp;gt;&lt;br/&gt;/ caption = "prob2:"&lt;br/&gt;/ mask = decimal&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&amp;lt;textbox ntrials&amp;gt;&lt;br/&gt;/ caption = "total number of trials:"&lt;br/&gt;/ mask = positiveinteger&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block settingsblock&amp;gt;&lt;br/&gt;/ trials = [1=settings]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block trialblock&amp;gt;&lt;br/&gt;/ trials = [1=mytrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial mytrial&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.trialcount +=1;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.cuenum = list.Cue_random.nextvalue;&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1=cue]&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;/ branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (values.trialcount &amp;lt; values.ntrials) trial.mytrial;&lt;br/&gt;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text cue&amp;gt;&lt;br/&gt;/ items = ("C1", "C2")&lt;br/&gt;/ select = values.cuenum&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;data&amp;gt;&lt;br/&gt;/ separatefiles = true&lt;br/&gt;&amp;lt;/data&amp;gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25563"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Hi Dave,&lt;br/&gt;I had a go and it does 0.50 as probabilities if I put it like that, not sure if I have done it right.&lt;br/&gt;When I set the probabilities in the trial, the number of trials per type is almost right... I believe there are problems with having to transform the total number of trials in decimal point, so the exact number got lost maybe? e.g. I set the number of one type of trial as 31 out a total of 260 trials. Instead of presenting 31 trials of that type, it presents 33.&amp;nbsp;&lt;br/&gt;Is there any other way to set up the exact number of trials? ... probably with a counter?&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25567"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;There is another way, you can essentially leave the &amp;lt;list&amp;gt; empty and then populate it with items (here: the digits 1 and 2) as needed per dummy trials. Here's an example:&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ nCue1 = 0&lt;br/&gt;/ nCue2 = 0&lt;br/&gt;/ cuenum = 1&lt;br/&gt;/ cue1count = 0&lt;br/&gt;/ cue2count = 0&lt;br/&gt;/ trialcount = 0&lt;br/&gt;/ ntrials = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list Cue_random&amp;gt;&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage settings&amp;gt; &lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.nCue1 = textbox.n1.response;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.nCue2 = textbox.n2.response;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.ntrials = values.nCue1 + values.nCue2;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ]&lt;br/&gt;/ questions = [1=n1; 2=n2;]&lt;br/&gt;/ branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; trial.setup_cue1_trials;&lt;br/&gt;]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;textbox n1&amp;gt;&lt;br/&gt;/ caption = "Number of Type 1 Trials:"&lt;br/&gt;/ mask&amp;nbsp; = positiveintegerorzero&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&amp;lt;textbox n2&amp;gt;&lt;br/&gt;/ caption = "Number of Type 2 Trials:"&lt;br/&gt;/ mask&amp;nbsp; = positiveintegerorzero&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial setup_cue1_trials&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.cue1count += 1;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.Cue_random.insertitem(1, 1);&lt;br/&gt;]&lt;br/&gt;/ trialduration = 0&lt;br/&gt;/ branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (values.cue1count &amp;lt; values.nCue1) trial.setup_cue1_trials else trial.setup_cue2_trials;&lt;br/&gt;]&lt;br/&gt;/ recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial setup_cue2_trials&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.cue2count += 1;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.Cue_random.insertitem(2, 1);&lt;br/&gt;]&lt;br/&gt;/ trialduration = 0&lt;br/&gt;/ branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (values.cue2count &amp;lt; values.nCue2) trial.setup_cue2_trials;&lt;br/&gt;]&lt;br/&gt;/ recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;expt&amp;gt;&lt;br/&gt;/ blocks = [1=settingsblock; 2=trialblock]&lt;br/&gt;&amp;lt;/expt&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block settingsblock&amp;gt;&lt;br/&gt;/ trials = [1=settings]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block trialblock&amp;gt;&lt;br/&gt;/ trials = [1=mytrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial mytrial&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.trialcount +=1;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.cuenum = list.Cue_random.nextvalue;&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1=cue]&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;/ branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (values.trialcount &amp;lt; values.ntrials) trial.mytrial;&lt;br/&gt;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text cue&amp;gt;&lt;br/&gt;/ items = ("C1", "C2")&lt;br/&gt;/ select = values.cuenum&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;data&amp;gt;&lt;br/&gt;/ separatefiles = true&lt;br/&gt;&amp;lt;/data&amp;gt;&lt;br/&gt;&lt;br/&gt;That would eliminate the need to worry about any rounding issues with the item probabilities, you should get exactly the discrete amounts of trials you entered in the mask.&lt;br/&gt;</description><pubDate>Thu, 20 Sep 2018 07:36:04 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: enable experimenter to decide the number of trials per type in a block</title><link>https://forums.millisecond.com/Topic25567.aspx</link><description>&lt;div class="if-quote-wrapper" unselectable="on" data-id="25563" data-guid="1537451970027"&gt;&lt;a title="Move Cursor Below" class="quote-para" style="display: none;" contenteditable="false" href="#" unselectable="on" data-id="25563"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a title="Delete Quote" class="quote-delete" style="display: none;" contenteditable="false" href="#" unselectable="on" data-id="25563"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span class="quote-markup" unselectable="on"&gt;[quote]&lt;/span&gt;&lt;div class="if-quote-header" contenteditable="false" unselectable="on"&gt;&lt;div class="if-quote-toggle-wrapper" unselectable="on"&gt;&lt;a title=" " class="if-quote-toggle quote-link" href="#" data-id="25563"&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="quote-markup" unselectable="on"&gt;[b]&lt;/span&gt;Dave - Wednesday, September 19, 2018&lt;span class="quote-markup" unselectable="on"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25563"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div class="if-quote-wrapper" unselectable="on" data-id="25562" data-guid="1537451970027"&gt;&lt;a title="Move Cursor Below" class="quote-para" style="display: none;" contenteditable="false" href="#" unselectable="on" data-id="25562"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a title="Delete Quote" class="quote-delete" style="display: none;" contenteditable="false" href="#" unselectable="on" data-id="25562"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span class="quote-markup" unselectable="on"&gt;[quote]&lt;/span&gt;&lt;div class="if-quote-header" contenteditable="false" unselectable="on"&gt;&lt;div class="if-quote-toggle-wrapper" unselectable="on"&gt;&lt;a title=" " class="if-quote-toggle quote-link" href="#" data-id="25562"&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="quote-markup" unselectable="on"&gt;[b]&lt;/span&gt;tecnika - Wednesday, September 19, 2018&lt;span class="quote-markup" unselectable="on"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25562"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div class="if-quote-wrapper" unselectable="on" data-id="25561" data-guid="1537451970027"&gt;&lt;a title="Move Cursor Below" class="quote-para" style="display: none;" contenteditable="false" href="#" unselectable="on" data-id="25561"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a title="Delete Quote" class="quote-delete" style="display: none;" contenteditable="false" href="#" unselectable="on" data-id="25561"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span class="quote-markup" unselectable="on"&gt;[quote]&lt;/span&gt;&lt;div class="if-quote-header" contenteditable="false" unselectable="on"&gt;&lt;div class="if-quote-toggle-wrapper" unselectable="on"&gt;&lt;a title=" " class="if-quote-toggle quote-link" href="#" data-id="25561"&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="quote-markup" unselectable="on"&gt;[b]&lt;/span&gt;tecnika - Wednesday, September 19, 2018&lt;span class="quote-markup" unselectable="on"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25561"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]Dave - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]tecnika - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]Dave - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]tecnika - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]tecnika - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;In a block with two different type of trials I would like to "enable" the experimenter to choose how many trials per type to run.&lt;br/&gt;The trials will need to be randomised in the block.&lt;br/&gt;&lt;br/&gt;I have done this presenting in the instructions a textbox where the experimenter type the total number of trials and then a slide when s/he can specify the probability a certain type of trial is presented.&lt;br/&gt;&lt;br/&gt;It works fine-ish with a list and setting the pool as the total number of trials and the item probabilities as a slider in the instructions that the experimenter can select.&lt;br/&gt;&lt;br/&gt;However, rather than using the decimal value as itemprobabilities I would like to use the exact number of trials per type, so I can make sure that the exact number of trials is presented per type.&lt;br/&gt;&lt;br/&gt;As one option I was thinking to allow the experimenter to exact the number of trials per type (as integer) and then transforming it in decimal points (that similar to what I am doing) but I was wondering if there was another options.&lt;br/&gt;&lt;br/&gt;Thanks&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a href="#" data-id="25556" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;&amp;lt;trial TestInstructions&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.probabilityCue1 = 0]&lt;br/&gt;/ ontrialbegin = [values.probabilityCue2 = 0]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = TestInstructions, Buttons]&lt;br/&gt;/ validresponse = (Buttons)&lt;br/&gt;/ recorddata = false&lt;br/&gt;/ branch = [trial.ITI]&lt;br/&gt;/ ontrialend = [values.pCue1 = textbox.probabilitiesCueGnG.response/textbox.nrTrialsTest.response]&lt;br/&gt;/ ontrialend = [values.pCue2 = format("%.2f", 1.00-values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue1 = format("%.2f", values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue2 = values.pCue2]&lt;br/&gt;/ ontrialend = [values.expBlock = "Test"]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list Cue_random&amp;gt;&lt;br/&gt;/ items = (1, 2)&lt;br/&gt;/ poolsize = 2&lt;br/&gt;/ replace = false&lt;br/&gt;/ selectionmode = random&lt;br/&gt;/ itemprobabilities = [values.probabilityCue1; values.probabilityCue2]&lt;br/&gt;&lt;br/&gt;and here's one example of trial&lt;br/&gt;&lt;br/&gt;&amp;lt;trial 1_tap_V_Cue_Test&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.selectedResp  = 0;]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "Go_noGo") values.selectedResp  = radiobuttons.ResponseStimulusGnG.response]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "skip") values.selectedResp  = "skip"]&lt;br/&gt; &lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {values.currentCue=list.Cue_random.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "predetermined") {values.currentCue=list.Cue_sequence.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.poolsize = textbox.nrTrialsTest.response;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.1 = values.probabilityCue1;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.2 = values.probabilityCue2;}]&lt;br/&gt;/ ontrialbegin = [values.GnG_timeout = textbox.timeoutGnG.response]&lt;br/&gt;/ ontrialbegin = [values.nr_testTrial += 1]&lt;br/&gt;/ ontrialbegin = [values.nr_practiceTrial = 0]&lt;br/&gt;/ ontrialbegin = [picture.Visual_Cue.hposition = 50%; picture.Visual_Cue.vposition = 20%;]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = Go_noGo; 200 = Visual_Cue, Go_noGo, skip]&lt;br/&gt;&lt;br/&gt;/ iscorrectresponse = [(values.currentcue != values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "Go_noGo") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "skip") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == 0)]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [if (values.currentCue == values.GnG_responseImage) &lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_falseAlarms += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_correctRejections += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_correctRejections += 1;}}]&lt;br/&gt;/ ontrialend = [if (values.currentCue != values.GnG_responseImage)&lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_hits += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_misses += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_misses += 1;}}]&lt;br/&gt;&lt;br/&gt;/ timeout = values.GnG_timeout*1000 + 200&lt;br/&gt;/ showmousecursor = true&lt;br/&gt;/ validresponse = (Go_noGo, skip)&lt;br/&gt;/ branch = [if (values.nr_testTrial &amp;lt; textbox.nrTrialsTest.response) trial.1_tap_V_Cue_test else trial.End] &lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a href="#" data-id="25557" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;Item probabilities have to be specified as decimals, so your approach seems like the one to pursue, i.e. convert number of trials indicated to decimals. At least I can't really think of a better one.&lt;br/&gt;&lt;a href="#" data-id="25558" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;thank you Dave for your reply. The fact is the number is never exact ... for instance, if the probability is 0.20 sometimes I got 3 out of then trials of on type... and I cannot explain that. Maybe is there something that need to be specifies in the list?&lt;br/&gt;&lt;a href="#" data-id="25559" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;The list should have a proper poolsize specified or set, i.e. poolsize should be set equal to the total amount of trials. Otherwise something's off with your calculations.&lt;br/&gt;&lt;a href="#" data-id="25560" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;This is how it should be already, shouldn't it?&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.poolsize = textbox.nrTrialsTest.response;}]&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25561"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&amp;lt;textbox nrTrialsTest&amp;gt;&lt;br/&gt;/ caption = "&lt;br/&gt;NR TEST TRIALS - The number of trials in the Test is:"&lt;br/&gt;/ required = true&lt;br/&gt;/ position = (10%, 85%)&lt;br/&gt;/ mask = integer&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&lt;br/&gt;(Sorry for the multiple post, but I could not paste into the forum).&lt;br/&gt;When I set up itemprobabilities (0.20, 0.80) on 10 trials, I would expect 2 items of one type and 8 of the other type. What I can see in one or more occasion are 3 items of one type and 7 of the other type...&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25562"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Found the issue, should have realized this yesterday:&lt;br/&gt;&lt;br/&gt;&amp;lt;list Cue_random&amp;gt;&lt;br/&gt;/ items = (1, 2)&lt;br/&gt;/ poolsize = 2&lt;br/&gt;/ replace = false&lt;br/&gt;/ selectionmode = random&lt;br/&gt;&lt;strong&gt;/ itemprobabilities = [values.probabilityCue1; values.probabilityCue2]&lt;/strong&gt;&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;This won't work, because the list keeps the state values.probabilityCue1 and values.probabilityCue2 were in when the list was initially parsed. That's actually intended / by design. The proper way to change the item probabilities is to set the two properties as in:&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ probabilityCue1 = 0.5&lt;br/&gt;/ probabilityCue2 = 0.5&lt;br/&gt;/ cuenum = 1&lt;br/&gt;/ trialcount = 0&lt;br/&gt;/ ntrials = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list Cue_random&amp;gt;&lt;br/&gt;/ items = (1, 2)&lt;br/&gt;/ poolsize = 2&lt;br/&gt;/ replace = false&lt;br/&gt;/ selectionmode = random&lt;br/&gt;/ itemprobabilities = [values.probabilityCue1; values.probabilityCue2]&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage settings&amp;gt;&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.probabilityCue1 = textbox.p1.response;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.probabilityCue2 = textbox.p2.response;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.ntrials = textbox.ntrials.response;&lt;br/&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.Cue_random.itemprobabilities.1 = values.probabilityCue1;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.Cue_random.itemprobabilities.2 = values.probabilityCue2;&lt;/strong&gt;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.Cue_random.poolsize = values.ntrials;&lt;br/&gt;]&lt;br/&gt;/ questions = [1=p1; 2=p2; 3=ntrials]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;textbox p1&amp;gt;&lt;br/&gt;/ caption = "prob1:"&lt;br/&gt;/ mask = decimal&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&amp;lt;textbox p2&amp;gt;&lt;br/&gt;/ caption = "prob2:"&lt;br/&gt;/ mask = decimal&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&amp;lt;textbox ntrials&amp;gt;&lt;br/&gt;/ caption = "total number of trials:"&lt;br/&gt;/ mask = positiveinteger&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block settingsblock&amp;gt;&lt;br/&gt;/ trials = [1=settings]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block trialblock&amp;gt;&lt;br/&gt;/ trials = [1=mytrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial mytrial&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.trialcount +=1;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.cuenum = list.Cue_random.nextvalue;&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1=cue]&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;/ branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (values.trialcount &amp;lt; values.ntrials) trial.mytrial;&lt;br/&gt;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text cue&amp;gt;&lt;br/&gt;/ items = ("C1", "C2")&lt;br/&gt;/ select = values.cuenum&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;data&amp;gt;&lt;br/&gt;/ separatefiles = true&lt;br/&gt;&amp;lt;/data&amp;gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25563"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Hi Dave,&lt;br/&gt;I had a go and it does 0.50 as probabilities if I put it like that, not sure if I have done it right.&lt;br/&gt;When I set the probabilities in the trial, the number of trials per type is almost right... I believe there are problems with having to transform the total number of trials in decimal point, so the exact number got lost maybe? e.g. I set the number of one type of trial as 31 out a total of 260 trials. Instead of presenting 31 trials of that type, it presents 33.&amp;nbsp;&lt;br/&gt;Is there any other way to set up the exact number of trials? ... probably with a counter?&lt;br/&gt;</description><pubDate>Thu, 20 Sep 2018 07:05:04 GMT</pubDate><dc:creator>tecnika</dc:creator></item><item><title>RE: enable experimenter to decide the number of trials per type in a block</title><link>https://forums.millisecond.com/Topic25563.aspx</link><description>&lt;div data-id="25562" class="if-quote-wrapper" unselectable="on" data-guid="1537366104911"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="25562" 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="25562" 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="25562" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;tecnika - Wednesday, September 19, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25562"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div class="if-quote-wrapper" unselectable="on" data-id="25561" data-guid="1537366104911"&gt;&lt;a title="Move Cursor Below" class="quote-para" style="display: none;" href="#" unselectable="on" data-id="25561" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a title="Delete Quote" class="quote-delete" style="display: none;" href="#" unselectable="on" data-id="25561" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span class="quote-markup" unselectable="on"&gt;[quote]&lt;/span&gt;&lt;div class="if-quote-header" unselectable="on" contenteditable="false"&gt;&lt;div class="if-quote-toggle-wrapper" unselectable="on"&gt;&lt;a title=" " class="if-quote-toggle quote-link" href="#" data-id="25561"&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="quote-markup" unselectable="on"&gt;[b]&lt;/span&gt;tecnika - Wednesday, September 19, 2018&lt;span class="quote-markup" unselectable="on"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25561"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]Dave - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]tecnika - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]Dave - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]tecnika - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]tecnika - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;In a block with two different type of trials I would like to "enable" the experimenter to choose how many trials per type to run.&lt;br/&gt;The trials will need to be randomised in the block.&lt;br/&gt;&lt;br/&gt;I have done this presenting in the instructions a textbox where the experimenter type the total number of trials and then a slide when s/he can specify the probability a certain type of trial is presented.&lt;br/&gt;&lt;br/&gt;It works fine-ish with a list and setting the pool as the total number of trials and the item probabilities as a slider in the instructions that the experimenter can select.&lt;br/&gt;&lt;br/&gt;However, rather than using the decimal value as itemprobabilities I would like to use the exact number of trials per type, so I can make sure that the exact number of trials is presented per type.&lt;br/&gt;&lt;br/&gt;As one option I was thinking to allow the experimenter to exact the number of trials per type (as integer) and then transforming it in decimal points (that similar to what I am doing) but I was wondering if there was another options.&lt;br/&gt;&lt;br/&gt;Thanks&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a href="#" data-id="25556" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;&amp;lt;trial TestInstructions&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.probabilityCue1 = 0]&lt;br/&gt;/ ontrialbegin = [values.probabilityCue2 = 0]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = TestInstructions, Buttons]&lt;br/&gt;/ validresponse = (Buttons)&lt;br/&gt;/ recorddata = false&lt;br/&gt;/ branch = [trial.ITI]&lt;br/&gt;/ ontrialend = [values.pCue1 = textbox.probabilitiesCueGnG.response/textbox.nrTrialsTest.response]&lt;br/&gt;/ ontrialend = [values.pCue2 = format("%.2f", 1.00-values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue1 = format("%.2f", values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue2 = values.pCue2]&lt;br/&gt;/ ontrialend = [values.expBlock = "Test"]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list Cue_random&amp;gt;&lt;br/&gt;/ items = (1, 2)&lt;br/&gt;/ poolsize = 2&lt;br/&gt;/ replace = false&lt;br/&gt;/ selectionmode = random&lt;br/&gt;/ itemprobabilities = [values.probabilityCue1; values.probabilityCue2]&lt;br/&gt;&lt;br/&gt;and here's one example of trial&lt;br/&gt;&lt;br/&gt;&amp;lt;trial 1_tap_V_Cue_Test&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.selectedResp  = 0;]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "Go_noGo") values.selectedResp  = radiobuttons.ResponseStimulusGnG.response]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "skip") values.selectedResp  = "skip"]&lt;br/&gt; &lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {values.currentCue=list.Cue_random.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "predetermined") {values.currentCue=list.Cue_sequence.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.poolsize = textbox.nrTrialsTest.response;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.1 = values.probabilityCue1;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.2 = values.probabilityCue2;}]&lt;br/&gt;/ ontrialbegin = [values.GnG_timeout = textbox.timeoutGnG.response]&lt;br/&gt;/ ontrialbegin = [values.nr_testTrial += 1]&lt;br/&gt;/ ontrialbegin = [values.nr_practiceTrial = 0]&lt;br/&gt;/ ontrialbegin = [picture.Visual_Cue.hposition = 50%; picture.Visual_Cue.vposition = 20%;]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = Go_noGo; 200 = Visual_Cue, Go_noGo, skip]&lt;br/&gt;&lt;br/&gt;/ iscorrectresponse = [(values.currentcue != values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "Go_noGo") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "skip") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == 0)]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [if (values.currentCue == values.GnG_responseImage) &lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_falseAlarms += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_correctRejections += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_correctRejections += 1;}}]&lt;br/&gt;/ ontrialend = [if (values.currentCue != values.GnG_responseImage)&lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_hits += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_misses += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_misses += 1;}}]&lt;br/&gt;&lt;br/&gt;/ timeout = values.GnG_timeout*1000 + 200&lt;br/&gt;/ showmousecursor = true&lt;br/&gt;/ validresponse = (Go_noGo, skip)&lt;br/&gt;/ branch = [if (values.nr_testTrial &amp;lt; textbox.nrTrialsTest.response) trial.1_tap_V_Cue_test else trial.End] &lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a href="#" data-id="25557" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;Item probabilities have to be specified as decimals, so your approach seems like the one to pursue, i.e. convert number of trials indicated to decimals. At least I can't really think of a better one.&lt;br/&gt;&lt;a href="#" data-id="25558" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;thank you Dave for your reply. The fact is the number is never exact ... for instance, if the probability is 0.20 sometimes I got 3 out of then trials of on type... and I cannot explain that. Maybe is there something that need to be specifies in the list?&lt;br/&gt;&lt;a href="#" data-id="25559" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;The list should have a proper poolsize specified or set, i.e. poolsize should be set equal to the total amount of trials. Otherwise something's off with your calculations.&lt;br/&gt;&lt;a href="#" data-id="25560" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;This is how it should be already, shouldn't it?&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.poolsize = textbox.nrTrialsTest.response;}]&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25561"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&amp;lt;textbox nrTrialsTest&amp;gt;&lt;br/&gt;/ caption = "&lt;br/&gt;NR TEST TRIALS - The number of trials in the Test is:"&lt;br/&gt;/ required = true&lt;br/&gt;/ position = (10%, 85%)&lt;br/&gt;/ mask = integer&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&lt;br/&gt;(Sorry for the multiple post, but I could not paste into the forum).&lt;br/&gt;When I set up itemprobabilities (0.20, 0.80) on 10 trials, I would expect 2 items of one type and 8 of the other type. What I can see in one or more occasion are 3 items of one type and 7 of the other type...&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25562"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Found the issue, should have realized this yesterday:&lt;br/&gt;&lt;br/&gt;&amp;lt;list Cue_random&amp;gt;&lt;br/&gt;/ items = (1, 2)&lt;br/&gt;/ poolsize = 2&lt;br/&gt;/ replace = false&lt;br/&gt;/ selectionmode = random&lt;br/&gt;&lt;strong&gt;/ itemprobabilities = [values.probabilityCue1; values.probabilityCue2]&lt;/strong&gt;&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;This won't work, because the list keeps the state values.probabilityCue1 and values.probabilityCue2 were in when the list was initially parsed. That's actually intended / by design. The proper way to change the item probabilities is to set the two properties as in:&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ probabilityCue1 = 0.5&lt;br/&gt;/ probabilityCue2 = 0.5&lt;br/&gt;/ cuenum = 1&lt;br/&gt;/ trialcount = 0&lt;br/&gt;/ ntrials = 0&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list Cue_random&amp;gt;&lt;br/&gt;/ items = (1, 2)&lt;br/&gt;/ poolsize = 2&lt;br/&gt;/ replace = false&lt;br/&gt;/ selectionmode = random&lt;br/&gt;/ itemprobabilities = [values.probabilityCue1; values.probabilityCue2]&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage settings&amp;gt;&lt;br/&gt;/ ontrialend = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.probabilityCue1 = textbox.p1.response;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.probabilityCue2 = textbox.p2.response;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.ntrials = textbox.ntrials.response;&lt;br/&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.Cue_random.itemprobabilities.1 = values.probabilityCue1;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.Cue_random.itemprobabilities.2 = values.probabilityCue2;&lt;/strong&gt;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.Cue_random.poolsize = values.ntrials;&lt;br/&gt;]&lt;br/&gt;/ questions = [1=p1; 2=p2; 3=ntrials]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;textbox p1&amp;gt;&lt;br/&gt;/ caption = "prob1:"&lt;br/&gt;/ mask = decimal&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&amp;lt;textbox p2&amp;gt;&lt;br/&gt;/ caption = "prob2:"&lt;br/&gt;/ mask = decimal&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&amp;lt;textbox ntrials&amp;gt;&lt;br/&gt;/ caption = "total number of trials:"&lt;br/&gt;/ mask = positiveinteger&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block settingsblock&amp;gt;&lt;br/&gt;/ trials = [1=settings]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block trialblock&amp;gt;&lt;br/&gt;/ trials = [1=mytrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial mytrial&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.trialcount +=1;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; values.cuenum = list.Cue_random.nextvalue;&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1=cue]&lt;br/&gt;/ validresponse = (57)&lt;br/&gt;/ branch = [&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (values.trialcount &amp;lt; values.ntrials) trial.mytrial;&lt;br/&gt;]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text cue&amp;gt;&lt;br/&gt;/ items = ("C1", "C2")&lt;br/&gt;/ select = values.cuenum&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;data&amp;gt;&lt;br/&gt;/ separatefiles = true&lt;br/&gt;&amp;lt;/data&amp;gt;&lt;br/&gt;</description><pubDate>Wed, 19 Sep 2018 07:15:01 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: enable experimenter to decide the number of trials per type in a block</title><link>https://forums.millisecond.com/Topic25562.aspx</link><description>&lt;div class="if-quote-wrapper" unselectable="on" data-id="25561" data-guid="1537346110920"&gt;&lt;a title="Move Cursor Below" class="quote-para" style="display: none;" contenteditable="false" href="#" unselectable="on" data-id="25561"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a title="Delete Quote" class="quote-delete" style="display: none;" contenteditable="false" href="#" unselectable="on" data-id="25561"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span class="quote-markup" unselectable="on"&gt;[quote]&lt;/span&gt;&lt;div class="if-quote-header" contenteditable="false" unselectable="on"&gt;&lt;div class="if-quote-toggle-wrapper" unselectable="on"&gt;&lt;a title=" " class="if-quote-toggle quote-link" href="#" data-id="25561"&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="quote-markup" unselectable="on"&gt;[b]&lt;/span&gt;tecnika - Wednesday, September 19, 2018&lt;span class="quote-markup" unselectable="on"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25561"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]Dave - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]tecnika - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]Dave - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]tecnika - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]tecnika - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;In a block with two different type of trials I would like to "enable" the experimenter to choose how many trials per type to run.&lt;br/&gt;The trials will need to be randomised in the block.&lt;br/&gt;&lt;br/&gt;I have done this presenting in the instructions a textbox where the experimenter type the total number of trials and then a slide when s/he can specify the probability a certain type of trial is presented.&lt;br/&gt;&lt;br/&gt;It works fine-ish with a list and setting the pool as the total number of trials and the item probabilities as a slider in the instructions that the experimenter can select.&lt;br/&gt;&lt;br/&gt;However, rather than using the decimal value as itemprobabilities I would like to use the exact number of trials per type, so I can make sure that the exact number of trials is presented per type.&lt;br/&gt;&lt;br/&gt;As one option I was thinking to allow the experimenter to exact the number of trials per type (as integer) and then transforming it in decimal points (that similar to what I am doing) but I was wondering if there was another options.&lt;br/&gt;&lt;br/&gt;Thanks&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a href="#" data-id="25556" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;&amp;lt;trial TestInstructions&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.probabilityCue1 = 0]&lt;br/&gt;/ ontrialbegin = [values.probabilityCue2 = 0]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = TestInstructions, Buttons]&lt;br/&gt;/ validresponse = (Buttons)&lt;br/&gt;/ recorddata = false&lt;br/&gt;/ branch = [trial.ITI]&lt;br/&gt;/ ontrialend = [values.pCue1 = textbox.probabilitiesCueGnG.response/textbox.nrTrialsTest.response]&lt;br/&gt;/ ontrialend = [values.pCue2 = format("%.2f", 1.00-values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue1 = format("%.2f", values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue2 = values.pCue2]&lt;br/&gt;/ ontrialend = [values.expBlock = "Test"]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list Cue_random&amp;gt;&lt;br/&gt;/ items = (1, 2)&lt;br/&gt;/ poolsize = 2&lt;br/&gt;/ replace = false&lt;br/&gt;/ selectionmode = random&lt;br/&gt;/ itemprobabilities = [values.probabilityCue1; values.probabilityCue2]&lt;br/&gt;&lt;br/&gt;and here's one example of trial&lt;br/&gt;&lt;br/&gt;&amp;lt;trial 1_tap_V_Cue_Test&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.selectedResp  = 0;]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "Go_noGo") values.selectedResp  = radiobuttons.ResponseStimulusGnG.response]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "skip") values.selectedResp  = "skip"]&lt;br/&gt; &lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {values.currentCue=list.Cue_random.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "predetermined") {values.currentCue=list.Cue_sequence.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.poolsize = textbox.nrTrialsTest.response;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.1 = values.probabilityCue1;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.2 = values.probabilityCue2;}]&lt;br/&gt;/ ontrialbegin = [values.GnG_timeout = textbox.timeoutGnG.response]&lt;br/&gt;/ ontrialbegin = [values.nr_testTrial += 1]&lt;br/&gt;/ ontrialbegin = [values.nr_practiceTrial = 0]&lt;br/&gt;/ ontrialbegin = [picture.Visual_Cue.hposition = 50%; picture.Visual_Cue.vposition = 20%;]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = Go_noGo; 200 = Visual_Cue, Go_noGo, skip]&lt;br/&gt;&lt;br/&gt;/ iscorrectresponse = [(values.currentcue != values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "Go_noGo") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "skip") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == 0)]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [if (values.currentCue == values.GnG_responseImage) &lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_falseAlarms += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_correctRejections += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_correctRejections += 1;}}]&lt;br/&gt;/ ontrialend = [if (values.currentCue != values.GnG_responseImage)&lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_hits += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_misses += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_misses += 1;}}]&lt;br/&gt;&lt;br/&gt;/ timeout = values.GnG_timeout*1000 + 200&lt;br/&gt;/ showmousecursor = true&lt;br/&gt;/ validresponse = (Go_noGo, skip)&lt;br/&gt;/ branch = [if (values.nr_testTrial &amp;lt; textbox.nrTrialsTest.response) trial.1_tap_V_Cue_test else trial.End] &lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a href="#" data-id="25557" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;Item probabilities have to be specified as decimals, so your approach seems like the one to pursue, i.e. convert number of trials indicated to decimals. At least I can't really think of a better one.&lt;br/&gt;&lt;a href="#" data-id="25558" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;thank you Dave for your reply. The fact is the number is never exact ... for instance, if the probability is 0.20 sometimes I got 3 out of then trials of on type... and I cannot explain that. Maybe is there something that need to be specifies in the list?&lt;br/&gt;&lt;a href="#" data-id="25559" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;The list should have a proper poolsize specified or set, i.e. poolsize should be set equal to the total amount of trials. Otherwise something's off with your calculations.&lt;br/&gt;&lt;a href="#" data-id="25560" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;This is how it should be already, shouldn't it?&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.poolsize = textbox.nrTrialsTest.response;}]&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25561"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&amp;lt;textbox nrTrialsTest&amp;gt;&lt;br/&gt;/ caption = "&lt;br/&gt;NR TEST TRIALS - The number of trials in the Test is:"&lt;br/&gt;/ required = true&lt;br/&gt;/ position = (10%, 85%)&lt;br/&gt;/ mask = integer&lt;br/&gt;&amp;lt;/textbox&amp;gt;&lt;br/&gt;&lt;br/&gt;(Sorry for the multiple post, but I could not paste into the forum).&lt;br/&gt;When I set up itemprobabilities (0.20, 0.80) on 10 trials, I would expect 2 items of one type and 8 of the other type. What I can see in one or more occasion are 3 items of one type and 7 of the other type...&lt;br/&gt;</description><pubDate>Wed, 19 Sep 2018 01:38:07 GMT</pubDate><dc:creator>tecnika</dc:creator></item><item><title>RE: enable experimenter to decide the number of trials per type in a block</title><link>https://forums.millisecond.com/Topic25561.aspx</link><description>&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]Dave - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]tecnika - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]Dave - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]tecnika - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a title="Move Cursor Below"&gt;+&lt;/a&gt;&lt;a title="Delete Quote"&gt;x&lt;/a&gt;[quote]&lt;div&gt;&lt;div&gt;&lt;a title=" "&gt;&lt;/a&gt;&lt;/div&gt;[b]tecnika - Tuesday, September 18, 2018[/b]&lt;/div&gt;&lt;div&gt;&lt;div&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;In a block with two different type of trials I would like to "enable" the experimenter to choose how many trials per type to run.&lt;br/&gt;The trials will need to be randomised in the block.&lt;br/&gt;&lt;br/&gt;I have done this presenting in the instructions a textbox where the experimenter type the total number of trials and then a slide when s/he can specify the probability a certain type of trial is presented.&lt;br/&gt;&lt;br/&gt;It works fine-ish with a list and setting the pool as the total number of trials and the item probabilities as a slider in the instructions that the experimenter can select.&lt;br/&gt;&lt;br/&gt;However, rather than using the decimal value as itemprobabilities I would like to use the exact number of trials per type, so I can make sure that the exact number of trials is presented per type.&lt;br/&gt;&lt;br/&gt;As one option I was thinking to allow the experimenter to exact the number of trials per type (as integer) and then transforming it in decimal points (that similar to what I am doing) but I was wondering if there was another options.&lt;br/&gt;&lt;br/&gt;Thanks&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a href="#" data-id="25556" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;&amp;lt;trial TestInstructions&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.probabilityCue1 = 0]&lt;br/&gt;/ ontrialbegin = [values.probabilityCue2 = 0]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = TestInstructions, Buttons]&lt;br/&gt;/ validresponse = (Buttons)&lt;br/&gt;/ recorddata = false&lt;br/&gt;/ branch = [trial.ITI]&lt;br/&gt;/ ontrialend = [values.pCue1 = textbox.probabilitiesCueGnG.response/textbox.nrTrialsTest.response]&lt;br/&gt;/ ontrialend = [values.pCue2 = format("%.2f", 1.00-values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue1 = format("%.2f", values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue2 = values.pCue2]&lt;br/&gt;/ ontrialend = [values.expBlock = "Test"]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list Cue_random&amp;gt;&lt;br/&gt;/ items = (1, 2)&lt;br/&gt;/ poolsize = 2&lt;br/&gt;/ replace = false&lt;br/&gt;/ selectionmode = random&lt;br/&gt;/ itemprobabilities = [values.probabilityCue1; values.probabilityCue2]&lt;br/&gt;&lt;br/&gt;and here's one example of trial&lt;br/&gt;&lt;br/&gt;&amp;lt;trial 1_tap_V_Cue_Test&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.selectedResp  = 0;]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "Go_noGo") values.selectedResp  = radiobuttons.ResponseStimulusGnG.response]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "skip") values.selectedResp  = "skip"]&lt;br/&gt; &lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {values.currentCue=list.Cue_random.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "predetermined") {values.currentCue=list.Cue_sequence.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.poolsize = textbox.nrTrialsTest.response;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.1 = values.probabilityCue1;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.2 = values.probabilityCue2;}]&lt;br/&gt;/ ontrialbegin = [values.GnG_timeout = textbox.timeoutGnG.response]&lt;br/&gt;/ ontrialbegin = [values.nr_testTrial += 1]&lt;br/&gt;/ ontrialbegin = [values.nr_practiceTrial = 0]&lt;br/&gt;/ ontrialbegin = [picture.Visual_Cue.hposition = 50%; picture.Visual_Cue.vposition = 20%;]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = Go_noGo; 200 = Visual_Cue, Go_noGo, skip]&lt;br/&gt;&lt;br/&gt;/ iscorrectresponse = [(values.currentcue != values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "Go_noGo") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "skip") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == 0)]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [if (values.currentCue == values.GnG_responseImage) &lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_falseAlarms += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_correctRejections += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_correctRejections += 1;}}]&lt;br/&gt;/ ontrialend = [if (values.currentCue != values.GnG_responseImage)&lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_hits += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_misses += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_misses += 1;}}]&lt;br/&gt;&lt;br/&gt;/ timeout = values.GnG_timeout*1000 + 200&lt;br/&gt;/ showmousecursor = true&lt;br/&gt;/ validresponse = (Go_noGo, skip)&lt;br/&gt;/ branch = [if (values.nr_testTrial &amp;lt; textbox.nrTrialsTest.response) trial.1_tap_V_Cue_test else trial.End] &lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a href="#" data-id="25557" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;Item probabilities have to be specified as decimals, so your approach seems like the one to pursue, i.e. convert number of trials indicated to decimals. At least I can't really think of a better one.&lt;br/&gt;&lt;a href="#" data-id="25558" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;thank you Dave for your reply. The fact is the number is never exact ... for instance, if the probability is 0.20 sometimes I got 3 out of then trials of on type... and I cannot explain that. Maybe is there something that need to be specifies in the list?&lt;br/&gt;&lt;a href="#" data-id="25559" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;/div&gt;&lt;br/&gt;The list should have a proper poolsize specified or set, i.e. poolsize should be set equal to the total amount of trials. Otherwise something's off with your calculations.&lt;br/&gt;&lt;a href="#" data-id="25560" quote-link"=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;[/quote]&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;This is how it should be already, shouldn't it?&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.poolsize = textbox.nrTrialsTest.response;}]&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;</description><pubDate>Wed, 19 Sep 2018 01:34:48 GMT</pubDate><dc:creator>tecnika</dc:creator></item><item><title>RE: enable experimenter to decide the number of trials per type in a block</title><link>https://forums.millisecond.com/Topic25560.aspx</link><description>&lt;div data-id="25559" class="if-quote-wrapper" unselectable="on" data-guid="1537292098273"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="25559" 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="25559" 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="25559" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;tecnika - Tuesday, September 18, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25559"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div class="if-quote-wrapper" unselectable="on" data-id="25558" data-guid="1537292098273"&gt;&lt;a title="Move Cursor Below" class="quote-para" style="display: none;" href="#" unselectable="on" data-id="25558" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a title="Delete Quote" class="quote-delete" style="display: none;" href="#" unselectable="on" data-id="25558" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span class="quote-markup" unselectable="on"&gt;[quote]&lt;/span&gt;&lt;div class="if-quote-header" unselectable="on" contenteditable="false"&gt;&lt;div class="if-quote-toggle-wrapper" unselectable="on"&gt;&lt;a title=" " class="if-quote-toggle quote-link" href="#" data-id="25558"&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="quote-markup" unselectable="on"&gt;[b]&lt;/span&gt;Dave - Tuesday, September 18, 2018&lt;span class="quote-markup" unselectable="on"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25558"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div class="if-quote-wrapper" unselectable="on" data-id="25557" data-guid="1537292098273"&gt;&lt;a title="Move Cursor Below" class="quote-para" style="display: none;" href="#" unselectable="on" data-id="25557" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a title="Delete Quote" class="quote-delete" style="display: none;" href="#" unselectable="on" data-id="25557" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span class="quote-markup" unselectable="on"&gt;[quote]&lt;/span&gt;&lt;div class="if-quote-header" unselectable="on" contenteditable="false"&gt;&lt;div class="if-quote-toggle-wrapper" unselectable="on"&gt;&lt;a title=" " class="if-quote-toggle quote-link" href="#" data-id="25557"&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="quote-markup" unselectable="on"&gt;[b]&lt;/span&gt;tecnika - Tuesday, September 18, 2018&lt;span class="quote-markup" unselectable="on"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25557"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div class="if-quote-wrapper" unselectable="on" data-id="25556" data-guid="1537292098273"&gt;&lt;a title="Move Cursor Below" class="quote-para" style="display: none;" href="#" unselectable="on" data-id="25556" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a title="Delete Quote" class="quote-delete" style="display: none;" href="#" unselectable="on" data-id="25556" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span class="quote-markup" unselectable="on"&gt;[quote]&lt;/span&gt;&lt;div class="if-quote-header" unselectable="on" contenteditable="false"&gt;&lt;div class="if-quote-toggle-wrapper" unselectable="on"&gt;&lt;a title=" " class="if-quote-toggle quote-link" href="#" data-id="25556"&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="quote-markup" unselectable="on"&gt;[b]&lt;/span&gt;tecnika - Tuesday, September 18, 2018&lt;span class="quote-markup" unselectable="on"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25556"&gt;&lt;div class="if-quote-message-margin"&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;In a block with two different type of trials I would like to "enable" the experimenter to choose how many trials per type to run.&lt;br/&gt;The trials will need to be randomised in the block.&lt;br/&gt;&lt;br/&gt;I have done this presenting in the instructions a textbox where the experimenter type the total number of trials and then a slide when s/he can specify the probability a certain type of trial is presented.&lt;br/&gt;&lt;br/&gt;It works fine-ish with a list and setting the pool as the total number of trials and the item probabilities as a slider in the instructions that the experimenter can select.&lt;br/&gt;&lt;br/&gt;However, rather than using the decimal value as itemprobabilities I would like to use the exact number of trials per type, so I can make sure that the exact number of trials is presented per type.&lt;br/&gt;&lt;br/&gt;As one option I was thinking to allow the experimenter to exact the number of trials per type (as integer) and then transforming it in decimal points (that similar to what I am doing) but I was wondering if there was another options.&lt;br/&gt;&lt;br/&gt;Thanks&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25556"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&amp;lt;trial TestInstructions&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.probabilityCue1 = 0]&lt;br/&gt;/ ontrialbegin = [values.probabilityCue2 = 0]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = TestInstructions, Buttons]&lt;br/&gt;/ validresponse = (Buttons)&lt;br/&gt;/ recorddata = false&lt;br/&gt;/ branch = [trial.ITI]&lt;br/&gt;/ ontrialend = [values.pCue1 = textbox.probabilitiesCueGnG.response/textbox.nrTrialsTest.response]&lt;br/&gt;/ ontrialend = [values.pCue2 = format("%.2f", 1.00-values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue1 = format("%.2f", values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue2 = values.pCue2]&lt;br/&gt;/ ontrialend = [values.expBlock = "Test"]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list Cue_random&amp;gt;&lt;br/&gt;/ items = (1, 2)&lt;br/&gt;/ poolsize = 2&lt;br/&gt;/ replace = false&lt;br/&gt;/ selectionmode = random&lt;br/&gt;/ itemprobabilities = [values.probabilityCue1; values.probabilityCue2]&lt;br/&gt;&lt;br/&gt;and here's one example of trial&lt;br/&gt;&lt;br/&gt;&amp;lt;trial 1_tap_V_Cue_Test&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.selectedResp  = 0;]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "Go_noGo") values.selectedResp  = radiobuttons.ResponseStimulusGnG.response]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "skip") values.selectedResp  = "skip"]&lt;br/&gt; &lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {values.currentCue=list.Cue_random.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "predetermined") {values.currentCue=list.Cue_sequence.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.poolsize = textbox.nrTrialsTest.response;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.1 = values.probabilityCue1;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.2 = values.probabilityCue2;}]&lt;br/&gt;/ ontrialbegin = [values.GnG_timeout = textbox.timeoutGnG.response]&lt;br/&gt;/ ontrialbegin = [values.nr_testTrial += 1]&lt;br/&gt;/ ontrialbegin = [values.nr_practiceTrial = 0]&lt;br/&gt;/ ontrialbegin = [picture.Visual_Cue.hposition = 50%; picture.Visual_Cue.vposition = 20%;]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = Go_noGo; 200 = Visual_Cue, Go_noGo, skip]&lt;br/&gt;&lt;br/&gt;/ iscorrectresponse = [(values.currentcue != values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "Go_noGo") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "skip") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == 0)]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [if (values.currentCue == values.GnG_responseImage) &lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_falseAlarms += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_correctRejections += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_correctRejections += 1;}}]&lt;br/&gt;/ ontrialend = [if (values.currentCue != values.GnG_responseImage)&lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_hits += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_misses += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_misses += 1;}}]&lt;br/&gt;&lt;br/&gt;/ timeout = values.GnG_timeout*1000 + 200&lt;br/&gt;/ showmousecursor = true&lt;br/&gt;/ validresponse = (Go_noGo, skip)&lt;br/&gt;/ branch = [if (values.nr_testTrial &amp;lt; textbox.nrTrialsTest.response) trial.1_tap_V_Cue_test else trial.End] &lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25557"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Item probabilities have to be specified as decimals, so your approach seems like the one to pursue, i.e. convert number of trials indicated to decimals. At least I can't really think of a better one.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25558"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;thank you Dave for your reply. The fact is the number is never exact ... for instance, if the probability is 0.20 sometimes I got 3 out of then trials of on type... and I cannot explain that. Maybe is there something that need to be specifies in the list?&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25559"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;The list should have a proper poolsize specified or set, i.e. poolsize should be set equal to the total amount of trials. Otherwise something's off with your calculations.&lt;br/&gt;</description><pubDate>Tue, 18 Sep 2018 10:36:56 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: enable experimenter to decide the number of trials per type in a block</title><link>https://forums.millisecond.com/Topic25559.aspx</link><description>&lt;div class="if-quote-wrapper" unselectable="on" data-id="25558" data-guid="1537290792937"&gt;&lt;a title="Move Cursor Below" class="quote-para" style="display: none;" contenteditable="false" href="#" unselectable="on" data-id="25558"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a title="Delete Quote" class="quote-delete" style="display: none;" contenteditable="false" href="#" unselectable="on" data-id="25558"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span class="quote-markup" unselectable="on"&gt;[quote]&lt;/span&gt;&lt;div class="if-quote-header" contenteditable="false" unselectable="on"&gt;&lt;div class="if-quote-toggle-wrapper" unselectable="on"&gt;&lt;a title=" " class="if-quote-toggle quote-link" href="#" data-id="25558"&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="quote-markup" unselectable="on"&gt;[b]&lt;/span&gt;Dave - Tuesday, September 18, 2018&lt;span class="quote-markup" unselectable="on"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25558"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div class="if-quote-wrapper" unselectable="on" data-id="25557" data-guid="1537290792937"&gt;&lt;a title="Move Cursor Below" class="quote-para" style="display: none;" contenteditable="false" href="#" unselectable="on" data-id="25557"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a title="Delete Quote" class="quote-delete" style="display: none;" contenteditable="false" href="#" unselectable="on" data-id="25557"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span class="quote-markup" unselectable="on"&gt;[quote]&lt;/span&gt;&lt;div class="if-quote-header" contenteditable="false" unselectable="on"&gt;&lt;div class="if-quote-toggle-wrapper" unselectable="on"&gt;&lt;a title=" " class="if-quote-toggle quote-link" href="#" data-id="25557"&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="quote-markup" unselectable="on"&gt;[b]&lt;/span&gt;tecnika - Tuesday, September 18, 2018&lt;span class="quote-markup" unselectable="on"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25557"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div class="if-quote-wrapper" unselectable="on" data-id="25556" data-guid="1537290792937"&gt;&lt;a title="Move Cursor Below" class="quote-para" style="display: none;" contenteditable="false" href="#" unselectable="on" data-id="25556"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a title="Delete Quote" class="quote-delete" style="display: none;" contenteditable="false" href="#" unselectable="on" data-id="25556"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span class="quote-markup" unselectable="on"&gt;[quote]&lt;/span&gt;&lt;div class="if-quote-header" contenteditable="false" unselectable="on"&gt;&lt;div class="if-quote-toggle-wrapper" unselectable="on"&gt;&lt;a title=" " class="if-quote-toggle quote-link" href="#" data-id="25556"&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="quote-markup" unselectable="on"&gt;[b]&lt;/span&gt;tecnika - Tuesday, September 18, 2018&lt;span class="quote-markup" unselectable="on"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25556"&gt;&lt;div class="if-quote-message-margin"&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;In a block with two different type of trials I would like to "enable" the experimenter to choose how many trials per type to run.&lt;br/&gt;The trials will need to be randomised in the block.&lt;br/&gt;&lt;br/&gt;I have done this presenting in the instructions a textbox where the experimenter type the total number of trials and then a slide when s/he can specify the probability a certain type of trial is presented.&lt;br/&gt;&lt;br/&gt;It works fine-ish with a list and setting the pool as the total number of trials and the item probabilities as a slider in the instructions that the experimenter can select.&lt;br/&gt;&lt;br/&gt;However, rather than using the decimal value as itemprobabilities I would like to use the exact number of trials per type, so I can make sure that the exact number of trials is presented per type.&lt;br/&gt;&lt;br/&gt;As one option I was thinking to allow the experimenter to exact the number of trials per type (as integer) and then transforming it in decimal points (that similar to what I am doing) but I was wondering if there was another options.&lt;br/&gt;&lt;br/&gt;Thanks&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25556"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&amp;lt;trial TestInstructions&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.probabilityCue1 = 0]&lt;br/&gt;/ ontrialbegin = [values.probabilityCue2 = 0]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = TestInstructions, Buttons]&lt;br/&gt;/ validresponse = (Buttons)&lt;br/&gt;/ recorddata = false&lt;br/&gt;/ branch = [trial.ITI]&lt;br/&gt;/ ontrialend = [values.pCue1 = textbox.probabilitiesCueGnG.response/textbox.nrTrialsTest.response]&lt;br/&gt;/ ontrialend = [values.pCue2 = format("%.2f", 1.00-values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue1 = format("%.2f", values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue2 = values.pCue2]&lt;br/&gt;/ ontrialend = [values.expBlock = "Test"]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list Cue_random&amp;gt;&lt;br/&gt;/ items = (1, 2)&lt;br/&gt;/ poolsize = 2&lt;br/&gt;/ replace = false&lt;br/&gt;/ selectionmode = random&lt;br/&gt;/ itemprobabilities = [values.probabilityCue1; values.probabilityCue2]&lt;br/&gt;&lt;br/&gt;and here's one example of trial&lt;br/&gt;&lt;br/&gt;&amp;lt;trial 1_tap_V_Cue_Test&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.selectedResp  = 0;]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "Go_noGo") values.selectedResp  = radiobuttons.ResponseStimulusGnG.response]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "skip") values.selectedResp  = "skip"]&lt;br/&gt; &lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {values.currentCue=list.Cue_random.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "predetermined") {values.currentCue=list.Cue_sequence.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.poolsize = textbox.nrTrialsTest.response;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.1 = values.probabilityCue1;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.2 = values.probabilityCue2;}]&lt;br/&gt;/ ontrialbegin = [values.GnG_timeout = textbox.timeoutGnG.response]&lt;br/&gt;/ ontrialbegin = [values.nr_testTrial += 1]&lt;br/&gt;/ ontrialbegin = [values.nr_practiceTrial = 0]&lt;br/&gt;/ ontrialbegin = [picture.Visual_Cue.hposition = 50%; picture.Visual_Cue.vposition = 20%;]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = Go_noGo; 200 = Visual_Cue, Go_noGo, skip]&lt;br/&gt;&lt;br/&gt;/ iscorrectresponse = [(values.currentcue != values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "Go_noGo") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "skip") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == 0)]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [if (values.currentCue == values.GnG_responseImage) &lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_falseAlarms += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_correctRejections += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_correctRejections += 1;}}]&lt;br/&gt;/ ontrialend = [if (values.currentCue != values.GnG_responseImage)&lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_hits += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_misses += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_misses += 1;}}]&lt;br/&gt;&lt;br/&gt;/ timeout = values.GnG_timeout*1000 + 200&lt;br/&gt;/ showmousecursor = true&lt;br/&gt;/ validresponse = (Go_noGo, skip)&lt;br/&gt;/ branch = [if (values.nr_testTrial &amp;lt; textbox.nrTrialsTest.response) trial.1_tap_V_Cue_test else trial.End] &lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25557"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Item probabilities have to be specified as decimals, so your approach seems like the one to pursue, i.e. convert number of trials indicated to decimals. At least I can't really think of a better one.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25558"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;thank you Dave for your reply. The fact is the number is never exact ... for instance, if the probability is 0.20 sometimes I got 3 out of then trials of on type... and I cannot explain that. Maybe is there something that need to be specifies in the list?&lt;br/&gt;</description><pubDate>Tue, 18 Sep 2018 10:14:30 GMT</pubDate><dc:creator>tecnika</dc:creator></item><item><title>RE: enable experimenter to decide the number of trials per type in a block</title><link>https://forums.millisecond.com/Topic25558.aspx</link><description>&lt;div data-id="25557" class="if-quote-wrapper" unselectable="on" data-guid="1537290560442"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="25557" 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="25557" 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="25557" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;tecnika - Tuesday, September 18, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25557"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="25556" class="if-quote-wrapper" unselectable="on" data-guid="1537290560442"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="25556" 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="25556" 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="25556" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;tecnika - Tuesday, September 18, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25556"&gt;&lt;div class="if-quote-message-margin"&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;In a block with two different type of trials I would like to "enable" the experimenter to choose how many trials per type to run.&lt;br/&gt;The trials will need to be randomised in the block.&lt;br/&gt;&lt;br/&gt;I have done this presenting in the instructions a textbox where the experimenter type the total number of trials and then a slide when s/he can specify the probability a certain type of trial is presented.&lt;br/&gt;&lt;br/&gt;It works fine-ish with a list and setting the pool as the total number of trials and the item probabilities as a slider in the instructions that the experimenter can select.&lt;br/&gt;&lt;br/&gt;However, rather than using the decimal value as itemprobabilities I would like to use the exact number of trials per type, so I can make sure that the exact number of trials is presented per type.&lt;br/&gt;&lt;br/&gt;As one option I was thinking to allow the experimenter to exact the number of trials per type (as integer) and then transforming it in decimal points (that similar to what I am doing) but I was wondering if there was another options.&lt;br/&gt;&lt;br/&gt;Thanks&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25556"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&amp;lt;trial TestInstructions&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.probabilityCue1 = 0]&lt;br/&gt;/ ontrialbegin = [values.probabilityCue2 = 0]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = TestInstructions, Buttons]&lt;br/&gt;/ validresponse = (Buttons)&lt;br/&gt;/ recorddata = false&lt;br/&gt;/ branch = [trial.ITI]&lt;br/&gt;/ ontrialend = [values.pCue1 = textbox.probabilitiesCueGnG.response/textbox.nrTrialsTest.response]&lt;br/&gt;/ ontrialend = [values.pCue2 = format("%.2f", 1.00-values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue1 = format("%.2f", values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue2 = values.pCue2]&lt;br/&gt;/ ontrialend = [values.expBlock = "Test"]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list Cue_random&amp;gt;&lt;br/&gt;/ items = (1, 2)&lt;br/&gt;/ poolsize = 2&lt;br/&gt;/ replace = false&lt;br/&gt;/ selectionmode = random&lt;br/&gt;/ itemprobabilities = [values.probabilityCue1; values.probabilityCue2]&lt;br/&gt;&lt;br/&gt;and here's one example of trial&lt;br/&gt;&lt;br/&gt;&amp;lt;trial 1_tap_V_Cue_Test&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.selectedResp  = 0;]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "Go_noGo") values.selectedResp  = radiobuttons.ResponseStimulusGnG.response]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "skip") values.selectedResp  = "skip"]&lt;br/&gt; &lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {values.currentCue=list.Cue_random.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "predetermined") {values.currentCue=list.Cue_sequence.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.poolsize = textbox.nrTrialsTest.response;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.1 = values.probabilityCue1;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.2 = values.probabilityCue2;}]&lt;br/&gt;/ ontrialbegin = [values.GnG_timeout = textbox.timeoutGnG.response]&lt;br/&gt;/ ontrialbegin = [values.nr_testTrial += 1]&lt;br/&gt;/ ontrialbegin = [values.nr_practiceTrial = 0]&lt;br/&gt;/ ontrialbegin = [picture.Visual_Cue.hposition = 50%; picture.Visual_Cue.vposition = 20%;]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = Go_noGo; 200 = Visual_Cue, Go_noGo, skip]&lt;br/&gt;&lt;br/&gt;/ iscorrectresponse = [(values.currentcue != values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "Go_noGo") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "skip") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == 0)]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [if (values.currentCue == values.GnG_responseImage) &lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_falseAlarms += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_correctRejections += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_correctRejections += 1;}}]&lt;br/&gt;/ ontrialend = [if (values.currentCue != values.GnG_responseImage)&lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_hits += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_misses += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_misses += 1;}}]&lt;br/&gt;&lt;br/&gt;/ timeout = values.GnG_timeout*1000 + 200&lt;br/&gt;/ showmousecursor = true&lt;br/&gt;/ validresponse = (Go_noGo, skip)&lt;br/&gt;/ branch = [if (values.nr_testTrial &amp;lt; textbox.nrTrialsTest.response) trial.1_tap_V_Cue_test else trial.End] &lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25557"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Item probabilities have to be specified as decimals, so your approach seems like the one to pursue, i.e. convert number of trials indicated to decimals. At least I can't really think of a better one.&lt;br/&gt;</description><pubDate>Tue, 18 Sep 2018 10:11:14 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: enable experimenter to decide the number of trials per type in a block</title><link>https://forums.millisecond.com/Topic25557.aspx</link><description>&lt;div data-id="25556" class="if-quote-wrapper" unselectable="on" data-guid="1537287796825"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="25556" 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="25556" 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="25556" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;tecnika - Tuesday, September 18, 2018&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-25556"&gt;&lt;div class="if-quote-message-margin"&gt;Hi Dave,&lt;br/&gt;&lt;br/&gt;In a block with two different type of trials I would like to "enable" the experimenter to choose how many trials per type to run.&lt;br/&gt;The trials will need to be randomised in the block.&lt;br/&gt;&lt;br/&gt;I have done this presenting in the instructions a textbox where the experimenter type the total number of trials and then a slide when s/he can specify the probability a certain type of trial is presented.&lt;br/&gt;&lt;br/&gt;It works fine-ish with a list and setting the pool as the total number of trials and the item probabilities as a slider in the instructions that the experimenter can select.&lt;br/&gt;&lt;br/&gt;However, rather than using the decimal value as itemprobabilities I would like to use the exact number of trials per type, so I can make sure that the exact number of trials is presented per type.&lt;br/&gt;&lt;br/&gt;As one option I was thinking to allow the experimenter to exact the number of trials per type (as integer) and then transforming it in decimal points (that similar to what I am doing) but I was wondering if there was another options.&lt;br/&gt;&lt;br/&gt;Thanks&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="25556"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&amp;lt;trial TestInstructions&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.probabilityCue1 = 0]&lt;br/&gt;/ ontrialbegin = [values.probabilityCue2 = 0]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = TestInstructions, Buttons]&lt;br/&gt;/ validresponse = (Buttons)&lt;br/&gt;/ recorddata = false&lt;br/&gt;/ branch = [trial.ITI]&lt;br/&gt;/ ontrialend = [values.pCue1 = textbox.probabilitiesCueGnG.response/textbox.nrTrialsTest.response]&lt;br/&gt;/ ontrialend = [values.pCue2 = format("%.2f", 1.00-values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue1 = format("%.2f", values.pCue1)]&lt;br/&gt;/ ontrialend = [values.probabilityCue2 = values.pCue2]&lt;br/&gt;/ ontrialend = [values.expBlock = "Test"]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list Cue_random&amp;gt;&lt;br/&gt;/ items = (1, 2)&lt;br/&gt;/ poolsize = 2&lt;br/&gt;/ replace = false&lt;br/&gt;/ selectionmode = random&lt;br/&gt;/ itemprobabilities = [values.probabilityCue1; values.probabilityCue2]&lt;br/&gt;&lt;br/&gt;and here's one example of trial&lt;br/&gt;&lt;br/&gt;&amp;lt;trial 1_tap_V_Cue_Test&amp;gt;&lt;br/&gt;/ ontrialbegin = [values.selectedResp  = 0;]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "Go_noGo") values.selectedResp  = radiobuttons.ResponseStimulusGnG.response]&lt;br/&gt;/ ontrialend = [if (trial.1_tap_V_Cue_Test.response == "skip") values.selectedResp  = "skip"]&lt;br/&gt; &lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {values.currentCue=list.Cue_random.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "predetermined") {values.currentCue=list.Cue_sequence.nextvalue; }]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.poolsize = textbox.nrTrialsTest.response;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.1 = values.probabilityCue1;}]&lt;br/&gt;/ ontrialbegin = [if (dropdown.CueOrder.response == "random") {list.Cue_random.itemprobabilities.2 = values.probabilityCue2;}]&lt;br/&gt;/ ontrialbegin = [values.GnG_timeout = textbox.timeoutGnG.response]&lt;br/&gt;/ ontrialbegin = [values.nr_testTrial += 1]&lt;br/&gt;/ ontrialbegin = [values.nr_practiceTrial = 0]&lt;br/&gt;/ ontrialbegin = [picture.Visual_Cue.hposition = 50%; picture.Visual_Cue.vposition = 20%;]&lt;br/&gt;/ inputdevice = mouse&lt;br/&gt;/ stimulustimes = [1 = Go_noGo; 200 = Visual_Cue, Go_noGo, skip]&lt;br/&gt;&lt;br/&gt;/ iscorrectresponse = [(values.currentcue != values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "Go_noGo") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == "skip") &lt;br/&gt;|| (values.currentcue == values.GnG_responseImage &amp;amp;&amp;amp; trial.1_tap_V_Cue_Test.response == 0)]&lt;br/&gt;&lt;br/&gt;/ ontrialend = [if (values.currentCue == values.GnG_responseImage) &lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_falseAlarms += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_correctRejections += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_correctRejections += 1;}}]&lt;br/&gt;/ ontrialend = [if (values.currentCue != values.GnG_responseImage)&lt;br/&gt;{if (values.selectedResp  == values.GnG_responseImage) {values.GnG_hits += 1;}&lt;br/&gt;else if (values.selectedResp  == "skip") {values.GnG_misses += 1;}&lt;br/&gt;else if (values.selectedResp  == "0") {values.GnG_misses += 1;}}]&lt;br/&gt;&lt;br/&gt;/ timeout = values.GnG_timeout*1000 + 200&lt;br/&gt;/ showmousecursor = true&lt;br/&gt;/ validresponse = (Go_noGo, skip)&lt;br/&gt;/ branch = [if (values.nr_testTrial &amp;lt; textbox.nrTrialsTest.response) trial.1_tap_V_Cue_test else trial.End] &lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Tue, 18 Sep 2018 09:24:43 GMT</pubDate><dc:creator>tecnika</dc:creator></item></channel></rss>