Skip to content

Commit

Permalink
Modify register_click() in plugin-corsi-blocks implementing the possi…
Browse files Browse the repository at this point in the history
…bility to register the wrong sequence without ending the trial
  • Loading branch information
Pavel6625 committed Oct 7, 2024
1 parent 1758263 commit 474c110
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/plugin-corsi-blocks/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,14 @@ class CorsiBlocksPlugin implements JsPsychPlugin<Info> {
display_element
.querySelector(`.jspsych-corsi-block[data-id="${id}"]`)
.animate(correct_animation, animation_timing);
if (trial_data.response.length == trial.sequence.length) {
trial_data.correct = true;
setTimeout(end_trial, trial.response_animation_duration); // allows animation to finish
}
} else {
display_element
.querySelector(`.jspsych-corsi-block[data-id="${id}"]`)
.animate(incorrect_animation, animation_timing);
trial_data.correct = false;
}
// Only end the trial when the response length matches the sequence length
if (trial_data.response.length == trial.sequence.length) {
trial_data.correct = correct;
setTimeout(end_trial, trial.response_animation_duration); // allows animation to finish
}
};
Expand Down

0 comments on commit 474c110

Please sign in to comment.