﻿<?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  » Adding error messages to trials in Approach/Avoidance script</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Sun, 05 Apr 2026 23:41:24 GMT</lastBuildDate><ttl>20</ttl><item><title>Adding error messages to trials in Approach/Avoidance script</title><link>https://forums.millisecond.com/Topic27731.aspx</link><description>Hello,&lt;br/&gt;&lt;br/&gt;I am working on adding in errors into the experimental trials of the AAT script, in addition to the error messages that participants already see during the practice trials, as exist in the template. I&amp;nbsp;have added the following to the trials but it does not appear to be sufficient as I do not see error messages, my guess was that I need to add something additional to the "zoom" decrease and increase instructions, but I have not been able to figure out the content exactly?&lt;br/&gt;&lt;br/&gt;/ errormessage = true(error,0)&lt;br/&gt;&lt;br/&gt;Thank you for any assistance!&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Wed, 11 Sep 2019 09:05:22 GMT</pubDate><dc:creator>inquisituser22</dc:creator></item><item><title>RE: Adding error messages to trials in Approach/Avoidance script</title><link>https://forums.millisecond.com/Topic27741.aspx</link><description>Thank you!</description><pubDate>Wed, 11 Sep 2019 09:05:22 GMT</pubDate><dc:creator>inquisituser22</dc:creator></item><item><title>RE: Adding error messages to trials in Approach/Avoidance script</title><link>https://forums.millisecond.com/Topic27735.aspx</link><description>&lt;div data-id="27734" class="if-quote-wrapper" unselectable="on" data-guid="1568137252347"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="27734" 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="27734" 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="27734" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;inquisituser22 - 9/10/2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-27734"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="27733" class="if-quote-wrapper" unselectable="on" data-guid="1568137252347"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="27733" 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="27733" 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="27733" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 9/9/2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-27733"&gt;&lt;div class="if-quote-message-margin"&gt;I've attached an AAT script with error messages in the test trials, so you can take a look at that. I don't understand your second question.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="27733"&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 very much! This was helpful. I'll rephrase my second question - I would like participants to correct their errors by moving the joystick in the correct direction once told it is an error. I am able to do this no problem because I have added "/response = correct" which requires participants to correct their prior erroneous response. However, when I try to test out my script in monkeymode, it gets stuck on the screen saying "error" and does not correct the response, and will not finish running the script. I am not sure how to code a new response for monkeymode. Thank you!&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;/ errormessage = true(error,0)&lt;br/&gt;/ response = correct&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="27734"&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 only thing you can do is force the monkey to always respond correctly per /monkeyresponse:&lt;br/&gt;&lt;br/&gt;&amp;lt;trial practicetrial_A&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;values.targetformat = "l";&lt;br/&gt;values.selectpracticepicture = 1;&lt;br/&gt;values.starttime = script.elapsedtime;&lt;br/&gt;values.endtime = 0;&lt;br/&gt;picture.practicetarget.height = values.startheight_A;&lt;br/&gt;values.completeRT = 0;&lt;br/&gt;values.changedirection = 0;&lt;br/&gt;values.finalresponse="";&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1 = practicetarget]&lt;br/&gt;/ validresponse = (back, forward)&lt;br/&gt;/ iscorrectresponse = [(values.expcondition == 1 &amp;amp;&amp;amp; trial.practicetrial_A.response == "forward") ||&lt;br/&gt;(values.expcondition == 2 &amp;amp;&amp;amp; trial.practicetrial_A.response == "back")]&lt;br/&gt;/ errormessage = true(error,0)&lt;br/&gt;&lt;strong&gt;/ response = correct&lt;br/&gt;/ monkeyresponse = [&lt;br/&gt;if (values.expcondition == 1) "forward" else "back"&lt;br/&gt;]&lt;/strong&gt;&lt;br/&gt;/ ontrialend = [&lt;br/&gt;values.joystick_y = joystick.y;&lt;br/&gt;values.joystick_change = abs(values.joystick_y);&lt;br/&gt;values.trialcode = "practicetrial_A";&lt;br/&gt;values.RT = trial.practicetrial_A.latency;&lt;br/&gt;values.correct = trial.practicetrial_A.correct;&lt;br/&gt;values.stimulus = picture.practicetarget.currentitem;&lt;br/&gt;if (trial.practicetrial_A.response == "forward")&lt;br/&gt;values.initialresponse = "PUSH"&lt;br/&gt;else&lt;br/&gt;values.initialresponse = "PULL";&lt;br/&gt;]&lt;br/&gt;/ branch = [&lt;br/&gt;if (trial.practicetrial_A.response == "forward")&lt;br/&gt;trial.practicedecrease&lt;br/&gt;else&lt;br/&gt;trial.practiceincrease;&lt;br/&gt;]&lt;br/&gt;/ recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;NOTE: &lt;br/&gt;trial.practicetrial_B displays the stimulus of format B (here: portrait) by setting&lt;br/&gt;values.selectpracticepicture = 2&lt;br/&gt;*if a forward movement (=push) is detected -&amp;gt; decrease picture&lt;br/&gt;*if a back movement (=pull) is detected -&amp;gt; increase picture&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;trial practicetrial_B&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;values.targetformat = "p";&lt;br/&gt;values.starttime = script.elapsedtime;&lt;br/&gt;values.endtime = 0;&lt;br/&gt;values.repeat = 0;&lt;br/&gt;values.selectpracticepicture = 2;&lt;br/&gt;picture.practicetarget.height = values.startheight_B;&lt;br/&gt;values.completeRT = 0;&lt;br/&gt;values.changedirection = 0;&lt;br/&gt;values.finalresponse="";&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1 = practicetarget]&lt;br/&gt;/ validresponse = (back, forward)&lt;br/&gt;/ iscorrectresponse = [(values.expcondition == 1 &amp;amp;&amp;amp; trial.practicetrial_B.response == "back") ||&lt;br/&gt;(values.expcondition == 2 &amp;amp;&amp;amp; trial.practicetrial_B.response == "forward")]&lt;br/&gt;/ errormessage = true(error,0)&lt;br/&gt;&lt;strong&gt;/ response = correct&lt;br/&gt;/ monkeyresponse = [&lt;br/&gt;if (values.expcondition == 1) "back" else "forward"&lt;br/&gt;]&lt;/strong&gt;&lt;br/&gt;/ ontrialend = [&lt;br/&gt;values.joystick_y = joystick.y;&lt;br/&gt;values.joystick_change = abs(values.joystick_y);&lt;br/&gt;values.trialcode = "practicetrial_B";&lt;br/&gt;values.RT = trial.practicetrial_B.latency;&lt;br/&gt;values.correct = trial.practicetrial_B.correct;&lt;br/&gt;values.stimulus = picture.practicetarget.currentitem;&lt;br/&gt;if (trial.practicetrial_B.response == "forward")&lt;br/&gt;values.initialresponse = "PUSH"&lt;br/&gt;else&lt;br/&gt;values.initialresponse = "PULL";&lt;br/&gt;]&lt;br/&gt;/ branch = [&lt;br/&gt;if (trial.practicetrial_B.response == "forward")&lt;br/&gt;trial.practicedecrease&lt;br/&gt;else&lt;br/&gt;trial.practiceincrease;&lt;br/&gt;]&lt;br/&gt;/ recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;*********ZOOM FEATURE: trial  increase/decrease the size of the rectangles depending on participant's response*********&lt;br/&gt;&lt;br/&gt;&amp;lt;trial practicedecrease&amp;gt;&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;if (values.expcondition == 1 &amp;amp;&amp;amp; values.targetformat == "p"){&lt;br/&gt;trial.practicedecrease.insertstimulustime(text.error, 0);&lt;br/&gt;}else if (values.expcondition == 2 &amp;amp;&amp;amp; values.targetformat == "l"){&lt;br/&gt;trial.practicedecrease.insertstimulustime(text.error, 0);&lt;br/&gt;};&lt;br/&gt;picture.practicetarget.height = picture.practicetarget.height - values.joystick_change/1000 * expressions.maxheightchange_px;&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1 = clearscreen, practicetarget]&lt;br/&gt;/ validresponse = (change)&lt;br/&gt;/ monkeyresponse = ("back", "forward")&lt;br/&gt;/ ontrialend = [&lt;br/&gt;values.joystick_change = abs(values.joystick_y - joystick.y);&lt;br/&gt;trial.practicedecrease.resetstimulusframes();&lt;br/&gt;]&lt;br/&gt;/ branch = [&lt;br/&gt;if (monkey.monkeymode == 1) {&lt;br/&gt;values.endtime = script.elapsedtime;&lt;br/&gt;values.finalresponse = "PUSH";&lt;br/&gt;trial.intertrialinterval;&lt;br/&gt;} else if (joystick.y &amp;lt;= -1000) {&lt;br/&gt;values.joystick_y = joystick.y;&lt;br/&gt;values.endtime = script.elapsedtime;&lt;br/&gt;values.finalresponse = "PUSH";&lt;br/&gt;trial.enddecrease_practice;&lt;br/&gt;} else if (joystick.y &amp;lt;= values.joystick_y) {&lt;br/&gt;values.joystick_y = joystick.y;&lt;br/&gt;trial.practicedecrease;&lt;br/&gt;} else if (joystick.y &amp;gt; values.joystick_y) {&lt;br/&gt;values.joystick_y = joystick.y;&lt;br/&gt;values.changedirection += 1;&lt;br/&gt;trial.practiceincrease;&lt;br/&gt;};&lt;br/&gt;]&lt;br/&gt;/ recorddata = false&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;</description><pubDate>Tue, 10 Sep 2019 10:41:38 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Adding error messages to trials in Approach/Avoidance script</title><link>https://forums.millisecond.com/Topic27734.aspx</link><description>&lt;div data-id="27733" class="if-quote-wrapper" unselectable="on" data-guid="1568136221285"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="27733" 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="27733" 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="27733" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 9/9/2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-27733"&gt;&lt;div class="if-quote-message-margin"&gt;I've attached an AAT script with error messages in the test trials, so you can take a look at that. I don't understand your second question.&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="27733"&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 very much! This was helpful. I'll rephrase my second question - I would like participants to correct their errors by moving the joystick in the correct direction once told it is an error. I am able to do this no problem because I have added "/response = correct" which requires participants to correct their prior erroneous response. However, when I try to test out my script in monkeymode, it gets stuck on the screen saying "error" and does not correct the response, and will not finish running the script. I am not sure how to code a new response for monkeymode. Thank you!&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;/ errormessage = true(error,0)&lt;br/&gt;/ response = correct&lt;br/&gt;</description><pubDate>Tue, 10 Sep 2019 10:25:29 GMT</pubDate><dc:creator>inquisituser22</dc:creator></item><item><title>RE: Adding error messages to trials in Approach/Avoidance script</title><link>https://forums.millisecond.com/Topic27733.aspx</link><description>I've attached an AAT script with error messages in the test trials, so you can take a look at that. I don't understand your second question.&lt;br/&gt;</description><pubDate>Mon, 09 Sep 2019 13:38:50 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Adding error messages to trials in Approach/Avoidance script</title><link>https://forums.millisecond.com/Topic27732.aspx</link><description>&lt;div class="if-quote-wrapper" unselectable="on" data-id="27731" data-guid="1568059915753"&gt;&lt;a title="Move Cursor Below" class="quote-para" style="display: none;" contenteditable="false" href="#" unselectable="on" data-id="27731"&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="27731"&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="27731"&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="quote-markup" unselectable="on"&gt;[b]&lt;/span&gt;inquisituser22 - 9/9/2019&lt;span class="quote-markup" unselectable="on"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-27731"&gt;&lt;div class="if-quote-message-margin"&gt;Hello,&lt;br/&gt;&lt;br/&gt;I am working on adding in errors into the experimental trials of the AAT script, in addition to the error messages that participants already see during the practice trials, as exist in the template. I&amp;nbsp;have added the following to the trials but it does not appear to be sufficient as I do not see error messages, my guess was that I need to add something additional to the "zoom" decrease and increase instructions, but I have not been able to figure out the content exactly?&lt;br/&gt;&lt;br/&gt;/ errormessage = true(error,0)&lt;br/&gt;&lt;br/&gt;Thank you for any assistance!&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="27731"&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;One other question I have is that during practice trials, I have added "response = correct" so that participants have to correctly pull or push the joystick to advance. However, I am now not able to run monkeymode when an error is encountered - the screen stays as is with "ERROR" on screen and does not advance. Thank you!&lt;br/&gt;&lt;br/&gt;</description><pubDate>Mon, 09 Sep 2019 13:13:15 GMT</pubDate><dc:creator>inquisituser22</dc:creator></item></channel></rss>