From 474c1101568546ced4fee5c46d3885930e2a89ad Mon Sep 17 00:00:00 2001 From: alexvrlab <27216559+Pavel6625@users.noreply.github.com> Date: Mon, 7 Oct 2024 16:43:12 +0300 Subject: [PATCH 1/3] Modify register_click() in plugin-corsi-blocks implementing the possibility to register the wrong sequence without ending the trial --- packages/plugin-corsi-blocks/src/index.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/plugin-corsi-blocks/src/index.ts b/packages/plugin-corsi-blocks/src/index.ts index 63b2867a..27eda94d 100644 --- a/packages/plugin-corsi-blocks/src/index.ts +++ b/packages/plugin-corsi-blocks/src/index.ts @@ -294,15 +294,14 @@ class CorsiBlocksPlugin implements JsPsychPlugin { 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 } }; From 98e3f2cdb47cb36ff2fe51bff9078de40430affd Mon Sep 17 00:00:00 2001 From: Pavel Shlepnev <27216559+Pavel6625@users.noreply.github.com> Date: Tue, 8 Oct 2024 16:34:46 +0300 Subject: [PATCH 2/3] Create mighty-shrimps-knock.md A changeset for version bump for plugin-corsi-blocks --- .changeset/mighty-shrimps-knock.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .changeset/mighty-shrimps-knock.md diff --git a/.changeset/mighty-shrimps-knock.md b/.changeset/mighty-shrimps-knock.md new file mode 100644 index 00000000..5fc3b45f --- /dev/null +++ b/.changeset/mighty-shrimps-knock.md @@ -0,0 +1,10 @@ +--- +"@jspsych-contrib/extension-countdown": patch +"@jspsych-contrib/extension-device-motion": patch +"@jspsych-contrib/extension-mediapipe-face-mesh": patch +"@jspsych-contrib/extension-touchscreen-buttons": patch +"@jspsych-contrib/plugin-corsi-blocks": minor +--- + +Plugin corsi blocks issue 141 +In this updated version, the trial only ends when the response length matches the sequence length, regardless of whether the clicks were correct or not. This allows the user to register an incorrect sequence without ending the trial immediately. From a0d39dac124a75fe014b11e7f98babd56580fe3e Mon Sep 17 00:00:00 2001 From: Pavel6625 <27216559+Pavel6625@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:42:51 +0300 Subject: [PATCH 3/3] Make trial_data.correct dependent on the sameness of trial sequence and response in plugin-corsi-blocks --- packages/plugin-corsi-blocks/examples/example.html | 4 ++-- packages/plugin-corsi-blocks/src/index.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/plugin-corsi-blocks/examples/example.html b/packages/plugin-corsi-blocks/examples/example.html index 8fe0bc58..ea276f0f 100644 --- a/packages/plugin-corsi-blocks/examples/example.html +++ b/packages/plugin-corsi-blocks/examples/example.html @@ -29,13 +29,13 @@ timeline.push({ type: jsPsychCorsiBlocks, - sequence: [3,1], + sequence: [3,1,2], mode: 'display' }); timeline.push({ type: jsPsychCorsiBlocks, - sequence: [3,1], + sequence: [3,1,2], mode: 'input' }); diff --git a/packages/plugin-corsi-blocks/src/index.ts b/packages/plugin-corsi-blocks/src/index.ts index 27eda94d..7283c6ec 100644 --- a/packages/plugin-corsi-blocks/src/index.ts +++ b/packages/plugin-corsi-blocks/src/index.ts @@ -301,7 +301,7 @@ class CorsiBlocksPlugin implements JsPsychPlugin { } // Only end the trial when the response length matches the sequence length if (trial_data.response.length == trial.sequence.length) { - trial_data.correct = correct; + trial_data.correct = JSON.stringify(trial_data.response) === JSON.stringify(trial.sequence); setTimeout(end_trial, trial.response_animation_duration); // allows animation to finish } };