mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
3.0 KiB
3.0 KiB
jspsych |
---|
major |
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.