From 6bbd47a1fab8aac6333d1cb2bf636b6271f0568b Mon Sep 17 00:00:00 2001 From: YUUU23 Date: Thu, 11 Jul 2024 21:55:28 -0500 Subject: [PATCH 1/2] refactor: holdUpMarker as basic trial to line up photodiode spot and move countDown trial to after preLoad trial --- src/experiment/honeycomb.js | 2 +- src/experiment/trials/holdUpMarker.js | 33 ++++++--------------------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/src/experiment/honeycomb.js b/src/experiment/honeycomb.js index 28a6bfaf3..dc8c15ff9 100644 --- a/src/experiment/honeycomb.js +++ b/src/experiment/honeycomb.js @@ -53,8 +53,8 @@ export function buildHoneycombTimeline(jsPsych) { const timeline = [ startProcedure, - countdownTrial, preloadTrial, + countdownTrial, instructionsTrial, honeycombProcedure, debriefTrial, diff --git a/src/experiment/trials/holdUpMarker.js b/src/experiment/trials/holdUpMarker.js index 0f384fc9f..83e0bdaa6 100644 --- a/src/experiment/trials/holdUpMarker.js +++ b/src/experiment/trials/holdUpMarker.js @@ -1,32 +1,13 @@ import htmlButtonResponse from "@jspsych/plugin-html-button-response"; +import { LANGUAGE } from "../../config/main"; +import { h1 } from "../../lib/markup/tags"; +import { photodiodeGhostBox } from "../../lib/markup/photodiode"; -import { config, LANGUAGE } from "../../config/main"; -import { eventCodes } from "../../config/trigger"; -import { pdSpotEncode, photodiodeGhostBox } from "../../lib/markup/photodiode"; -import { div, h1, p } from "../../lib/markup/tags"; - -// TODO @brown-ccv #330: Custom extension for EEG - this is initializeTriggerBox -// TODO @brown-ccv #330: Need to ping the serial part - this isn't doing anything yet -// TODO @brown-ccv: Prevent user from pressing continue until pdSpotEncode finishes (need to use jsPsych.pluginAPI.setTimeout) export const holdUpMarkerTrial = { type: htmlButtonResponse, - stimulus: function () { - const eventMarkerMarkup = h1(LANGUAGE.trials.eventMarker.connected, { - style: "color: green;", - }); - return div(eventMarkerMarkup); - }, - prompt: function () { - let holdUpMarkerPrompt = p(LANGUAGE.trials.holdUpMarker); - - // Conditionally add the photodiodeGhostBox - if (config.USE_PHOTODIODE) holdUpMarkerPrompt += photodiodeGhostBox; - - return holdUpMarkerPrompt; - }, + stimulus: + h1(LANGUAGE.trials.eventMarker.connected, { style: "color: green;" }) + + h1(LANGUAGE.trials.holdUpMarker) + + photodiodeGhostBox, choices: [LANGUAGE.prompts.continue.button], - on_load: function () { - // Conditionally flash the photodiode when the trial first loads - if (config.USE_PHOTODIODE) pdSpotEncode(eventCodes.test_connect); - }, }; From 1a5c73335615f55055ea600287cacf2d5dd26fba Mon Sep 17 00:00:00 2001 From: Megan <113795130+YUUU23@users.noreply.github.com> Date: Sun, 14 Jul 2024 16:41:07 -0500 Subject: [PATCH 2/2] remove event marker Co-authored-by: Robert Gemma <38439940+RobertGemmaJr@users.noreply.github.com> --- src/experiment/trials/holdUpMarker.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/experiment/trials/holdUpMarker.js b/src/experiment/trials/holdUpMarker.js index 83e0bdaa6..6b8029bba 100644 --- a/src/experiment/trials/holdUpMarker.js +++ b/src/experiment/trials/holdUpMarker.js @@ -6,7 +6,6 @@ import { photodiodeGhostBox } from "../../lib/markup/photodiode"; export const holdUpMarkerTrial = { type: htmlButtonResponse, stimulus: - h1(LANGUAGE.trials.eventMarker.connected, { style: "color: green;" }) + h1(LANGUAGE.trials.holdUpMarker) + photodiodeGhostBox, choices: [LANGUAGE.prompts.continue.button],