Skip to content

How to record multiple responses for a stimulus via "image-keyboard-response." #1302

Answered by becky-gilbert
K104Kaz asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @K104Kaz, yes I think you'll want to modify the plugin file to do this:

  • In the jsPsych.pluginAPI.getKeyboardResponse function, change persist from false to true (false means that the keyboard listener should be cancelled after the first response).
var keyboardListener = jsPsych.pluginAPI.getKeyboardResponse({
  callback_function: after_response,
  valid_responses: trial.choices,
  rt_method: 'performance',
  persist: true,   // <- changed from false to true
  allow_held_key: false
});
  • Change the responses object so that it stores arrays of rts and keys, instead of just one value for each:
// store response
var response = {
  rt: [], // <- changed from null to empty arrays, so that …

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@K104Kaz
Comment options

@rMinion
Comment options

@becky-gilbert
Comment options

Answer selected by becky-gilbert
Comment options

You must be logged in to vote
1 reply
@jodeleeuw
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants