Hi Valerie,
In order to implement something like that, you need to change the IAT extension. For that, copy that script to your own folder, make sure your IAT script uses that file and not our extension, and then modify our extension.
[*Note: I am assuming you're using the standalone free IAT implementation; if it's for Qualtrics -- we stopped maintaining that, but all that I wrote here should work, you only need to change the Qualtrics IAT extension, rather than our standalone IAT extension].
To modify our extension to achieve your goal, you will need to display the Exit stimulus and create an action that implements the exit:
Perhaps start by looking at how we created the error-correction reminder stimulus:
layout.push({location: {bottom:1}, media: {html: isTouch ? params.remindErrorTextTouch : params.remindErrorText} });
At the same place, you might want to do something like:
layout.push({location:{bottom:0}, handle:'exit', css:{cursor:'pointer'}, media:{word:'Click to Exit'}); //You can also use an image, if you prefer, by using "image:..."
This will display the stimulus at the bottom of the canvas, and the mouse cursor will change to a “pointer” when the mouse hovers over it.
Next, you need to add to the trial an input that will catch the click on that stimulus. It will be something like this, in the input array of the trial ‘sort’:
input: [
{handle:'skip1',on:'keypressed', key:27}, //Esc + Enter will skip blocks
{handle:'onExit', on:'click', stimHandle:'exit'}
leftInput,
rightInput
],
Next, you need to add an interaction that will define what to do when the Exit is clicked, in the interactions array in the ‘sort’ trial:
{
conditions: [{type:'inputEquals',value:'onExit'}],
actions: [
{type:'goto', destination: 'end'},
{type:'endTrial'}
]
}