Should finishTrial
also clear timeouts and empty the screen as well?
#3241
Shaobin-Jiang
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
I think this is worth strongly considering. @bjoluc curious for your thoughts on how this would interact with planned changes for |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use the
on_load
event quite a lot to tweak with the default behavior of jsPsych and from time to time I would have to manually end the experiment. I recently encountered a bug, though, when I calledfinishTrial
inon_load
but accidentally forgot to set thetrial_duration
of an html-keyboard-response plugin tonull
, so that when I was half way in the next trial, thefinishTrial
from within the previous trial, having reached the time limit, was executed, causing the current trial to be ended, resulting in a break down of the entire experiment.I located the bug quick enough, and to be frank, this was expected, as I only called
finishTrial
in myon_load
and did not clear the timeout. ThefinishTrial
function of its own accord does not include the latter; that is quite clear in the docs. However, this led me to wonder whether this is right. I mean, I have written quite a number of plugins myself and as far as trial duration is concerned, I would have to callclearAllTimeouts
aside fromfinishTrial
; oh, and besides these two I would have to clear the screen as well. And from what I see in the official plugins, these three tasks co-occur quite frequently as well. So why not just put them together in one function and letfinishTrial
also clear timeouts and the content of the screen?I would propose something like this:
Quoting from this answer:
I do not quite agree because using it properly never caused problems for me; the only problem that arose from using it was due to my not clearing the timeouts and the experiment content with it. And for that, I am much in favor of the idea of grouping the three tasks together.
Beta Was this translation helpful? Give feedback.
All reactions