Skip to content
Discussion options

You must be logged in to vote

Hi @Max-Lovell! You can find an example of a canvas stimulus function with multiple arguments in the "jspsych-canvas-button-response.html" file in the /examples folder. The trick is to use a function for the stimulus parameter that just takes the canvas argument, but then inside that function, you can call a different function that takes multiple arguments.

var circle_1 = {
  type: 'canvas-button-response',
  stimulus: function(c) {
    filledCirc(c, 100, 'blue');
  }
}

The additional arguments used by the filledCirc function above could be calculated before this function is called. So to apply that to your task - inside the main stimulus function, you could add some code to check the par…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Max-Lovell
Comment options

Answer selected by becky-gilbert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants