Millisecond Forums

How to code a pause button?

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

By clb357 - 10/10/2016

Hello!

I'm running a study using several Inquisit tasks (Mr. Peanut, Tower of London, ANT) on 7 year old children. As one might expect, when working with children it would be advantageous to be able to pause a task. However, as I understand there is no button that automatically pauses the experiment? If that is correct, is there a simple addition to the experimental code that will add a button (such as esc or backspace) that when pressed will pause the experiment -- which at that point you could choose to quit or continue?

Any help would be appreciated -- thanks!
Charlotte

By Dave - 10/10/2016

> However, as I understand there is no button that automatically pauses the experiment?

Correct.

> [...] is there a simple addition to the experimental code that will add a button (such as esc or backspace) that when pressed will pause > the experiment -- which at that point you could choose to quit or continue?

You would have to integrate the "pause" response into the overall code, i.e., add it as a valid response in all the <trial> elements, and then for example /branch to a dedicated "pause" <trial>. This is not necessarily simple. See e.g. https://www.millisecond.com/forums/Topic7654.aspx for a very basic example.

However, you would likely not need "pause" functionality for some procedures. For example, you could just leave the TOL sitting in right where it is when the participant needs a break. S/he can pick up right where s/he left off after the break. Also note that any script can be terminated using the built-in CTRL+Q key combination.

Hope this helps.
By Dave - 10/10/2016

Come to think of it, you could "abuse" the built-in debug window as a way to effectively pause a script. Press CTRL+D during script execution to bring the window up (it displays the current state of the script's various properties, values, expressions, etc.), and the script will halt at that point. The script will move on from that point once you close the window. While not necessarily pretty-looking, this would not require any modifications / additional coding in any of the scripts.

(I should add, however, that CTRL+D will only work in Inquisit Lab, not Inquisit Web.)