How to add an exit/close button to the IAT

12 views
Skip to first unread message

Valerie Thornton

unread,
Apr 2, 2024, 12:48:26 PMApr 2
to Minno.js
Hello, I have the Race IAT up and running for my project but I was wondering if it was possible to add an "Exit" or "Close" button in the IAT preferably in the highlighted area below. Has anybody tried this?
Screenshot 2024-04-02 at 12.41.09 PM.jpg
Thanks!
-Valerie

Yoav Bar-Anan

unread,
Apr 3, 2024, 4:48:49 AMApr 3
to Minno.js, valm...@gmail.com

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'}
    ]
}
You can read more about the goto action here

One last note: I don't know who your participants are, but I would generally be worried about allowing participants to exit that easily. They might exit the task by mistake. It might be good to add an "Are you sure?" question before exiting. That is not very complicated to add. if you manage to go as far as implementing the code above, but not sure how to add an "Are you sure?" verification, you can return to this thread with the follow-up question, and I'll suggest how to implement a 2-step exit. 

All the best,
Yoav

Reply all
Reply to author
Forward
0 new messages