Millisecond Forums

Advantages of batch and include?

https://forums.millisecond.com/Topic25841.aspx

By danaleighton - 10/5/2018

Hi Inquisit people - our lab is new to Inquisit and are bringing up our first study. It is a study that is largely Likert-style questionnaire based, with an IAT. Participants will get an instruction page, one of two stimulus instruction pages (counterbalanced) with one of 2 images displayed on the page, then a few questionnaires (using survey pages), then the IAT, then more questionnaires.

We have a pretty good handle now on the language and structure of the scripts. The issue we are wondering about is how to construct the script(s).

The questionnaires will likely be used in other experiments, and so want to be reusable.

My question is what the relative advantages are of making those reusable modules their own script files and calling them from the main script in a batch, versus using an include statement to bring the source into the main script?

I can see the batch having the advantages that those scripts can have their own default settings, etc. but does include give any advantages that we might want to consider?
By Dave - 10/7/2018

danaleighton - Saturday, October 6, 2018
Hi Inquisit people - our lab is new to Inquisit and are bringing up our first study. It is a study that is largely Likert-style questionnaire based, with an IAT. Participants will get an instruction page, one of two stimulus instruction pages (counterbalanced) with one of 2 images displayed on the page, then a few questionnaires (using survey pages), then the IAT, then more questionnaires.

We have a pretty good handle now on the language and structure of the scripts. The issue we are wondering about is how to construct the script(s).

The questionnaires will likely be used in other experiments, and so want to be reusable.

My question is what the relative advantages are of making those reusable modules their own script files and calling them from the main script in a batch, versus using an include statement to bring the source into the main script?

I can see the batch having the advantages that those scripts can have their own default settings, etc. but does include give any advantages that we might want to consider?

<include> essentially pastes the contents of the external script into the main script when the main script is parsed, and the net result is that things effectively behave as if there were only a single script, i.e. there are no noticeable "breaks" when things transition from one part to the other, as opposed  to <batch>, where the switch from one script to the next is noticeable. For most scenarios, where a short break due to the transition is acceptable, <batch> is the better option, because -- as you say -- each script can have its own default and data recording settings. <include> is useful if you need modular, easy-to-switch-out components that have to interact with the main script, for example when you want to use responses to a questionnaire to serve as stimuli in the main script (see e.g. https://www.millisecond.com/download/library/v5/iat/iattemplates/selectitemsiat/selectitemsiat.web ). In addition, it is possible to have conditional <include> elements, which are useful to for example deliver different stimulus sets and/or orders to different (groups of) participants (cf. https://www.millisecond.com/forums/FindPost20059.aspx ) or to deliver different video formats to different platforms (cf. https://www.millisecond.com/forums/FindPost9931.aspx ). Things like that are easier done via <include> than via <batch>.
By danaleighton - 10/8/2018

Thanks very much! That is essentially what I suspected.
By danaleighton - 10/21/2018

OK - a follow-up.
Am I correct that a batch would not record the data to the same data file, but that using includes would? That is, each main experiment script can only record data to one file? Thus, each script in the batch would record data to a different data file? (caveat: I have not tried this yet, my apologies)
By Dave - 10/22/2018

danaleighton - Monday, October 22, 2018
OK - a follow-up.
Am I correct that a batch would not record the data to the same data file, but that using includes would? That is, each main experiment script can only record data to one file? Thus, each script in the batch would record data to a different data file? (caveat: I have not tried this yet, my apologies)

A <batch> merely runs separate / independent scripts in some sequence -- each script has its own data files and records its own variables of interest in those only. With <include> you effectively have just one single script, and that script then needs to record all variables of interest for all tasks in a single data file. This will usually lead to large and somewhat unwieldy data files.

That doesn't mean that with <batch> data from all participants can only end up in a single file. That is determined by each script, and is only relevant for use with Inquisit Lab where participants are tested on the same machine. You can force an Inquisit script to generate separate data files for each participant by setting the <data> and/or <summarydata> elements' /separatefiles attributes to true. On the web, data files from different participants are always separately stored, but they can be merged when downloading them.