This is a significant update to the library. If you are a veteran jspsych user, you will need to reacquaint yourself with some of the new syntax, which is conceptually similar but simplified for the ease of new users. Old experiments from v4.x will not work with v5.0.
Major changes
- Completely overhauled the system for constructing trials, blocks, and chunks. All trials are now declared through a common system: the timeline. The timeline can contain nested timelines, replicating the features of blocks and chunks, while simplifying the syntax and improving the flexibility. Conditional and looping timelines are much easier to build. For more information, read the docs page on the new timeline.
- Greatly simplified plugin files. There is no longer a need to define a .create method in the plugin file. Parameters are passed directly from the timeline into the .trial method.
- New button-response plugin for showing a stimulus and getting a response via a button press. Buttons are highly customizable.
- Automatic preloading. Most image and audio files will now automatically preload at the start of the experiment.
- New survey-multi-choice plugin for answering multiple choice questions.
- Option to run the experiment in fullscreen mode.
Minor changes
- Greater flexibility in options for multi-stim-multi-response plugin.
- Mouse responses are valid for single-stim plugin.
- Improved CSS styling of buttons in general.
- Audio playback works in Safari.
- New function to generate a random subject ID.
- Option to display a message when using endExperiment to terminate the experiment early.
- New function to recover URL string variables.
- Plugin files now live in the jsPsych.plugins namespace to provide better organization.
- New .dataAsJSON method.
- Option to override the DOM target for jsPsych at the trial level.
- Fixed many small bugs throughout the library.