25 KiB
jspsych
8.2.1
Patch Changes
- #3484
e710cb01e8ab2f992d0be902016e3e6540197f67
Thanks @jadeddelta! - Patches some edge cases forgetCitations
and the build process that reads CITATION.CFF files to include citation info
8.2.0
Minor Changes
- #3385
3948fdc0ac176584fe4b8fe0b9cca5ed6e8b3afc
Thanks @cherriechang! - Added citations property to info field of all plugins/extensions in two citation formats (apa, bibtex); added getCitations() as function in jsPsych package allowing user to generate citations by passing an array of plugins/extensions by name as first input and citation format as string as second input; changed template of plugins/extensions to contain citations field by default; citations for each plugin/extension are automatically generated from .cff file (if any) at its folder's root during build process; getCitations() prints out citations in the form of a string separating each citation with newline character, and always prints the jsPsych library citation first.
Patch Changes
-
#3477
d8653b076008807b382f002ae0215c887ad6db13
Thanks @rkilpadi! - Add informative error message when a trial is missing thetype
parameter -
#3479
2f8413970e06ef23dd0dd03059e2f88da396136b
Thanks @alexrockhill! - Modify import of seedrandom to fix build issue with some configurations of webpack
8.1.0
Minor Changes
- #3426
bfeeea3a
Thanks @bjoluc! - We added a feature that allows users to dynamically add or remove trials or nested timelines to a timeline array during runtime.
8.0.3
Patch Changes
- #3384
860bbaf1
Thanks @joshunrau! - Improve type definitions for randomization module
8.0.2
Patch Changes
- #3368
115a3b3d
Thanks @Max-Lovell! - Remove uses of Array.from() to improve Qualtrics compatibility
8.0.1
Patch Changes
- #3352
07835730
Thanks @Bankminer78! - ExtensionManager correctly uses extension instantiation data to produce version and type, and warns users if fields are missing.
8.0.0
Major Changes
-
#2858
b8001735
Thanks @bjoluc! - Rewrite jsPsych's core logic. The following breaking changes have been made:Timeline Events
conditional_function
is 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_function
into a nested timeline instead.on_timeline_start
andon_timeline_finish
are 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_start
andon_timeline_finish
callbacks 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_variables
parameter 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: true
in 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
info
object. Parameter functions and timeline variables in nested objects are only evaluated if the nested object's parameters are explicitly specified using thenested
property in the parameter description.
Progress Bar
jsPsych.setProgressBar(x)
has been replaced byjsPsych.progressBar.progress = x
jsPsych.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_id
trial result property andjsPsych.data.getDataByTimelineNode()
have been removed. - Unlike previously, the
save_trial_parameters
parameter 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
await
utility functions likepressKey()
to process the event loop. - The
jspsych
package no longer exportsuniversalPluginParameters
and theUniversalPluginParameters
type. - Interaction listeners are now removed when the experiment ends.
-
#3166
ce4333cc
Thanks @jodeleeuw! - Removed theexclusions
option frominitJsPsych()
. The recommended replacement for this functionality is the browser-check plugin.Removed the
hardwareAPI
module from the pluginAPI. This was no longer being updated and the features were out of date. -
#3031
f9eb17c3
Thanks @jodeleeuw! - Changed the behavior ofDataColumn.mean()
to excludenull
andundefined
values from the calculation, as suggested in #2905 -
#3342
6717e00c
Thanks @Bankminer78! - Changed plugins to use AudioPlayer class; added tests using AudioPlayer mock; plugins now use AudioPlayerInterface. -
#3162
3f359e55
Thanks @jodeleeuw! - Removedmax-width: 95%
CSS rule on the.jspsych-content
<div>
. This rule existed to address an old IE bug with flex layouts. -
#3339
74b4adc7
Thanks @jodeleeuw! -finishTrial()
now clears the display and any timeouts set withpluginApi.setTimeout()
Minor Changes
-
#3168
7b1ae24f
Thanks @jodeleeuw! - AddedjsPsych.abortTimelineByName()
. This allows for aborting a specific active timeline by itsname
property. Thename
can be set in the description of the timline. -
#3326
c5a0dbb1
Thanks @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
6f9d01b2
Thanks @jodeleeuw! - Addedrecord_data
as a parameter available for any trial. Settingrecord_data: false
will prevent data from being stored in the jsPsych data object for that trial. -
#3182
3855b5d8
Thanks @bjoluc! - Allow trialon_finish
methods to be asynchronous, i.e. return aPromise
. Prior to this, promises returned byon_finish
were not awaited before proceeding with the next trial. -
#3201
be7df303
Thanks @Shaobin-Jiang! - Allow message_progress_bar to be a function
Patch Changes
-
#3338
7a4a4b83
Thanks @jodeleeuw! -getKeyboardResponse
now returns thekey
in the original case (e.g., "Enter" instead of "enter") for easier matching to standard key event documentation. -
#3152
2852cda6
Thanks @jodeleeuw! - Button plugins now support eitherdisplay: grid
ordisplay: flex
on the container element that hold the buttons. If the layout isgrid
, the number of rows and/or columns can be specified. Themargin_horizontal
andmargin_vertical
parameters 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_html
parameter.jspsych.css has new layout classes to support this feature.
-
#3242
6aea52c3
Thanks @Shaobin-Jiang! - Fix typo in randomInt error message
7.3.4
Patch Changes
- #3184
9acfa29c
Thanks @bjoluc! - Point to source maps via canonical unpkg URLs in NPM-published browser builds. This prevents 404 errors when using redirecting CDN URLs (as described in #3043).
7.3.3
Patch Changes
- #3039
465527a8
Thanks @jodeleeuw! - Fix error in how nested parameters were handled in simulation mode, #2911
- #3039
852d5745
Thanks @jodeleeuw! - Fixed how simulation mode handlessetTimeout
calls to ensure that timeouts are cleared at the end of a trial, even in cases where the user interacts with a simulated trial when the simulation is being run invisual
mode.
- #3039
612d9e12
Thanks @jodeleeuw! - Fixed issue where a trial'son_load
was not called when using simulation mode but setting a trial'ssimulate
option tofalse
.
- #3039
481efec0
Thanks @jodeleeuw! - Fix target of simulationdispatchEvent
so that simulation mode works with customdisplay_element
7.3.2
Patch Changes
- #2974
13243618
Thanks @jodeleeuw! - This fixes an issue when a plugin has a COMPLEX parameter and there is a default value specified at the root level of the parameter, rather than for each individual nested parameter (#2972).
7.3.1
Patch Changes
- #2754
6bf9ea97
Thanks @javidalpe! - Fix preload plugin onerror callback so that it returns proper src information when there are 404 errors.
- #2811
28136787
Thanks @jodeleeuw! - Fixed a bug inrandomization.shuffleNoRepeats()
where having anequalityFunction
that used a logical OR could result in some neighboring elements still evaluating totrue
viaequalityFunction
.
7.3.0
Minor Changes
- #2649
a446f504
Thanks @jodeleeuw! - Allow passingblob:
URLs as input to video plugins.
- #2649
133d85f4
Thanks @jodeleeuw! - Add features for recording from video streams to the pluginAPI
Patch Changes
- #2683
0d2808f6
Thanks @jodeleeuw! -jsPsych.timelineVariable()
will now produce aconsole.warn()
when the timeline variable does not exist.
7.2.3
Patch Changes
- #2643
dc005661
Thanks @bjoluc! - Include previously undefinedregeneratorRuntime
in the Babel build of thejspsych
package
7.2.2
Patch Changes
- #2628
661a64f8
Thanks @vijaymarupudi! - Use a more efficient method to access the most recent trial's data at the end of each trial.
- #2632
a17f423f
Thanks @bjoluc! - Improve browser compatibility when loading viaunpkg.com
, i.e. when using thedist/index.browser.min.js
build artifact.
7.2.1
Patch Changes
- #2540
48b83652
Thanks @bjoluc! - Fix a ReferenceError ("require$0
is not defined") related to the new seedable random number generator
7.2.0
Minor Changes
- #2407
cafc6a1f
Thanks @jodeleeuw! - AddedfilterColumns()
to the DataCollection class. This function lets users select a subset of the columns in the DataCollection. It is the opposite of theignore()
method.
- #2379
9a28fb08
Thanks @jodeleeuw! - AddedsetSeed()
tojsPsych.randomization
to allow for seeding the random number generator and generating predictable sequences of random numbers.
Patch Changes
- #2539
49d69075
Thanks @jodeleeuw! - Fixed an issue where thepost_trial_gap
was still run in realtime duringdata-only
simulation mode. The gap is now skipped as intended.
- #2504
60f4d868
Thanks @bjoluc! - Inline Open Sans web font injspsych.css
to be GDPR-compliant (see #2153)
7.1.2
Patch Changes
- #2380
5159e0eb
Thanks @jodeleeuw! - Fixed the case wheresimulation_options
is a function that returns a string for looking up corresponding options in the simulate settings.
7.1.1
Patch Changes
- #2376
01f8a373
Thanks @jodeleeuw! - Fixed the default case forjsPsych.simulate()
when no simulation_mode is specified. Now properly runs in data-only mode.
7.1.0
Minor Changes
- #2350
c81b5007
Thanks @jodeleeuw! - Added microphone related features to thepluginAPI
module:initializeMicrophoneRecorder()
andgetMicrophoneRecorder()
. These allow sharing of theMediaRecorder
object attached to the microphone'sMediaStream
across trials.
- #2245
1216ace2
Thanks @bjoluc! - Throw errors if trialtype
parameters are strings, deprecated jsPsych functions are called, or the globaljsPsych
variable is used without assigning a JsPsych instance first (#2217)
- #2287
522aa2cd
Thanks @jodeleeuw! - AddedrandomInt(lower, upper)
,sampleBernoulli(p)
,sampleNormal(mean, std)
,sampleExponential(rate)
, andsampleExGaussian(mean, std, rate, positive=false)
tojsPsych.randomization
.
- #2287
522aa2cd
Thanks @jodeleeuw! - Added the ability to run the experiment in simulation mode usingjsPsych.simulate()
. See the simulation mode documentation for information about how to get started.
- #2287
522aa2cd
Thanks @jodeleeuw! - Added methods to assist with simulation (e.g.,pressKey
for dispatching a keyboard event andclickTarget
for dispatching a click event) to the PluginAPI module.
- #2209
45fb3ebb
Thanks @jodeleeuw! -jsPsych.endExperiment()
has a new, optional second parameter for saving data. Passing in an object of key-value pairs will store the pairs in the data for the final trial of the experiment.
- #2287
522aa2cd
Thanks @jodeleeuw! - Added several functions to thepluginAPI
module in order to support the new simulation feature.
Patch Changes
- #2287
522aa2cd
Thanks @jodeleeuw! - The weights argument forrandomization.sampleWithReplacement()
is now explicitly marked as optional in TypeScript. This has no impact on usage, as the implementation was already treating this argument as optional.
7.0.0
Major Changes
-
#2183
c8760b1
Thanks @jodeleeuw, @becky-gilbert, @bjoluc! - jsPsych is now fully modular, with individual NPM packages for the core library, plugins, and extensions.To support this change, we've made a number of breaking changes. We've added a guide for migrating from version 6.x to 7.x to the documentation, and updated the hello world tutorial with instructions for configuring jsPsych in three different ways. In addition to enabling package management, some of the benefits that this change provides include an improved developer experience with IntelliSense code hints, proper encapsulation of jsPsych so that multiple instances can be run on the same page, and easier integration with modern JavaScript tools like bundlers.
- #2130
2802430
Thanks @jodeleeuw! - Added the option for plugins to return aPromise
and delay the execution of theon_load
event handler for the trial until the plugin manually invokes it. This allows for plugins that have asynchronous components to finish loading before triggering theon_load
event. Added this functionality to all plugins that currently require it.
- #2100
b0d77e7
Thanks @jodeleeuw! - Renamed all getter-type functions to haveget
prefix to make it clearer what the role of these functions are. The following were affected:currentTimelineNodeID
->getCurrentTimelineNodeID
progress
->getProgress
startTime
->getStartTime
totalTime
->getTotalTime
currentTrial
->getCurrentTrial
initSettings
->getInitSettings
allTimelineVariables
->getAllTimelineVariables
Minor Changes
- #2142
12d6753
Thanks @jodeleeuw! - WhenjsPsych.endExperiment
is called it provides the option of displaying a message on the screen. If theon_finish
event handler ininitJsPsych()
returns aPromise
then the message will now display only after the promise has resolved.
- #2129
f37f64a
Thanks @jodeleeuw! - All duration measurements, including response times, are now rounded to the nearest millisecond. We changed this because the precision thatperformance.now()
generates is misleading in this context and removing the (often very long) decimal component of the measurement will save space in the data files.
- #2121
03517a0
Thanks @zimmerrol! - Updatedturk.submitToTurk()
to usePOST
instead ofGET
to avoid errors where too much data is transmitted.