Skip to content
Discussion options

You must be logged in to vote

Hi @rbruno1! To score each response as correct or incorrect, you can add an on_finish parameter to the trial that compares the correct response (which you've already stored in the trial data) with the participant's response (which is added to the trial data when the trial is finished). It would look like this:

const Tur_AV_trial_10 = {
  // other parameters...
  on_finish: function(data) {
    data.correct = jsPsych.pluginAPI.compareKeys(data.response, data.correct_response);
  }
}

This code will add a correct property to the data for each trial. Its value will be true if the response matches the correct response, and false if not.

You can take a look at the Manipulating Data section of t…

Replies: 1 comment 3 replies

Comment options

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

@becky-gilbert
Comment options

@rbruno1
Comment options

Answer selected by rbruno1
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