Results File: Record Button Presses

Now that you have the RT for the button press, let’s also get which button was pressed. To 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 add a new row to the UPDATE_ATTRIBUTE node. Do not drag down a new one, just extend the one you have
  • You will need to select the column in the RESULTS_FILE to also include the new variable

After you have had a go, the answers are below.

To Output the Button Press

Begin by creating a new variable. Call it BUTTON_PRESS and set the default to something nonsensical like ‘x’ (so it’s easier to spot if there is an error), as below.

Next, add a new row to UPDATE_ATTRIBUTE to update BUTTON_PRESS from the default value to the actual button that was pressed on the keyboard, as shown below. Remember that Attribute is the variable you want to update (in this case, BUTTON_PRESS), and Value is what you want to update BUTTON_PRESS to – in this case, you want to update it to the actual key that was pressed.

Finally, you need to add your new variable to the RESULTS_FILE. Select the RESULTS_FILE as you did before and add the new variable to the Columns in the Properties panel, shown below.

Note that you don’t need to add a new ADD_TO_RESULTS_FILE action since the existing one will cover everything.

And that’s it! You can now Build and then Test Run the experiment. The stimulus will remain on the screen until the TIMER expires or until a pre-defined KEYBOARD button is pressed. The experiment will then end and you can go to the experiment folder and then open up the “results” folder to see your output RESULTS_FILE which is now a text document and can be opened in Excel. An example is shown below.

resultsfile