Releases: jspsych/jsPsych
v6.1.0
New Features
- Added an option to specify an event handler for
on_close
injsPsych.init()
. This event is triggered when the user leaves the page. It can be used to save the data and/or state of the experiment just before the window is closed and the data is lost (#324). - Added
jsPsych.getProgressBarCompleted()
, which returns the current value of the progress bar. Works for automated and manual control mode of the progress bar (#538). - Video files will now preload. Thanks @andytwoods ! (#408, #535).
- The survey-text plugin now supports a
required
parameter. (#460). - Individual data values in the
data
parameter can now be functions that are evaluated at the start of the trial (#562). - Created three new plugins for video stimulus with different response options:
video-keyboard-response
,video-button-response
, andvideo-slider-response
. Thanks @designatednerd ! (#636; #622). - The video plugins now supports setting the playback rate. Thanks @r-b-g-b ! (#590).
- Added cloze test plugin. Thanks @sprengholz ! (#555).
- A custom label can be specified for the automatic progress bar. Thanks @retowyss ! (#609).
- All survey plugins now support
randomize_question_order
parameter, which randomly reorders all questions (#305). - The various
image-
plugins now allow for setting the height and width of the image by the parametersstimulus_height
andstimulus_width
. The parametermaintain_aspect_ratio
can be used to automatically resize one dimension when specifying the other (#560). - The slider plugins now support a parameter called
require_movement
. When set to true, the continue button is disabled until the slider has been moved (#573). - The slider plugins now have a parameter called
slider_width
which can be used to set the width of the slider in pixels (#631). - Added a new plugin that supports a more versatile set of html form elements, survey-html-form. Thanks @jansim ! (#602).
- Added
jsPsych.randomization.shuffleAlternateGroups()
which allows for shuffling based on a group membership, ensuring that items from each group are spaced evenly and in a consistent group order (#528). - Added
alternate-groups
option to sampling methods for timeline variables (#528). - Added a parameter to jsPsych.init to control the width of the experiment display,
experiment_width
(#635). - The survey-likert plugin now has a parameter
scale_width
to specify the width of the likert scales in pixels (#633). - All the survey plugins now support a
name
parameter in thequestions
array. This parameter controls the name of the response in the data, replacing the default ofQ0
,Q1
, etc. (#608).
Changes
- Dropped support for
Date.now()
as a method for measuring RT. Browser support forperformance.now()
is now widespread (#492). .variance()
and.sd()
now calculate sample variance and standard deviation instead of population variance and standard deviation (#601).- In nested timeline structures,
data
properties that do not conflict between a nested node and their parent node will now both be added to the data structure. Previously, only the nested node's data was added, even if the data properties were not in conflict (#391). - Added more informative error messages for some functions in the randomization module (#389).
- The
value
parameter for the survey-text plugin has been replaced withplaceholder
and the text is now used as a proper placeholder attribute (#627). - The survey-multi-select plugin
required
parameter is now specified at the question level to be consistent with other survey plugins. Proper HTML5 form validation is used to display the error message (#629). - The jspsych-RDK plugin was renamed to jspsych-rdk to be consistent with other plugins. Thanks @vrsivananda ! (#630; #575).
- Various documentation improvements and updates (#607, #524).
Bug Fixes
- Div IDs were incorrectly generated in the survey-text plugin (#576).
- The survey-text plugin was reloading the page on form submission in Safari and Edge. Thanks @nabsul ! (#610; #613).
- The survey-text plugin has proper auto focus on the first input element (#580).
- Full screen event data is now properly recorded in recent versions of Firefox (#597).
- The loading progress bar should no longer be larger than expected (#603).
- Default values were not properly used when the plugin had a nested parameter (e.g., the
questions
parameter in the varioussurvey-*
plugins). Defaults are now used as expected (#628). - The default_iti parameter in jsPsych.init() is working as intended (#632).
v6.0.5
New Features
- The
call-function
plugin can now wait for asynchronous functions to execute a callback before continuing to the next trial. (#552). - The
RDK
plugin now accepts character codes for selecting keys (#564). Thanks @vrsivananda ! - The content element will automatically scroll to the top on a new trial, which fixes some issues where long surveys were stuck at the bottom of the page on a new trial.
- Default key behavior (like space causing the page to scroll) is now prevented when the key is expected as input for a plugin that uses
getKeyboardResponse
to capture input.
Bug Fixes
- The Open Sans font now correctly imports in the stylesheet. Thanks @guydav !
- In some cases the backwards button in the
instructions
plugin would not work properly. Thanks for reporting, @kushinm ! (#553) - In some cases, image preloading would fail because values of
null
,0
, orfalse
would be added to the list of images to load. (#557). - A bug in the
external-html
plugin caused a keyboard event handler to persist when it should have been cleared. Thanks @tbrotherm ! - Two minor bugs were resolved in the
RDK
plugin (#565). Thanks @vrsivananda ! - The
-slider-response
plugins had the wrong parameter type for thelabels
parameter, causing issues in the GUI. (#571). - Automatically putting the focus on the jsPsych content div was failing due to targeting the wrong element. (#563).
v6.0.4
New features
- Added plugin for Random Dot Kinematograms by @vrsivananda. Thanks for this major contribution!
- Added the ability to display page numbers in the instructions plugin. Thanks @mjaquiery!
- External scripts can now be optionally executed in the external-html plugin. Thanks @onkeltom!
Documentation updates
- The PHP script example in the documentation for saving files to a server is fixed for recent versions of PHP. Thanks @akochari!
- localSave() for data collections works in recent versions of Safari. Thanks @spencerking!
- Audio examples are updated to reflect the Chrome 66+ restrictions on playing audio. Thanks @mpezzo!
Bug fixes
- The free-sort plugin now properly records the final locations of the images.
- The instructions plugin handles custom key assignments when allow_backwards is false. Thanks @pfeyz!
- In some older browsers, the display element would lose focus when a button was clicked. By default, the display element is automatically focused at the start of every trial. Thanks @akochari!
v6.0.3
This update mainly addresses the Chrome 66+ audio autoplay issue. Briefly: Chrome 66+ no longer allows audio to autoplay until after the user has taken one action on the page. jsPsych creates the audio context when jspsych.js is loaded, and this is usually before the user takes an action. This updates modifies the way that jsPsych uses the audio context so that it is automatically unblocked after the first action that the user takes.
This update also modifies the survey-text plugin so that the first text field is auto focused.
v6.0.2
This release patches a few bugs in 6.0.1 and adds two small features.
New features
- If preloading content fails, jsPsych will retry each failed file up to a specified number of times. The default behavior is 10 attempts. This can be overriden by setting
max_preload_attempts
injsPsych.init()
- Use of the WebAudio API is now optional. It can be disabled by setting
use_webaudio
injsPsych.init()
tofalse
. HTML5 Audio is now automatically used as a backup when WebAudio is not available.
Bug fixes
- The survey-text plugin now works when
rows
and/orcolumns
is unspecified. Thanks @VorontsovIE ! - jsPsych would attempt to create a new AudioContext on every jsPsych.init() call. This is now corrected and jsPsych uses a single AudioContext even if there are multiple inits on the same page.
- The
start
andstop
options for jspsych-video now work in Microsoft Edge. - The vertical scrollbar only appears if the experiment is too tall to fit in the window.
- Various errors in the documentation and tutorials were corrected. Thanks @hans and @yulkang !
v6.0.1
v6.0
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
v5.0.3
v5.0.2
- Fixes a critical bug with pre-loading audio files. If more than one audio file was required, the pre-loading would fail. This is now fixed.
- The parameter
randomize_order
for timelines was being incorrectly applied to timelines that were nested under the randomized timeline. This is now fixed;randomize_order
will only apply to the timeline that it is set on.