Millisecond Forums

can I screen out participants

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

By BG_CQU - 8/3/2015

Good Evening

I need to redirect participants who don't fit certain demographic criteria at the beginning of the survey to a screen out page via a URL. Can anyone suggest a way that I can do this. I don't mind if the participant has to click the link themselves.

Any ideas?

Thanks
Belinda.
By Dave - 8/3/2015

You can use standard conditional logic in your script to do that. Set the defaults.finishpage property to the desired value (the screen out URL) and terminate the script if the screen out condition is met.
By BG_CQU - 8/4/2015

Thanks for the speedy reply!

I have looked at the documentation regarding conditional logic and can only find where it applies to trials in an experiment rather than answers to survey questions. I wondered whether my best option was to use the 'stop' branching technique, so that if participants select a particular answer the script is stopped and they are sent to the finish URL that I will program when I put the survey/task on the millisecond website.

I was unable to find an example of syntax for this command, I'm wondering if you could provide me with one. This is the question that requires it: (if participants select "no", they need to be screened out)

<radiobuttons consent>
/caption = "I have read and understood the information sheet and agree to participate in the study"
/ options = ("No","Yes")
/required = true
/orientation = vertical
</radiobuttons>

Thanks!!
Belinda
By Dave - 8/4/2015

A <surveypage> is a kind of <trial> element, i.e., what applies to <trial> elements in terms of conditional logic and event attributes applies to <surveypage>s and their questions as well. You'd essentially do something along the following lines:

<surveypage screenoutpage>
/ ontrialend = [if(radiobuttons.consent.response=="No") {defaults.finishpage="http://www.example.com"; script.abort(); }]
/ questions = [1=consent]
</surveypage>

<radiobuttons consent>
/caption = "I have read and understood the information sheet and agree to participate in the study"
/ options = ("No","Yes")
/required = true
/orientation = vertical
</radiobuttons>
By BG_CQU - 8/4/2015

Thanks again for the quick reply!

At this point, with the syntax inserted, the survey continues to the end regardless of whether I select "yes" or "no" to the consent question.

Will this only work when I have the survey and task launched on the millisecond website (and have therefore specified a 'finishpage') or should it be working now using just the stand alone trial version of Inquisit?

Belinda.

<surveypage screenoutpage1>
/ ontrialend = [if(radiobuttons.consent.response=="No") {defaults.finishpage="www.websiteaddress.com"; script.abort(); }]
/ questions = [1=consent]
</surveypage>

<radiobuttons consent>
/caption = "I have read and understood the information sheet and agree to participate in the study"
/ options = ("No","Yes")
/required = true
/orientation = vertical
</radiobuttons>
By Dave - 8/4/2015

#1: Inquisit Lab will *not* redirect you to any URL and isn't supposed to. That'll only work on the web.
#2: If have, of course, tested the code and verified it works under the current Inquisit release (4.0.8.0). If you are using an outdated version, please update your installation. Here's a bit of runnable example code:

<block myblock>
/ trials = [1=screenoutpage1; 2=mytrial]
</block>

<surveypage screenoutpage1>
/ ontrialend = [if(radiobuttons.consent.response=="No") {defaults.finishpage="http://www.websiteaddress.com"; script.abort(); }]
/ questions = [1=consent]
</surveypage>

<radiobuttons consent>
/caption = "I have read and understood the information sheet and agree to participate in the study"
/ options = ("No","Yes")
/required = true
/orientation = vertical
</radiobuttons>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("The consent response was <%radiobuttons.consent.response%>. If you selected 'No' on the previous page, you should not be seeing this.")
</text>


Select 'No' and the script will terminate. Select 'Yes' and you'll see the message.
By BG_CQU - 8/5/2015

Thanks heaps Dave!!

One minor issue with this that I can't seem to rectify is that it places a 1 at the top left corner of the screen (see below) that might be a bit confusing to participants - any way I can get rid of it?

https://www.millisecond.com/forums/uploads/images/f2bdcedc-8789-471c-a591-ac78.png
Belinda
By Dave - 8/5/2015

Sure. Set the <surveypage>'s /showpagenumbers attribute to false:

<surveypage screenoutpage1>
/ ontrialend = [if(radiobuttons.consent.response=="No") {defaults.finishpage="http://www.websiteaddress.com"; script.abort(); }]
/ questions = [1=consent]
/ showpagenumbers = false
</surveypage>

If you also want to get rid of the question numbering, do the same with the /showquestionnumbers attribute.

<surveypage screenoutpage1>
/ ontrialend = [if(radiobuttons.consent.response=="No") {defaults.finishpage="http://www.websiteaddress.com"; script.abort(); }]
/ questions = [1=consent]
/ showpagenumbers = false
/ showquestionnumbers = false
</surveypage>
By BG_CQU - 8/6/2015

Brilliant! Thank you for all your help!
By BG_CQU - 8/6/2015

Ah...sorry...me again :)

This was all working very well on the stand alone version, but now I have uploaded the script to the website it's not functioning as hoped. If the participant selects "no" to consent question, the screen out page just aborts the script - no re-direct to URL. I have attached the syntax with the actual website I require the redirect to below, can you see why this might not be working?

<block screen1>
/ trials = [1=screenoutpage]
</block>

<surveypage screenoutpage>
/ ontrialend = [if(radiobuttons.consent.response=="No") {defaults.finishpage="http://www.myopinions.com.au/Surveys/RewardSurvey.aspx?codes=spsqiogaap&id=<id"; script.abort();}]
/ questions = [1=consent]
/ showpagenumbers = false
/ showquestionnumbers = false
/ finishlabel = "Next"
</surveypage>

<radiobuttons consent>
/caption = "I have read and understood the information sheet and agree to participate in the study"
/ options = ("No","Yes")
/required = true
/orientation = vertical
</radiobuttons>
By Dave - 8/6/2015

Hmm, I think this may be a side effect of using the abort() function under certain circumstances. Okay, different approach without using abort(). Use /stop and /skip attributes in your <block>s to prevent them from running in case the participant responds "No" on the consent question. I.e.

<expt>
/ blocks = [1=screen1; 2=taskblock]
</expt>

<block screen1>
/ stop = [radiobuttons.consent.response=="No"]
/ trials = [1=screenoutpage; 2=checktrial]
</block>

<block taskblock>
/ skip = [radiobuttons.consent.response=="No"]
/ trials = [1=tasktrial]
</block>

<surveypage screenoutpage>
/ ontrialend = [if(radiobuttons.consent.response=="No") {defaults.finishpage=text.screenouturl.item.1;}]
/ questions = [1=consent]
/ showpagenumbers = false
/ showquestionnumbers = false
/ finishlabel = "Next"
</surveypage>

<text screenouturl>
/ items = ("http://www.myopinions.com.au/Surveys/RewardSurvey.aspx?codes=spsqiogaap&id=<%script.subjectid%>")
</text>

<radiobuttons consent>
/caption = "I have read and understood the information sheet and agree to participate in the study"
/ options = ("No","Yes")
/required = true
/orientation = vertical
</radiobuttons>

<trial checktrial>
/ stimulusframes = [1=checktext]
/ validresponse = (57)
</trial>

<trial tasktrial>
/ stimulusframes = [1=tasktext]
/ validresponse = (57)
</trial>

<text checktext>
/ items = ("The consent response was <%radiobuttons.consent.response%>. If you selected 'No' on the previous page, you should not be seeing this.")
</text>

<text tasktext>
/ items = ("This is the actual task.")
</text>

You can test the above code directly here: http://research.millisecond.com/david.nitz/experiment.web?id=12345
By BG_CQU - 8/7/2015

Unfortunately still no luck with this :(

The test worked fine, both online and my stand alone version. However, when I launched the new script onto the website (removing all the check text etc) the survey continues even when the respondent selects "no". Any other suggestions or did I mess up editing the syntax for the web? (see below)

Here is the experiment specified below (note the participants see a picture of the consent form first, then are asked 2 screen out question 1) consent (as discussed) and 2) over 18 (which I will cut, paste and edit the consent screen out syntax for), then they go onto the survey.

<expt>
/ blocks = [1=consentpic; 2=screen1; 3=screen2; 4= Survey; 5=block1; 6=block2; 7=block3; 8=block4; 9=block5; 10=block6; 11=block7; 12=block8; 13=block9; 14=block10; 15=block11; 16=block12; 17=block13; 18=block14; 19=block15; 20=block16; 21=block17]
</expt>

And here is the screen out syntax I used for the consent screen out.

<block screen1>
/ stop = [radiobuttons.consent.response=="No"]
/ trials = [1=screenoutpage]
</block>

<surveypage screenoutpage>
/ ontrialend = [if(radiobuttons.consent.response=="No") {defaults.finishpage=text.screenouturl.item.1;}]
/ questions = [1=consent]
/ showpagenumbers = false
/ showquestionnumbers = false
/ finishlabel = "Next"
</surveypage>

<text screenouturl>
/ items = ("http://www.myopinions.com.au/Surveys/RewardSurvey.aspx?codes=spsqiogaap&id=<%script.subjectid%>")
</text>

<radiobuttons consent>
/caption = "I have read and understood the information sheet and agree to participate in the study"
/ options = ("No","Yes")
/required = true
/orientation = vertical
</radiobuttons>

Thanks again for all your help...and your patience!

Bel.
By Dave - 8/8/2015

I can't tell you where the mistake/s is/are based on that snippet. It is too incomplete.

If I were to hazard a guess, I'd say that you missed including or misspecified the /skip attributes in all the subsequent blocks:

<block screen1>
/ stop = [radiobuttons.consent.response=="No"]
/ trials = [1=screenoutpage; 2=checktrial]
</block>

<block taskblock>
/ skip = [radiobuttons.consent.response=="No"]
/ trials = [1=tasktrial]
</block>

Every <block> or <survey> in your script that follows <block screen1> needs to have that specified in order to *not* be run in case of a participant declining to give consent.
By BG_CQU - 8/12/2015

Thanks!!

You were right, I had not included the skip function to all other blocks.

It's all up and running now. Thanks again for your help and patience.

Belinda.