Repository navigation
Releases
[email protected]
Minor Changes
- #3741
c0da89493d819abe2120c8a1340b1a4048b11247Thanks @jodeleeuw! - Add thejsPsych.adaptivemodule withcreateStaircase()andcreateInterleaved()for adaptive staircase procedures (n-up/m-down rules, unequal and shrinking step sizes, bounds, stopping rules including discontinue and ceiling rules for span tasks, and interleaved tracks that use the seeded random number generator). Procedures share a commonAdaptiveProcedureinterface, so later procedures (such as QUEST) can be added and interleaved with staircases without changing the existing API.
Patch Changes
-
#3730
4a94750ace33e619f65564f0957ae3986fdca939Thanks @SohamXYZDev! - Changes totrial.datamade inon_startare now saved in the trial's data (#3727). This also changes when functions in a trial'sdataparameter are evaluated: they are now called right before the trial starts, like other dynamic parameters, soon_startsees their values. Before, they were called after the trial ended, when the data was saved. Values that depend on the response should be added inon_finish. -
#3722
f764a2b5117528d7d2b211edba48b7dd59a0e7e5Thanks @rmz-oz! -save_trial_parametersnow works with the parameters that are available in all plugins, such ascss_classesandpost_trial_gap. Before, they were ignored with a "Non-existent parameter" warning and their values were not saved to the data.Functions passed to these parameters are now called when the trial starts, before
on_start, soon_startand the plugin see their values. Before, they were called when the parameter was used; for example, a function passed topost_trial_gapwas called after the trial ended.
@jspsych/[email protected]
Minor Changes
- #3718
dfdfb5ef09cc30fa43aec6af63a157093d52430fThanks @jodeleeuw! - New extension for sending data to DataPipe. Registering it ininitJsPsychis the whole integration: it stages each trial as it finishes, so an abandoned session can be recovered, and submits the complete dataset when the experiment ends — including afterabortExperiment(), which a save trial never reaches.
@jspsych/[email protected]
Minor Changes
-
#3719
7a2bee7ce54e16eb3ab3d060767ee928cd4a6078Thanks @jodeleeuw! - Require Node 20 or later. Node 18 reached end of life in April 2025, and parts of the ecosystem have moved past it — the Firebase v12 SDK, for one, declaresnode >= 20throughout, so a package depending on it could not be installed in a repository that still claimed Node 18 support.A
minorrather than amajor: raising a runtime floor is breaking in the strict sense, but@jspsych/configis a build-time dependency of jsPsych's own packages and never reaches an experiment, so a major here would churn every package in the monorepo for an advisory field.
[email protected]
Minor Changes
-
#3708
a69d7ad7aca8a0b0d97c5893ab09a368bd9dda25Thanks @jodeleeuw! - Added a CSS style to jspsych.css that renders<kbd>elements (or any element with class "jspsych-key") as a visual keycap. Wrapping a key name in<kbd>inside a trial renders it as a keycap, e.g.Press <kbd>space</kbd> to continue. -
#3707
a9f454ee58fda69173dbaa1ecfa4aa7797920031Thanks @jodeleeuw! - Added the ability to measure how long a response key was held down. ThegetKeyboardResponse()method of the keyboard plugin API gains an optionalwait_for_key_releaseoption; when true, thecallback_functionfires at key release instead of key press, and its payload includes anrt_key_durationfield (the press-to-release duration in milliseconds) alongside the usualkeyandrt. The five*-keyboard-responseplugins (html, image, audio, video, canvas) expose a matchingwait_for_key_releasetrial parameter (default false) and record the newrt_key_durationdata field. The release is matched to the press by the physical key (KeyboardEvent.code), so changing the shift state while holding a key (which changese.key) does not prevent the release from being detected, and thekeyreported to the callback is always the value from the original keydown event. If the window loses focus while a key is held (ablurevent), the browser stops delivering the eventualkeyup; in that case the pending release is resolved withrt_key_duration: null(the hold duration cannot be measured) and the held-key state is cleared so it does not leak into the next trial.
@jspsych/[email protected]
Minor Changes
- #3707
f14e9784fd49f36ac9051c6d5cdbd7223f391a9bThanks @jodeleeuw! - ThekeyDown()andkeyUp()helpers accept an optional second argument that sets thecodeproperty (the physical key) on the dispatchedKeyboardEvent, in addition to the existingkeyargument. A newwindowBlur()helper dispatches ablurevent onwindowand flushes pending promises, for testing behavior that depends on the page losing focus.
@jspsych/[email protected]
Minor Changes
- #3707
a9f454ee58fda69173dbaa1ecfa4aa7797920031Thanks @jodeleeuw! - Added the ability to measure how long a response key was held down. ThegetKeyboardResponse()method of the keyboard plugin API gains an optionalwait_for_key_releaseoption; when true, thecallback_functionfires at key release instead of key press, and its payload includes anrt_key_durationfield (the press-to-release duration in milliseconds) alongside the usualkeyandrt. The five*-keyboard-responseplugins (html, image, audio, video, canvas) expose a matchingwait_for_key_releasetrial parameter (default false) and record the newrt_key_durationdata field. The release is matched to the press by the physical key (KeyboardEvent.code), so changing the shift state while holding a key (which changese.key) does not prevent the release from being detected, and thekeyreported to the callback is always the value from the original keydown event. If the window loses focus while a key is held (ablurevent), the browser stops delivering the eventualkeyup; in that case the pending release is resolved withrt_key_duration: null(the hold duration cannot be measured) and the held-key state is cleared so it does not leak into the next trial.
@jspsych/[email protected]
Minor Changes
- #3707
a9f454ee58fda69173dbaa1ecfa4aa7797920031Thanks @jodeleeuw! - Added the ability to measure how long a response key was held down. ThegetKeyboardResponse()method of the keyboard plugin API gains an optionalwait_for_key_releaseoption; when true, thecallback_functionfires at key release instead of key press, and its payload includes anrt_key_durationfield (the press-to-release duration in milliseconds) alongside the usualkeyandrt. The five*-keyboard-responseplugins (html, image, audio, video, canvas) expose a matchingwait_for_key_releasetrial parameter (default false) and record the newrt_key_durationdata field. The release is matched to the press by the physical key (KeyboardEvent.code), so changing the shift state while holding a key (which changese.key) does not prevent the release from being detected, and thekeyreported to the callback is always the value from the original keydown event. If the window loses focus while a key is held (ablurevent), the browser stops delivering the eventualkeyup; in that case the pending release is resolved withrt_key_duration: null(the hold duration cannot be measured) and the held-key state is cleared so it does not leak into the next trial.
@jspsych/[email protected]
Minor Changes
- #3707
a9f454ee58fda69173dbaa1ecfa4aa7797920031Thanks @jodeleeuw! - Added the ability to measure how long a response key was held down. ThegetKeyboardResponse()method of the keyboard plugin API gains an optionalwait_for_key_releaseoption; when true, thecallback_functionfires at key release instead of key press, and its payload includes anrt_key_durationfield (the press-to-release duration in milliseconds) alongside the usualkeyandrt. The five*-keyboard-responseplugins (html, image, audio, video, canvas) expose a matchingwait_for_key_releasetrial parameter (default false) and record the newrt_key_durationdata field. The release is matched to the press by the physical key (KeyboardEvent.code), so changing the shift state while holding a key (which changese.key) does not prevent the release from being detected, and thekeyreported to the callback is always the value from the original keydown event. If the window loses focus while a key is held (ablurevent), the browser stops delivering the eventualkeyup; in that case the pending release is resolved withrt_key_duration: null(the hold duration cannot be measured) and the held-key state is cleared so it does not leak into the next trial.
@jspsych/[email protected]
Minor Changes
- #3707
a9f454ee58fda69173dbaa1ecfa4aa7797920031Thanks @jodeleeuw! - Added the ability to measure how long a response key was held down. ThegetKeyboardResponse()method of the keyboard plugin API gains an optionalwait_for_key_releaseoption; when true, thecallback_functionfires at key release instead of key press, and its payload includes anrt_key_durationfield (the press-to-release duration in milliseconds) alongside the usualkeyandrt. The five*-keyboard-responseplugins (html, image, audio, video, canvas) expose a matchingwait_for_key_releasetrial parameter (default false) and record the newrt_key_durationdata field. The release is matched to the press by the physical key (KeyboardEvent.code), so changing the shift state while holding a key (which changese.key) does not prevent the release from being detected, and thekeyreported to the callback is always the value from the original keydown event. If the window loses focus while a key is held (ablurevent), the browser stops delivering the eventualkeyup; in that case the pending release is resolved withrt_key_duration: null(the hold duration cannot be measured) and the held-key state is cleared so it does not leak into the next trial.
@jspsych/[email protected]
Minor Changes
- #3707
a9f454ee58fda69173dbaa1ecfa4aa7797920031Thanks @jodeleeuw! - Added the ability to measure how long a response key was held down. ThegetKeyboardResponse()method of the keyboard plugin API gains an optionalwait_for_key_releaseoption; when true, thecallback_functionfires at key release instead of key press, and its payload includes anrt_key_durationfield (the press-to-release duration in milliseconds) alongside the usualkeyandrt. The five*-keyboard-responseplugins (html, image, audio, video, canvas) expose a matchingwait_for_key_releasetrial parameter (default false) and record the newrt_key_durationdata field. The release is matched to the press by the physical key (KeyboardEvent.code), so changing the shift state while holding a key (which changese.key) does not prevent the release from being detected, and thekeyreported to the callback is always the value from the original keydown event. If the window loses focus while a key is held (ablurevent), the browser stops delivering the eventualkeyup; in that case the pending release is resolved withrt_key_duration: null(the hold duration cannot be measured) and the held-key state is cleared so it does not leak into the next trial.