jsPsych: Enabling an Open-Source Collaborative Ecosystem of Behavioral Experiments
Authors/Creators
Description
Major Changes
#2858
b8001735Thanks @bjoluc! - Rewrite jsPsych's core logic. The following breaking changes have been made:Timeline Events
conditional_functionis no longer executed on every iteration of a looping timeline, but only once before running the first trial of the timeline. If you rely on the old behavior, move yourconditional_functioninto a nested timeline instead.on_timeline_startandon_timeline_finishare no longer invoked in every repetition of a timeline, but only at the beginning or at the end of the timeline, respectively. If you rely on the old behavior, move theon_timeline_startandon_timeline_finishcallbacks into a nested timeline.
Timeline Variables
- The functionality of
jsPsych.timelineVariable()has been explicitly split into two functions,jsPsych.timelineVariable()andjsPsych.evaluateTimelineVariable(). UsejsPsych.timelineVariable()to create a timeline variable placeholder andjsPsych.evaluateTimelineVariable()to retrieve a given timeline variable's current value. jsPsych.evaluateTimelineVariable()now throws an error if a variable is not found.jsPsych.getAllTimelineVariables()has been replaced by a trial-levelsave_timeline_variablesparameter that can be used to include all or some timeline variables in a trial's result data.
Parameter Handling
- JsPsych will now throw an error when a non-array value is used for a trial parameter marked as
array: truein the plugin's info object. - Parameter functions and timeline variables are no longer automatically evaluated recursively throughout the whole trial object, but only for the parameters that a plugin specifies in its
infoobject. Parameter functions and timeline variables in nested objects are only evaluated if the nested object's parameters are explicitly specified using thenestedproperty in the parameter description.
Progress Bar
jsPsych.setProgressBar(x)has been replaced byjsPsych.progressBar.progress = xjsPsych.getProgressBarCompleted()has been replaced byjsPsych.progressBar.progress- The automatic progress bar updates after every trial now, including trials in nested timelines.
Data Handling
- Timeline nodes no longer have IDs. As a consequence, the
internal_node_idtrial result property andjsPsych.data.getDataByTimelineNode()have been removed. - Unlike previously, the
save_trial_parametersparameter can only be used to remove parameters that are specified in the plugin's info object. Other result properties will be left untouched.
Miscellaneous Changes
jsPsych.endExperiment()andjsPsych.endCurrentTimeline()have been renamed tojsPsych.abortExperiment()andjsPsych.abortCurrentTimeline(), respectively.- JsPsych now internally relies on the JavaScript event loop. This means automated tests have to
awaitutility functions likepressKey()to process the event loop. - The
jspsychpackage no longer exportsuniversalPluginParametersand theUniversalPluginParameterstype. - Interaction listeners are now removed when the experiment ends.
#3166
ce4333ccThanks @jodeleeuw! - Removed theexclusionsoption frominitJsPsych(). The recommended replacement for this functionality is the browser-check plugin.Removed the
hardwareAPImodule from the pluginAPI. This was no longer being updated and the features were out of date.#3031
f9eb17c3Thanks @jodeleeuw! - Changed the behavior ofDataColumn.mean()to excludenullandundefinedvalues from the calculation, as suggested in #2905#3342
6717e00cThanks @Bankminer78! - Changed plugins to use AudioPlayer class; added tests using AudioPlayer mock; plugins now use AudioPlayerInterface.#3162
3f359e55Thanks @jodeleeuw! - Removedmax-width: 95%CSS rule on the.jspsych-content<div>. This rule existed to address an old IE bug with flex layouts.#3339
74b4adc7Thanks @jodeleeuw! -finishTrial()now clears the display and any timeouts set withpluginApi.setTimeout()
Minor Changes
#3168
7b1ae24fThanks @jodeleeuw! - AddedjsPsych.abortTimelineByName(). This allows for aborting a specific active timeline by itsnameproperty. Thenamecan be set in the description of the timline.#3326
c5a0dbb1Thanks @vzhang03! - Updated all plugins to implement new pluginInfo standard that contains version, data generated and new documentation style to match migration of docs to be integrated with the code and packages themselves"#3167
6f9d01b2Thanks @jodeleeuw! - Addedrecord_dataas a parameter available for any trial. Settingrecord_data: falsewill prevent data from being stored in the jsPsych data object for that trial.#3182
3855b5d8Thanks @bjoluc! - Allow trialon_finishmethods to be asynchronous, i.e. return aPromise. Prior to this, promises returned byon_finishwere not awaited before proceeding with the next trial.#3201
be7df303Thanks @Shaobin-Jiang! - Allow message_progress_bar to be a function
Patch Changes
#3338
7a4a4b83Thanks @jodeleeuw! -getKeyboardResponsenow returns thekeyin the original case (e.g., "Enter" instead of "enter") for easier matching to standard key event documentation.#3152
2852cda6Thanks @jodeleeuw! - Button plugins now support eitherdisplay: gridordisplay: flexon the container element that hold the buttons. If the layout isgrid, the number of rows and/or columns can be specified. Themargin_horizontalandmargin_verticalparameters have been removed from the button plugins. If you need control over the button CSS, you can add inline style to the button element using thebutton_htmlparameter.jspsych.css has new layout classes to support this feature.
#3242
6aea52c3Thanks @Shaobin-Jiang! - Fix typo in randomInt error message
Notes
Files
jspsych/jsPsych-jspsych@8.0.0.zip
Files
(11.8 MB)
| Name | Size | Download all |
|---|---|---|
|
md5:2ce1019feea8b1ea42db775f5e22ecc8
|
11.8 MB | Preview Download |
Additional details
Related works
- Is supplement to
- Software: https://github.com/jspsych/jsPsych/tree/jspsych@8.0.0 (URL)