import { initJsPsych } from "jspsych"; import "jspsych/css/jspsych.css"; import "./styles.css"; import { delayed_redirect } from "./utils/helpers.js"; import jsPsychHtmlKeyboardResponse from "@jspsych/plugin-html-keyboard-response"; import { textStimuli } from './scripts/text_stimuli'; const debug = import.meta.env.VITE_DEBUG; const jsPsych = initJsPsych({ on_finish: function() { jsPsych.getDisplayElement().innerHTML = textStimuli.complete; }, on_close: function() { delayed_redirect(import.meta.env.VITE_CLOSED_URL); }, on_data_update: function() { if (debug) { console.log(jsPsych.data.get().json()); } }, }); const demo_trial = { type: jsPsychHtmlKeyboardResponse, stimulus: `