﻿<?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  » repeat trial after error</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Thu, 02 Jul 2026 21:00:34 GMT</lastBuildDate><ttl>20</ttl><item><title>repeat trial after error</title><link>https://forums.millisecond.com/Topic20404.aspx</link><description>Hi-- This seems like a simple one but I can't find an existing forum thread on this issue. &amp;nbsp;I want to repeat a trial after an error. &amp;nbsp; Here is the relevant part of my code. Any help is much appreciated! &amp;nbsp;~Lauren&lt;br/&gt;&lt;br/&gt;&amp;lt;item familiarizationPics&amp;gt;&lt;br/&gt;/1 = "images/ATflwr1.jpg"&lt;br/&gt;/2 = "images/ATfish1.jpg"&lt;br/&gt;/3 = "images/ATbird4.jpg"&lt;br/&gt;/4 = "images/ATdogg2.jpg"&lt;br/&gt;/5 = "images/ATflwr1.jpg"&lt;br/&gt;...&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&amp;lt;picture familiarization&amp;gt;&lt;br/&gt;/ items = familiarizationPics&lt;br/&gt;/ select = sequence&lt;br/&gt;/ size = (400, 400)&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial famTrial&amp;gt;  &lt;br/&gt;/ stimulustimes = [0=familiarization; 300=blank]&lt;br/&gt;/ validresponse = (noresponse,"1","2")&lt;br/&gt;/ iscorrectresponse = [trial.famTrial.response == list.famAnswers.nextvalue]&lt;br/&gt;/ beginresponsetime = 0&lt;br/&gt;/ trialduration = 1000&lt;br/&gt;/ responseinterrupt = trial&lt;br/&gt;/ errormessage = (wrong,500)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block famBlock&amp;gt;&lt;br/&gt;/ preinstructions = (intro,famInstruct)&lt;br/&gt;/ trials = [1 = famInstructionsWithPic; 2-449 = famTrial]&lt;br/&gt;/ errormessage = false&lt;br/&gt;/ blockfeedback = (correct)&lt;br/&gt;/ ontrialend = [if (block.famBlock.errorstreak == 11 ) script.abort();]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Fri, 30 Dec 2016 08:13:58 GMT</pubDate><dc:creator>laurenemberson</dc:creator></item><item><title>RE: repeat trial after error</title><link>https://forums.millisecond.com/Topic20408.aspx</link><description>Thanks so much Dave this helped a lot!!!&amp;nbsp;</description><pubDate>Fri, 30 Dec 2016 08:13:58 GMT</pubDate><dc:creator>laurenemberson</dc:creator></item><item><title>RE: repeat trial after error</title><link>https://forums.millisecond.com/Topic20406.aspx</link><description>&lt;div data-id="20404" class="if-quote-wrapper" unselectable="on" data-guid="1483059865444"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="20404" 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="20404" 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="20404" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;laurenemberson - Thursday, December 29, 2016&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-20404"&gt;&lt;div class="if-quote-message-margin"&gt;Hi-- This seems like a simple one but I can't find an existing forum thread on this issue. &amp;nbsp;I want to repeat a trial after an error. &amp;nbsp; Here is the relevant part of my code. Any help is much appreciated! &amp;nbsp;~Lauren&lt;br/&gt;&lt;br/&gt;&amp;lt;item familiarizationPics&amp;gt;&lt;br/&gt;/1 = "images/ATflwr1.jpg"&lt;br/&gt;/2 = "images/ATfish1.jpg"&lt;br/&gt;/3 = "images/ATbird4.jpg"&lt;br/&gt;/4 = "images/ATdogg2.jpg"&lt;br/&gt;/5 = "images/ATflwr1.jpg"&lt;br/&gt;...&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&amp;lt;picture familiarization&amp;gt;&lt;br/&gt;/ items = familiarizationPics&lt;br/&gt;/ select = sequence&lt;br/&gt;/ size = (400, 400)&lt;br/&gt;/ erase = false&lt;br/&gt;&amp;lt;/picture&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial famTrial&amp;gt;  &lt;br/&gt;/ stimulustimes = [0=familiarization; 300=blank]&lt;br/&gt;/ validresponse = (noresponse,"1","2")&lt;br/&gt;/ iscorrectresponse = [trial.famTrial.response == list.famAnswers.nextvalue]&lt;br/&gt;/ beginresponsetime = 0&lt;br/&gt;/ trialduration = 1000&lt;br/&gt;/ responseinterrupt = trial&lt;br/&gt;/ errormessage = (wrong,500)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block famBlock&amp;gt;&lt;br/&gt;/ preinstructions = (intro,famInstruct)&lt;br/&gt;/ trials = [1 = famInstructionsWithPic; 2-449 = famTrial]&lt;br/&gt;/ errormessage = false&lt;br/&gt;/ blockfeedback = (correct)&lt;br/&gt;/ ontrialend = [if (block.famBlock.errorstreak == 11 ) script.abort();]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="20404"&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;Strictly speaking, there is no way to repeat a *trial*. Instead you need to frame the problem in terms of item selection, i.e. in any given trial, only select a new item if&amp;nbsp; the previous trial was answered correctly. Example:&lt;br/&gt;&lt;br/&gt;&amp;lt;values&amp;gt;&lt;br/&gt;/ itemnumber = 1&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block myblock&amp;gt;&lt;br/&gt;/ trials = [1-5 = 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 = [if (trial.mytrial.correct) values.itemnumber += 1]&lt;br/&gt;/ stimulusframes = [1=mytext]&lt;br/&gt;/ validresponse = ("1","2")&lt;br/&gt;/ correctresponse = ("1") &lt;br/&gt;/ branch = [if (trial.mytrial.error) trial.mytrial]&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text mytext&amp;gt;&lt;br/&gt;/ items = myitems&lt;br/&gt;/ select = values.itemnumber&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;item myitems&amp;gt;&lt;br/&gt;/ 1 = "A"&lt;br/&gt;/ 2 = "B"&lt;br/&gt;/ 1 = "C"&lt;br/&gt;/ 2 = "D"&lt;br/&gt;/ 1 = "E"&lt;br/&gt;&amp;lt;/item&amp;gt;&lt;br/&gt;&lt;br/&gt;Hope this helps.&lt;br/&gt;</description><pubDate>Thu, 29 Dec 2016 17:15:13 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>