github jspsych/jsPsych v6.0

latest releases: @jspsych/plugin-survey@1.0.0, @jspsych/plugin-visual-search-circle@1.2.1, @jspsych/plugin-visual-search-circle@1.2.0...
6 years ago

This is a major update to jsPsych that reflects more than 100 changes to the library. Given the scope of the update, this document focuses only on high-level changes to the library. Note that many of the changes to the library break backwards compatibility with any prior jsPsych version.

New features

  • Timeline Variables are a powerful new tool for writing efficient code. They allow you to define parameters on a timeline that are replaced by variables. The variables can be grouped so that a value for one parameter is always paired with a value for another parameter. There are many new features built on top of the timeline variables system, including methods for randomly sampling sets of variables.

  • The data module has been entirely overhauled to provide an API for interacting with jsPsych data. This makes it easier to aggregate and analyze data during the experiment, allowing the experiment to be responsive to the data that is generated.

  • User interactions are now automatically recorded by jsPsych, allowing experimenters to know when subjects clicked away from an experiment or exited full screen mode.

  • Subjects can now be excluded if their browser does not meet certain technical requirements. Currently this features supports checking for minimum screen size and audio support.

  • Many new plugins, including plugins for the implicit association test, a plugin that can calibrate the size of the subject's display, and a plugin for the serial reaction time task. Many plugins have also been renamed to improve clarity.

  • A progress bar will now display while experiment resources are preloaded.

  • Automatic vertical and horizontal centering of jsPsych content by default.

  • New event handlers for when trials start and when trials have finished loading.

Technical changes

This update also features a large number of technical changes to the jsPsych library. These changes are designed to improve the compatibility of jsPsych with other web frameworks and support our ongoing development efforts towards a graphical experiment builder for jsPsych.

  • The jQuery dependency has been removed. All jsPsych code uses standard JavaScript with no dependencies. This change means that plugins now need to make changes to a standard HTMLElement to adjust the display, rather than a jQuery collection.

  • Plugins now require an .info property, which specifies the parameters of the plugin and what their default values and types are. We use this information to automate some of the tasks that plugins used to have to complete, such as evaluating function parameters and replacing default values. We mostly use the parameter type information as part of the graphical experiment builder engine, but we do check if the type is a function within jsPsych to handle cases where parameters should not be evaluated before the trial runs.

  • A testing suite has been written using Jest to facilitate community development on the project as it grows in scope. The suite has partial coverage right now, and remains an active area of work.

Other changes

Many other smaller changes can be discovered on our updated documentation site at www.jspsych.org

Don't miss a new jsPsych release

NewReleases is sending notifications on new releases.