Skip to content

finishTrial() affecting next timeline #3115

Answered by jodeleeuw
j-fielder asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @j-fielder,

When you call jsPsych.finishTrial() outside the context of the plugin then it's possible that some of the events that the plugin sets up are still active. For example, if the plugin sets up an event to listen for a keyboard press and then end the trial, that event has to be cleared. In the plugin code we typically do this by ensuring that when the plugin ends there are no lingering events, and jsPsych.pluginAPI.cancelAllKeyboardResponses() (docs) is one way that can be done. It's probably safe to call this method right before you call .finishTrial(), though it's not a use case that we have tested extensively.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@j-fielder
Comment options

Answer selected by j-fielder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants