﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 6  » coding for correct answers with key press</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Wed, 16 Sep 2026 14:36:33 GMT</lastBuildDate><ttl>20</ttl><item><title>coding for correct answers with key press</title><link>https://forums.millisecond.com/Topic35142.aspx</link><description>Hello,&amp;nbsp;&lt;br/&gt;&lt;br/&gt;I'm looking for help on how to code for /iscorrectresponse.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;In my study I prefer for participants to respond using a keyboard press which corresponds to the location of the stimulus. e.g, "1" for left and "2" for right.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;However, I want to randomise the presentation of the stimulus location of which I'm doing using a counter. Is there a way to code for if the position is 40% then the correct response == &amp;nbsp;"1" keypress but if position is 60% then correct response == "2" keypress&lt;br/&gt;&lt;br/&gt;thank you&amp;nbsp;</description><pubDate>Mon, 23 Jan 2023 18:13:42 GMT</pubDate><dc:creator>raynae</dc:creator></item><item><title>RE: coding for correct answers with key press</title><link>https://forums.millisecond.com/Topic35146.aspx</link><description>Thank you!</description><pubDate>Mon, 23 Jan 2023 18:13:42 GMT</pubDate><dc:creator>raynae</dc:creator></item><item><title>RE: coding for correct answers with key press</title><link>https://forums.millisecond.com/Topic35143.aspx</link><description>&lt;blockquote data-id="35142" class="if-quote-wrapper" unselectable="on" data-guid="1674493604536" id="if_insertedNode_1674493603685" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="35142" 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="35142" 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="35142" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;raynae - 1/23/2023&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-35142"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hello,&amp;nbsp;&lt;br/&gt;&lt;br/&gt;I'm looking for help on how to code for /iscorrectresponse.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;In my study I prefer for participants to respond using a keyboard press which corresponds to the location of the stimulus. e.g, "1" for left and "2" for right.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;However, I want to randomise the presentation of the stimulus location of which I'm doing using a counter. Is there a way to code for if the position is 40% then the correct response == &amp;nbsp;"1" keypress but if position is 60% then correct response == "2" keypress&lt;br/&gt;&lt;br/&gt;thank you&amp;nbsp;&lt;a class="if-quote-goto quote-link" href="#" data-id="35142"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Sure.&lt;br/&gt;&lt;br/&gt;[code]&amp;lt;values&amp;gt;&lt;br/&gt;/ x = 0%&lt;br/&gt;/ cresp = " "&lt;br/&gt;&amp;lt;/values&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;list xpos&amp;gt;&lt;br/&gt;/ items = (40%, 60%)&lt;br/&gt;/ poolsize = 4&lt;br/&gt;&amp;lt;/list&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text stimulus&amp;gt;&lt;br/&gt;/ items = ("A", "B", "C", "D")&lt;br/&gt;/ hposition = values.x&lt;br/&gt;&amp;lt;/text&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;&amp;nbsp;values.x = list.xpos.nextvalue;&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (values.x == 40%) {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.cresp = "1";&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;values.cresp = "2";&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;]&lt;br/&gt;/ stimulusframes = [1=stimulus]&lt;br/&gt;/ validresponse = ("1", "2")&lt;br/&gt;/ correctresponse = (values.cresp)&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;block myblock&amp;gt;&lt;br/&gt;/ trials = [1-4 = mytrial]&lt;br/&gt;&amp;lt;/block&amp;gt;&lt;br/&gt;&lt;br/&gt;[/code]</description><pubDate>Mon, 23 Jan 2023 17:11:33 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>