{"id":69,"date":"2014-04-04T23:21:17","date_gmt":"2014-04-04T23:21:17","guid":{"rendered":"http:\/\/wiki.psychwire.co.uk\/?page_id=69"},"modified":"2023-10-17T22:23:49","modified_gmt":"2023-10-17T22:23:49","slug":"variable-button-press","status":"publish","type":"page","link":"http:\/\/wiki.psychwire.co.uk\/?page_id=69","title":{"rendered":"Results File: Record Button Presses"},"content":{"rendered":"<p>Now that you have the RT for the button press, let&#8217;s also get which button was pressed.\u00a0To do this, you need to create a new variable that adds the actual button press to the results file.<\/p>\n<p>Give it a go yourself!<\/p>\n<p>Some hints:<\/p>\n<ul>\n<li>You will need to create a new variable<\/li>\n<li>You will need to add a new row to the <em>UPDATE_ATTRIBUTE<\/em> node. Do not drag down a new one, just extend the one you have<\/li>\n<li>You will need to select the column in the <em>RESULTS_FILE<\/em> to also include the new variable<\/li>\n<\/ul>\n<p>After you have had a go, the answers are below.<\/p>\n<p>&#8212;<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>To Output the Button Press<\/strong><\/span><\/p>\n<p>Begin by creating a new variable. Call it\u00a0<em>BUTTON_PRESS <\/em>and set the default to something nonsensical like &#8216;x&#8217; (so it&#8217;s easier to spot if there is an error), as below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" alt=\"\" src=\"http:\/\/www.personal.soton.ac.uk\/hg102\/ul\/newvar.gif\" width=\"534\" height=\"417\" \/><\/p>\n<p>Next, add a new row to\u00a0<em>UPDATE_ATTRIBUTE\u00a0<\/em>to update\u00a0<em>BUTTON_PRESS\u00a0<\/em>from the default value to the actual button that was pressed on the keyboard, as shown below. Remember that\u00a0<em>Attribute<\/em> is the variable you want to update (in this case,<em> BUTTON_PRESS<\/em>), and<em> Value<\/em> is what you want to update<em> BUTTON_PRESS<\/em> to &#8211; in this case, you want to update it to the actual key that was pressed.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" alt=\"\" src=\"http:\/\/www.personal.soton.ac.uk\/hg102\/ul\/newupdateatt.gif\" width=\"1002\" height=\"591\" \/><\/p>\n<p>Finally, you need to add your new variable to the\u00a0<em>RESULTS_FILE<\/em>. Select the\u00a0<em>RESULTS_FILE\u00a0<\/em>as you did before and add the new variable to the\u00a0<em>Columns\u00a0<\/em>in the <i>Properties\u00a0<\/i>panel, shown below.<\/p>\n<p>Note that you don&#8217;t need to add a new\u00a0<em>ADD_TO_RESULTS_FILE\u00a0<\/em>action since the existing one will cover everything.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" alt=\"\" src=\"http:\/\/www.personal.soton.ac.uk\/hg102\/ul\/newaddtoresults.gif\" width=\"733\" height=\"591\" \/><\/p>\n<p>And that&#8217;s it! You can now <em>Build<\/em> and then\u00a0<em>Test Run\u00a0<\/em>the experiment. The stimulus will remain on the screen until the\u00a0<em>TIMER\u00a0<\/em>expires or until a pre-defined\u00a0<em>KEYBOARD\u00a0<\/em>button is pressed. The experiment will then end and you can go to the experiment folder and then open up the &#8220;results&#8221; folder to see your output\u00a0<em>RESULTS_FILE\u00a0<\/em>which is now a text document and can be opened in Excel. An example is shown below.<\/p>\n<p><a href=\"http:\/\/wiki.psychwire.co.uk\/wp-content\/uploads\/2014\/04\/resultsfile.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-147\" alt=\"resultsfile\" src=\"http:\/\/wiki.psychwire.co.uk\/wp-content\/uploads\/2014\/04\/resultsfile.png\" width=\"1245\" height=\"397\" srcset=\"http:\/\/wiki.psychwire.co.uk\/wp-content\/uploads\/2014\/04\/resultsfile.png 1245w, http:\/\/wiki.psychwire.co.uk\/wp-content\/uploads\/2014\/04\/resultsfile-300x95.png 300w, http:\/\/wiki.psychwire.co.uk\/wp-content\/uploads\/2014\/04\/resultsfile-1024x326.png 1024w\" sizes=\"auto, (max-width: 1245px) 100vw, 1245px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that you have the RT for the button press, let&#8217;s also get which button was pressed.\u00a0To do this, you need to create a new variable that adds the actual button press to the results file. Give it a go yourself! Some hints: You will need to create a new variable You will need to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":59,"menu_order":3,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-69","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/69","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=69"}],"version-history":[{"count":4,"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/69\/revisions"}],"predecessor-version":[{"id":335,"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/69\/revisions\/335"}],"up":[{"embeddable":true,"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/59"}],"wp:attachment":[{"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}