UiL-OTS-labs / jspsych-spr-mw

A self paced reading with moving window experiment using jsPsych
GNU General Public License v2.0
6 stars 3 forks source link

stopIfExperimentClosed incorrectly placed #21

Closed tymees closed 2 years ago

tymees commented 2 years ago

Right now, the setAccessKey and stopIfExperimentClosed are called early on in kickOffExperiment(). However, this clashes with the new session API for list balancing in the main() function.

As that will make an API call before stopIfExperimentClosed is called, an API error will crash the experiment.

Thus, the lines

    uil.setAccessKey(ACCESS_KEY);
    uil.stopIfExperimentClosed();

on line 57 should be moved to be the first two lines of main()

bbonf commented 2 years ago

I was thinking about incorporating stopIfExperimentClosed in session.start, because we probably always want to run it? and right now most templates don't call it at all

maartenuni commented 2 years ago

I was thinking about incorporating stopIfExperimentClosed in session.start, because we probably always want to run it? and right now most templates don't call it at all

Probably all of the lexical decisions don't use it. I like the idea that we check whether the experiment is fit to handle new sessions in session.start Than we have one obvious place to check whether a session can start.

bbonf commented 2 years ago

For now I moved the call to the start of main(): https://github.com/UiL-OTS-labs/jspsych-spr-mw/commit/bed42140f58f66a8ac8481f9def0e1a37b7dd2e7

We can plan a better solution later