Millisecond Forums

Skip attribute

https://www.millisecond.com/forums/Topic17735.aspx

By psyclaw - 11/16/2015

I have a study in which I want to exclude people who answer a specific way to a demographic question.  I have successfully done this in that specific script (DemoTrial.iqx below).  However, my study is comprised of 5 different scripts, which I have glued together using the batch function (see below).  Is there a way to apply the skip function so that it carries through to the other scripts?  Specifically, how do I make people who I don't want to continue onto the rest of the study be excluded after the first script?  I'm not sure what other details to give, but I can supply any information that would help lead to a solution.

Thanks in advance for any help!

<batch>
/ subjects = (1 of 24)
/ groupassignment = groupnumber
/ file = "DemoTrial.iqx"
/ file = "RaceIAT.iqx"
/ file = "MRS.iqx"
/ file = "RWA.iqx"
/ file = "SDO.iqx"
</batch>
By Dave - 11/16/2015

You cannot use /skip attributes if you want to terminate an entire <batch>. Instead you need to use the script.abort() function in your demographics script, i.e. something like

/ ontrialend = [if (radiobuttons.consent.response=="No") script.abort(); ]
By psyclaw - 11/17/2015

Thank you!!
By psyclaw - 12/1/2015

I'm sorry to bother again, but I still can't get it to work.  Below is the code I added into our demographics file.  It runs, but the other tasks in the batch still run as well.  Looking around, it doesn't look like anything is supposed to go in the parentheses of the script.abort command, but I'm not certain that is true.  Is there something obvious we're missing?  

Also, I'm not sure if this matters but participants are randomly assigned to a batch, were the survey pages are randomized.  Everyone does the demographics page first, but the other four tasks are randomized.  Any help would be greatly appreciated!  Thanks!

<surveypage black>
/ caption = "Thank you for your interest in our study. Unfortunately, you do not qualify to complete the second part."
/ questions = [1=abort]
/ fontstyle = ("Arial", 2.52%, true, false, false, false, 5, 0)
/ showpagenumbers = false
/ showquestionnumbers = false
/ ontrialend = [if (radiobuttons.abort=="Yes") script.abort(); ]
</surveypage>

<radiobuttons abort>
/ caption = "Please select yes to exit the program."
/ options = ("Yes")
/ required = true
</radiobuttons>
By Dave - 12/1/2015

/ ontrialend = [if (radiobuttons.abort=="Yes") script.abort(); ]

needs to read

/ ontrialend = [if (radiobuttons.abort.response=="Yes") script.abort(); ]

By psyclaw - 12/1/2015

Wow.  I'm so sorry I missed something so obvious.  It works perfectly now.  Thank you so much for your help!