Millisecond Forums

Conditional statements

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

By caithow - 10/26/2021

Hi there, 
I'm having a bit of trouble with the disqualification page of my survey. I have a few screening/eligibility questions where participants must respond a certain way in order to be eligible for the study (see first 3 questions). The survey works perfectly, except for the part at the end where I only want participants to see the disqualification page if they are ineligible for participation. At the moment, however, the disqualification page is presenting itself between the final question in the survey (survey page Demographics13 - pain diagnosis) and the end page. Basically, I do not want the disqualification page to present itself when participants have already been screened as being eligible. I have tried using the skip and branch functions to get around this issue but I still can't seem to put my finger on what I need to do to fix this problem. I also tried re-writing out the script because I thought there might have been a bug interfering with the presentation order, but this didn't seem to make any difference.

I'd be very appreciate of any insights into what might be causing this problem.
Thanks,
Caitlin

<radiobuttons age_eligibility>
/ caption = "Are you at least 18 years of age?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons colourblind_eligibility>
/ caption = "Are you colour-blind?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons English_eligibility>
/ caption = "Can you read and understand English?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>
***************************************************************************************************
<surveypage Demographics13>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_diagnosis]
</surveypage>

<surveypage disqualificationpage>
/ caption = "Sorry, you are not eligible to participate in this study. Thank you for your interest."
/ ontrialend = [if(radiobuttons.age_eligibility.response=="No") || if(radiobuttons.colourblind_eligibility.response=="Yes") || if(radiobuttons.English_eligibility.response=="No") script.abort()]
</surveypage>

<surveypage end>
/ caption = "Thank you for completing the survey. You will now begin the next section"
</surveypage>

By Dave - 10/26/2021

caithow - 10/26/2021
Hi there, 
I'm having a bit of trouble with the disqualification page of my survey. I have a few screening/eligibility questions where participants must respond a certain way in order to be eligible for the study (see first 3 questions). The survey works perfectly, except for the part at the end where I only want participants to see the disqualification page if they are ineligible for participation. At the moment, however, the disqualification page is presenting itself between the final question in the survey (survey page Demographics13 - pain diagnosis) and the end page. Basically, I do not want the disqualification page to present itself when participants have already been screened as being eligible. I have tried using the skip and branch functions to get around this issue but I still can't seem to put my finger on what I need to do to fix this problem. I also tried re-writing out the script because I thought there might have been a bug interfering with the presentation order, but this didn't seem to make any difference.

I'd be very appreciate of any insights into what might be causing this problem.
Thanks,
Caitlin

<radiobuttons age_eligibility>
/ caption = "Are you at least 18 years of age?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons colourblind_eligibility>
/ caption = "Are you colour-blind?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons English_eligibility>
/ caption = "Can you read and understand English?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>
***************************************************************************************************
<surveypage Demographics13>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_diagnosis]
</surveypage>

<surveypage disqualificationpage>
/ caption = "Sorry, you are not eligible to participate in this study. Thank you for your interest."
/ ontrialend = [if(radiobuttons.age_eligibility.response=="No" || radiobuttons.colourblind_eligibility.response=="Yes" || radiobuttons.English_eligibility.response=="No")
        script.abort();
]
</surveypage>


<surveypage end>
/ caption = "Thank you for completing the survey. You will now begin the next section"
</surveypage>


> / ontrialend = [if(radiobuttons.age_eligibility.response=="No") || if(radiobuttons.colourblind_eligibility.response=="Yes") || if(radiobuttons.English_eligibility.response=="No") script.abort()]

This syntax is off. Formulated correctly:

<surveypage disqualificationpage>
/ caption = "Sorry, you are not eligible to participate in this study. Thank you for your interest."
/ ontrialend = [if(radiobuttons.age_eligibility.response=="No" || radiobuttons.colourblind_eligibility.response=="Yes" || radiobuttons.English_eligibility.response=="No")
    script.abort();
]
</surveypage>


Beyond that, the few snippets you posted do not provide enough information to say whether there are other, additional mistakes. There is zero info on how you invoke the disqualification page in the first place.
By caithow - 10/26/2021

Dave - 10/26/2021
caithow - 10/26/2021
Hi there, 
I'm having a bit of trouble with the disqualification page of my survey. I have a few screening/eligibility questions where participants must respond a certain way in order to be eligible for the study (see first 3 questions). The survey works perfectly, except for the part at the end where I only want participants to see the disqualification page if they are ineligible for participation. At the moment, however, the disqualification page is presenting itself between the final question in the survey (survey page Demographics13 - pain diagnosis) and the end page. Basically, I do not want the disqualification page to present itself when participants have already been screened as being eligible. I have tried using the skip and branch functions to get around this issue but I still can't seem to put my finger on what I need to do to fix this problem. I also tried re-writing out the script because I thought there might have been a bug interfering with the presentation order, but this didn't seem to make any difference.

I'd be very appreciate of any insights into what might be causing this problem.
Thanks,
Caitlin

<radiobuttons age_eligibility>
/ caption = "Are you at least 18 years of age?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons colourblind_eligibility>
/ caption = "Are you colour-blind?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons English_eligibility>
/ caption = "Can you read and understand English?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>
***************************************************************************************************
<surveypage Demographics13>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_diagnosis]
</surveypage>

<surveypage disqualificationpage>
/ caption = "Sorry, you are not eligible to participate in this study. Thank you for your interest."
/ ontrialend = [if(radiobuttons.age_eligibility.response=="No" || radiobuttons.colourblind_eligibility.response=="Yes" || radiobuttons.English_eligibility.response=="No")
        script.abort();
]
</surveypage>


<surveypage end>
/ caption = "Thank you for completing the survey. You will now begin the next section"
</surveypage>


> / ontrialend = [if(radiobuttons.age_eligibility.response=="No") || if(radiobuttons.colourblind_eligibility.response=="Yes") || if(radiobuttons.English_eligibility.response=="No") script.abort()]

This syntax is off. Formulated correctly:

<surveypage disqualificationpage>
/ caption = "Sorry, you are not eligible to participate in this study. Thank you for your interest."
/ ontrialend = [if(radiobuttons.age_eligibility.response=="No" || radiobuttons.colourblind_eligibility.response=="Yes" || radiobuttons.English_eligibility.response=="No")
    script.abort();
]
</surveypage>


Beyond that, the few snippets you posted do not provide enough information to say whether there are other, additional mistakes. There is zero info on how you invoke the disqualification page in the first place.

Hi Dave,

Thanks for getting back to me so quickly. I think you're right, there must be other mistakes because adding the semicolon didn't change anything either. I've provided my script below, would you mind taking a look and seeing if you can spot anything that might be causing this to happen? 

Thanks,
Caitlin

<radiobuttons age_eligibility>
/ caption = "Are you at least 18 years of age?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons colourblind_eligibility>
/ caption = "Are you colour-blind?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons English_eligibility>
/ caption = "Can you read and understand English?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons email_question1>
/ caption = "Do you wish to receive a summary of the results for this study?"
/ options = ("No")
/ other = "Yes. If yes, please leave your email address in the space below"
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons email_question2>
/ caption = "Would you like to be contacted about future research?"
/ options = ("No")
/ other = "Yes. If yes, please leave your email address in the space below"
/ required = true
/ orientation = vertical
</radiobuttons>

<textbox email>
/ caption = "If you ticked <b>yes</b> to either question above, please leave your email address here:"
/ mask = emailaddress
/ textboxsize = (40%, 5%)
/ required = false
</textbox>

<textbox age>
/ caption = "What is your age? Please state your age in <b>years</b>"
/ mask = positiveinteger
/ required = true
</textbox>

<radiobuttons sex>
/ caption = "What sex were you assigned at birth?"
/ options = ("Male", "Female", "Intersex,", "Not listed here", "I prefer not to answer this question")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons gender>
/ caption = "We recognise gender as a social construct and therefore your gender may or may not be the same as your answer above.
What is your current gender identity?"
/ options = ("Male", "Female", "Trans male", "Trans woman", "Agender", "Non-binary", "I prefer not to answer this question")
/ other = "My gender identity is not listed. I identify as:"
/ required = true
/ orientation = vertical
</radiobuttons>

<textbox education_years>
/ caption = "How many years of education have you completed?"
/ mask = positiveinteger
/ required = true
</textbox>

<radiobuttons education_level>
/ caption = "What is your highest form of education? If currently enrolled, please indicate your highest form of education received so far."
/ options = ("Primary school", "Secondary school (i.e., Year 12 or equivalent)", "Tertiary education (e.g., Trade qualification/Certificate/Diploma/Bachelor's degree)"
, "University higher degree (e.g., Masters, PhD)")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons occupation>
/ caption = "How would you best describe your current main activity/occupation?"
/ options = ("Unemployed", "Working - full time", "Working - part time/casual", "Unable to work (disability/work cover/carer)", "Student", "Home duties", "Retired")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons financial>
/ caption = "Which of the following statements best describes your current financial situation?"
/ options = ("Finding it difficult", "Getting by", "Living comfortably")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons city_rural>
/ caption = "How would you best describe where you live?"
/ options = ("Major city", "Medium to large rural town", "Small to medium rural town", "Remote community")
/ required = true
/ orientation = vertical
</radiobuttons>

<textbox country_live>
/ caption = "In what country do you live?"
/ mask = alphabetic
/ required = true
</textbox>

<textbox country_birth>
/ caption = "What was your country of birth?"
/ mask = alphabetic
/ required = true
</textbox>

<radiobuttons refugee>
/ caption = "Do you identify as being a refugee?"
/ options = ("No", "Yes", "I prefer not to answer this question")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons race_ethnicity>
/ caption = "Do you identify with an ethnic or racial group?"
/ options = ("No", "I prefer not to answer this question")
/ other = "Yes. If yes, please state what group you identify with:"
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons mental_health>
/ caption = "Have you previously been diagnosed with a mental health condition?"
/ options = ("No")
/ other = "Yes. If yes, please state all that apply:"
/ required = true
/ orientation = vertical
</radiobuttons>

<checkboxes neurological>
/ caption = "Have you previously been diagnosed with any of the following conditions? Please select all that apply:"
/ options = ("Stroke", "Traumatic brain injury", "Dementia or Alzheimer's disease", "None of the above")
/ required = true
/ orientation = vertical
</checkboxes>

<radiobuttons chronic_pain_question>
/ caption = "For the purposes of this study, we define chronic pain as pain experienced most days for 3 months or longer. According to this definition, do you currently have chronic pain?"
/ options = ("No", "Yes")
/ required = true
/ orientation = vertical
</radiobuttons>

<slider pain_intensity>
/ caption = "On a scale from 0 to 10, where 0 = no pain at all and 10 = worst pain imaginable how would you rate your average pain in the past week?"
/ fontstyle = ("Arial", 3.13%, false, false, false, false, 5, 1)
/ labels = ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
/ range = (0, 10)
/ increment = 1
/ slidersize = (50, 5)
/ required = true
</slider>

<textbox pain_duration>
/ caption = "How long have you been experiencing chronic pain? (Please state the number of <b>months</b>)"
/ mask = alphanumeric
/ required = true
</textbox>

<radiobuttons pain_location1>
/ caption = "Please select your <b>worst</b> area of pain"
/ options = ("Back", "Head", "Neck", "Hand or arm", "Foot or leg")
/ required = true
/ orientation = vertical
</radiobuttons>

<checkboxes pain_location2>
/ caption = "Please select any other areas of pain"
/ options = ("Back", "Head", "Neck", "Hand or arm", "Foot or leg")
/ required = true
/ orientation = vertical
</checkboxes>

<radiobuttons pain_diagnosis>
/ caption = "Have you recieved a diagnosis for your chronic pain?"
/ options = ("No")
/ other = "Yes. If yes, please specify:"
/ required = true
/ orientation = vertical
</radiobuttons>

*******************************************************************************************************************
*******************************************************************************************************************
    SURVEYPAGES
*******************************************************************************************************************
*******************************************************************************************************************

<surveypage age_eligibility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.age_eligibility.response=="No") surveypage.disqualificationpage]
/ questions = [1 = age_eligibility]
</surveypage>

<surveypage colourblind_eligibility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.colourblind_eligibility.response=="Yes") surveypage.disqualificationpage]
/ questions = [1 = colourblind_eligibility]
</surveypage>

<surveypage English_eligbility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.English_eligibility.response=="No") surveypage.disqualificationpage]
/ questions = [1 = English_eligibility]
</surveypage>

<surveypage Email>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = email_question1, email_question2, email]
</surveypage>

<surveypage Demographics1>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = age, sex]
</surveypage>

<surveypage Demographics2>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = gender]
</surveypage>

<surveypage Demographics3>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = education_years, education_level]
</surveypage>

<surveypage Demographics4>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = occupation]
</surveypage>

<surveypage Demographics5>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = financial, city_rural]
</surveypage>

<surveypage Demographics6>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = country_live, country_birth]
</surveypage>

<surveypage Demographics7>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = refugee, race_ethnicity]
</surveypage>

<surveypage Demographics8>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = mental_health, neurological]
</surveypage>

<surveypage Demographics9>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = chronic_pain_question]
/ branch = [if(radiobuttons.chronic_pain_question.response=="No") surveypage.end]
</surveypage>

<surveypage Demographics10>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_intensity]
</surveypage>

<surveypage Demographics11>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_duration]
</surveypage>

<surveypage Demographics12>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_location1, pain_location2]
</surveypage>

<surveypage Demographics13>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_diagnosis]
</surveypage>

<surveypage disqualificationpage>
/ caption = "Sorry, you are not eligible to participate in this study. Thank you for your interest."
/ ontrialend = [if(radiobuttons.age_eligibility.response=="No") || if(radiobuttons.colourblind_eligibility.response=="Yes") || if(radiobuttons.English_eligibility.response=="No") script.abort();
]
</surveypage>

<surveypage end>
/ caption = "Thank you for completing the survey. You will now begin the next section"
</surveypage>

*******************************************************************************************************************
*******************************************************************************************************************
    SURVEY
*******************************************************************************************************************
*******************************************************************************************************************
Notes:
- presents the surveypages

<survey Demographics>
/ pages = [
    1 = age_eligibility;
    2 = colourblind_eligibility;
    3 = English_eligbility;
    4 = Email;
    5 = Demographics1;
    6 = Demographics2;
    7 = Demographics3;
    8 = Demographics4;
    9 = Demographics5;
    10 = Demographics6;
    11 = Demographics7;
    12 = Demographics8;
    13 = Demographics9;
    14 = Demographics10;
    15 = Demographics11;
    16 = Demographics12;
    17 = Demographics13;
    18 = disqualificationpage;
    19 = end]
By Dave - 10/26/2021

caithow - 10/26/2021
Dave - 10/26/2021
caithow - 10/26/2021
Hi there, 
I'm having a bit of trouble with the disqualification page of my survey. I have a few screening/eligibility questions where participants must respond a certain way in order to be eligible for the study (see first 3 questions). The survey works perfectly, except for the part at the end where I only want participants to see the disqualification page if they are ineligible for participation. At the moment, however, the disqualification page is presenting itself between the final question in the survey (survey page Demographics13 - pain diagnosis) and the end page. Basically, I do not want the disqualification page to present itself when participants have already been screened as being eligible. I have tried using the skip and branch functions to get around this issue but I still can't seem to put my finger on what I need to do to fix this problem. I also tried re-writing out the script because I thought there might have been a bug interfering with the presentation order, but this didn't seem to make any difference.

I'd be very appreciate of any insights into what might be causing this problem.
Thanks,
Caitlin

<radiobuttons age_eligibility>
/ caption = "Are you at least 18 years of age?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons colourblind_eligibility>
/ caption = "Are you colour-blind?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons English_eligibility>
/ caption = "Can you read and understand English?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>
***************************************************************************************************
<surveypage Demographics13>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_diagnosis]
</surveypage>

<surveypage disqualificationpage>
/ caption = "Sorry, you are not eligible to participate in this study. Thank you for your interest."
/ ontrialend = [if(radiobuttons.age_eligibility.response=="No" || radiobuttons.colourblind_eligibility.response=="Yes" || radiobuttons.English_eligibility.response=="No")
        script.abort();
]
</surveypage>


<surveypage end>
/ caption = "Thank you for completing the survey. You will now begin the next section"
</surveypage>


> / ontrialend = [if(radiobuttons.age_eligibility.response=="No") || if(radiobuttons.colourblind_eligibility.response=="Yes") || if(radiobuttons.English_eligibility.response=="No") script.abort()]

This syntax is off. Formulated correctly:

<surveypage disqualificationpage>
/ caption = "Sorry, you are not eligible to participate in this study. Thank you for your interest."
/ ontrialend = [if(radiobuttons.age_eligibility.response=="No" || radiobuttons.colourblind_eligibility.response=="Yes" || radiobuttons.English_eligibility.response=="No")
    script.abort();
]
</surveypage>


Beyond that, the few snippets you posted do not provide enough information to say whether there are other, additional mistakes. There is zero info on how you invoke the disqualification page in the first place.

Hi Dave,

Thanks for getting back to me so quickly. I think you're right, there must be other mistakes because adding the semicolon didn't change anything either. I've provided my script below, would you mind taking a look and seeing if you can spot anything that might be causing this to happen? 

Thanks,
Caitlin

<radiobuttons age_eligibility>
/ caption = "Are you at least 18 years of age?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons colourblind_eligibility>
/ caption = "Are you colour-blind?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons English_eligibility>
/ caption = "Can you read and understand English?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons email_question1>
/ caption = "Do you wish to receive a summary of the results for this study?"
/ options = ("No")
/ other = "Yes. If yes, please leave your email address in the space below"
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons email_question2>
/ caption = "Would you like to be contacted about future research?"
/ options = ("No")
/ other = "Yes. If yes, please leave your email address in the space below"
/ required = true
/ orientation = vertical
</radiobuttons>

<textbox email>
/ caption = "If you ticked <b>yes</b> to either question above, please leave your email address here:"
/ mask = emailaddress
/ textboxsize = (40%, 5%)
/ required = false
</textbox>

<textbox age>
/ caption = "What is your age? Please state your age in <b>years</b>"
/ mask = positiveinteger
/ required = true
</textbox>

<radiobuttons sex>
/ caption = "What sex were you assigned at birth?"
/ options = ("Male", "Female", "Intersex,", "Not listed here", "I prefer not to answer this question")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons gender>
/ caption = "We recognise gender as a social construct and therefore your gender may or may not be the same as your answer above.
What is your current gender identity?"
/ options = ("Male", "Female", "Trans male", "Trans woman", "Agender", "Non-binary", "I prefer not to answer this question")
/ other = "My gender identity is not listed. I identify as:"
/ required = true
/ orientation = vertical
</radiobuttons>

<textbox education_years>
/ caption = "How many years of education have you completed?"
/ mask = positiveinteger
/ required = true
</textbox>

<radiobuttons education_level>
/ caption = "What is your highest form of education? If currently enrolled, please indicate your highest form of education received so far."
/ options = ("Primary school", "Secondary school (i.e., Year 12 or equivalent)", "Tertiary education (e.g., Trade qualification/Certificate/Diploma/Bachelor's degree)"
, "University higher degree (e.g., Masters, PhD)")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons occupation>
/ caption = "How would you best describe your current main activity/occupation?"
/ options = ("Unemployed", "Working - full time", "Working - part time/casual", "Unable to work (disability/work cover/carer)", "Student", "Home duties", "Retired")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons financial>
/ caption = "Which of the following statements best describes your current financial situation?"
/ options = ("Finding it difficult", "Getting by", "Living comfortably")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons city_rural>
/ caption = "How would you best describe where you live?"
/ options = ("Major city", "Medium to large rural town", "Small to medium rural town", "Remote community")
/ required = true
/ orientation = vertical
</radiobuttons>

<textbox country_live>
/ caption = "In what country do you live?"
/ mask = alphabetic
/ required = true
</textbox>

<textbox country_birth>
/ caption = "What was your country of birth?"
/ mask = alphabetic
/ required = true
</textbox>

<radiobuttons refugee>
/ caption = "Do you identify as being a refugee?"
/ options = ("No", "Yes", "I prefer not to answer this question")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons race_ethnicity>
/ caption = "Do you identify with an ethnic or racial group?"
/ options = ("No", "I prefer not to answer this question")
/ other = "Yes. If yes, please state what group you identify with:"
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons mental_health>
/ caption = "Have you previously been diagnosed with a mental health condition?"
/ options = ("No")
/ other = "Yes. If yes, please state all that apply:"
/ required = true
/ orientation = vertical
</radiobuttons>

<checkboxes neurological>
/ caption = "Have you previously been diagnosed with any of the following conditions? Please select all that apply:"
/ options = ("Stroke", "Traumatic brain injury", "Dementia or Alzheimer's disease", "None of the above")
/ required = true
/ orientation = vertical
</checkboxes>

<radiobuttons chronic_pain_question>
/ caption = "For the purposes of this study, we define chronic pain as pain experienced most days for 3 months or longer. According to this definition, do you currently have chronic pain?"
/ options = ("No", "Yes")
/ required = true
/ orientation = vertical
</radiobuttons>

<slider pain_intensity>
/ caption = "On a scale from 0 to 10, where 0 = no pain at all and 10 = worst pain imaginable how would you rate your average pain in the past week?"
/ fontstyle = ("Arial", 3.13%, false, false, false, false, 5, 1)
/ labels = ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
/ range = (0, 10)
/ increment = 1
/ slidersize = (50, 5)
/ required = true
</slider>

<textbox pain_duration>
/ caption = "How long have you been experiencing chronic pain? (Please state the number of <b>months</b>)"
/ mask = alphanumeric
/ required = true
</textbox>

<radiobuttons pain_location1>
/ caption = "Please select your <b>worst</b> area of pain"
/ options = ("Back", "Head", "Neck", "Hand or arm", "Foot or leg")
/ required = true
/ orientation = vertical
</radiobuttons>

<checkboxes pain_location2>
/ caption = "Please select any other areas of pain"
/ options = ("Back", "Head", "Neck", "Hand or arm", "Foot or leg")
/ required = true
/ orientation = vertical
</checkboxes>

<radiobuttons pain_diagnosis>
/ caption = "Have you recieved a diagnosis for your chronic pain?"
/ options = ("No")
/ other = "Yes. If yes, please specify:"
/ required = true
/ orientation = vertical
</radiobuttons>

*******************************************************************************************************************
*******************************************************************************************************************
    SURVEYPAGES
*******************************************************************************************************************
*******************************************************************************************************************

<surveypage age_eligibility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.age_eligibility.response=="No") surveypage.disqualificationpage]
/ questions = [1 = age_eligibility]
</surveypage>

<surveypage colourblind_eligibility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.colourblind_eligibility.response=="Yes") surveypage.disqualificationpage]
/ questions = [1 = colourblind_eligibility]
</surveypage>

<surveypage English_eligbility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.English_eligibility.response=="No") surveypage.disqualificationpage]
/ questions = [1 = English_eligibility]
</surveypage>

<surveypage Email>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = email_question1, email_question2, email]
</surveypage>

<surveypage Demographics1>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = age, sex]
</surveypage>

<surveypage Demographics2>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = gender]
</surveypage>

<surveypage Demographics3>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = education_years, education_level]
</surveypage>

<surveypage Demographics4>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = occupation]
</surveypage>

<surveypage Demographics5>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = financial, city_rural]
</surveypage>

<surveypage Demographics6>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = country_live, country_birth]
</surveypage>

<surveypage Demographics7>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = refugee, race_ethnicity]
</surveypage>

<surveypage Demographics8>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = mental_health, neurological]
</surveypage>

<surveypage Demographics9>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = chronic_pain_question]
/ branch = [if(radiobuttons.chronic_pain_question.response=="No") surveypage.end]
</surveypage>

<surveypage Demographics10>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_intensity]
</surveypage>

<surveypage Demographics11>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_duration]
</surveypage>

<surveypage Demographics12>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_location1, pain_location2]
</surveypage>

<surveypage Demographics13>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_diagnosis]
</surveypage>

<surveypage disqualificationpage>
/ caption = "Sorry, you are not eligible to participate in this study. Thank you for your interest."
/ ontrialend = [if(radiobuttons.age_eligibility.response=="No") || if(radiobuttons.colourblind_eligibility.response=="Yes") || if(radiobuttons.English_eligibility.response=="No") script.abort();
]
</surveypage>

<surveypage end>
/ caption = "Thank you for completing the survey. You will now begin the next section"
</surveypage>

*******************************************************************************************************************
*******************************************************************************************************************
    SURVEY
*******************************************************************************************************************
*******************************************************************************************************************
Notes:
- presents the surveypages

<survey Demographics>
/ pages = [
    1 = age_eligibility;
    2 = colourblind_eligibility;
    3 = English_eligbility;
    4 = Email;
    5 = Demographics1;
    6 = Demographics2;
    7 = Demographics3;
    8 = Demographics4;
    9 = Demographics5;
    10 = Demographics6;
    11 = Demographics7;
    12 = Demographics8;
    13 = Demographics9;
    14 = Demographics10;
    15 = Demographics11;
    16 = Demographics12;
    17 = Demographics13;
    18 = disqualificationpage;
    19 = end]

> because adding the semicolon didn't change anything either.

The relevant change isn't the semicolon. It's the syntax in your if() condition that is broken, so please go back and review the fixed code in my previous response again.

That said, there is another issue:

<survey Demographics>
/ pages = [
  1 = age_eligibility;
  2 = colourblind_eligibility;
  3 = English_eligbility;
  4 = Email;
  5 = Demographics1;
  6 = Demographics2;
  7 = Demographics3;
  8 = Demographics4;
  9 = Demographics5;
  10 = Demographics6;
  11 = Demographics7;
  12 = Demographics8;
  13 = Demographics9;
  14 = Demographics10;
  15 = Demographics11;
  16 = Demographics12;
  17 = Demographics13;
  18 = disqualificationpage;
  19 = end]
</survey>

The disqualification page does not belong there. You invoke it dynamically via /branch from the various eligibility pages.

<surveypage age_eligibility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.age_eligibility.response=="No") surveypage.disqualificationpage]
/ questions = [1 = age_eligibility]
</surveypage>

<surveypage colourblind_eligibility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.colourblind_eligibility.response=="Yes") surveypage.disqualificationpage]
/ questions = [1 = colourblind_eligibility]
</surveypage>

<surveypage English_eligbility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.English_eligibility.response=="No") surveypage.disqualificationpage]
/ questions = [1 = English_eligibility]
</surveypage>

It makes absolutely no sense to also run the page unconditionally via your survey's /pages and thus show it to all participants, whether they're eligible or not.
By caithow - 10/26/2021

Dave - 10/26/2021
caithow - 10/26/2021
Dave - 10/26/2021
caithow - 10/26/2021
Hi there, 
I'm having a bit of trouble with the disqualification page of my survey. I have a few screening/eligibility questions where participants must respond a certain way in order to be eligible for the study (see first 3 questions). The survey works perfectly, except for the part at the end where I only want participants to see the disqualification page if they are ineligible for participation. At the moment, however, the disqualification page is presenting itself between the final question in the survey (survey page Demographics13 - pain diagnosis) and the end page. Basically, I do not want the disqualification page to present itself when participants have already been screened as being eligible. I have tried using the skip and branch functions to get around this issue but I still can't seem to put my finger on what I need to do to fix this problem. I also tried re-writing out the script because I thought there might have been a bug interfering with the presentation order, but this didn't seem to make any difference.

I'd be very appreciate of any insights into what might be causing this problem.
Thanks,
Caitlin

<radiobuttons age_eligibility>
/ caption = "Are you at least 18 years of age?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons colourblind_eligibility>
/ caption = "Are you colour-blind?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons English_eligibility>
/ caption = "Can you read and understand English?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>
***************************************************************************************************
<surveypage Demographics13>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_diagnosis]
</surveypage>

<surveypage disqualificationpage>
/ caption = "Sorry, you are not eligible to participate in this study. Thank you for your interest."
/ ontrialend = [if(radiobuttons.age_eligibility.response=="No" || radiobuttons.colourblind_eligibility.response=="Yes" || radiobuttons.English_eligibility.response=="No")
        script.abort();
]
</surveypage>


<surveypage end>
/ caption = "Thank you for completing the survey. You will now begin the next section"
</surveypage>


> / ontrialend = [if(radiobuttons.age_eligibility.response=="No") || if(radiobuttons.colourblind_eligibility.response=="Yes") || if(radiobuttons.English_eligibility.response=="No") script.abort()]

This syntax is off. Formulated correctly:

<surveypage disqualificationpage>
/ caption = "Sorry, you are not eligible to participate in this study. Thank you for your interest."
/ ontrialend = [if(radiobuttons.age_eligibility.response=="No" || radiobuttons.colourblind_eligibility.response=="Yes" || radiobuttons.English_eligibility.response=="No")
    script.abort();
]
</surveypage>


Beyond that, the few snippets you posted do not provide enough information to say whether there are other, additional mistakes. There is zero info on how you invoke the disqualification page in the first place.

Hi Dave,

Thanks for getting back to me so quickly. I think you're right, there must be other mistakes because adding the semicolon didn't change anything either. I've provided my script below, would you mind taking a look and seeing if you can spot anything that might be causing this to happen? 

Thanks,
Caitlin

<radiobuttons age_eligibility>
/ caption = "Are you at least 18 years of age?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons colourblind_eligibility>
/ caption = "Are you colour-blind?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons English_eligibility>
/ caption = "Can you read and understand English?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons email_question1>
/ caption = "Do you wish to receive a summary of the results for this study?"
/ options = ("No")
/ other = "Yes. If yes, please leave your email address in the space below"
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons email_question2>
/ caption = "Would you like to be contacted about future research?"
/ options = ("No")
/ other = "Yes. If yes, please leave your email address in the space below"
/ required = true
/ orientation = vertical
</radiobuttons>

<textbox email>
/ caption = "If you ticked <b>yes</b> to either question above, please leave your email address here:"
/ mask = emailaddress
/ textboxsize = (40%, 5%)
/ required = false
</textbox>

<textbox age>
/ caption = "What is your age? Please state your age in <b>years</b>"
/ mask = positiveinteger
/ required = true
</textbox>

<radiobuttons sex>
/ caption = "What sex were you assigned at birth?"
/ options = ("Male", "Female", "Intersex,", "Not listed here", "I prefer not to answer this question")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons gender>
/ caption = "We recognise gender as a social construct and therefore your gender may or may not be the same as your answer above.
What is your current gender identity?"
/ options = ("Male", "Female", "Trans male", "Trans woman", "Agender", "Non-binary", "I prefer not to answer this question")
/ other = "My gender identity is not listed. I identify as:"
/ required = true
/ orientation = vertical
</radiobuttons>

<textbox education_years>
/ caption = "How many years of education have you completed?"
/ mask = positiveinteger
/ required = true
</textbox>

<radiobuttons education_level>
/ caption = "What is your highest form of education? If currently enrolled, please indicate your highest form of education received so far."
/ options = ("Primary school", "Secondary school (i.e., Year 12 or equivalent)", "Tertiary education (e.g., Trade qualification/Certificate/Diploma/Bachelor's degree)"
, "University higher degree (e.g., Masters, PhD)")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons occupation>
/ caption = "How would you best describe your current main activity/occupation?"
/ options = ("Unemployed", "Working - full time", "Working - part time/casual", "Unable to work (disability/work cover/carer)", "Student", "Home duties", "Retired")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons financial>
/ caption = "Which of the following statements best describes your current financial situation?"
/ options = ("Finding it difficult", "Getting by", "Living comfortably")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons city_rural>
/ caption = "How would you best describe where you live?"
/ options = ("Major city", "Medium to large rural town", "Small to medium rural town", "Remote community")
/ required = true
/ orientation = vertical
</radiobuttons>

<textbox country_live>
/ caption = "In what country do you live?"
/ mask = alphabetic
/ required = true
</textbox>

<textbox country_birth>
/ caption = "What was your country of birth?"
/ mask = alphabetic
/ required = true
</textbox>

<radiobuttons refugee>
/ caption = "Do you identify as being a refugee?"
/ options = ("No", "Yes", "I prefer not to answer this question")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons race_ethnicity>
/ caption = "Do you identify with an ethnic or racial group?"
/ options = ("No", "I prefer not to answer this question")
/ other = "Yes. If yes, please state what group you identify with:"
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons mental_health>
/ caption = "Have you previously been diagnosed with a mental health condition?"
/ options = ("No")
/ other = "Yes. If yes, please state all that apply:"
/ required = true
/ orientation = vertical
</radiobuttons>

<checkboxes neurological>
/ caption = "Have you previously been diagnosed with any of the following conditions? Please select all that apply:"
/ options = ("Stroke", "Traumatic brain injury", "Dementia or Alzheimer's disease", "None of the above")
/ required = true
/ orientation = vertical
</checkboxes>

<radiobuttons chronic_pain_question>
/ caption = "For the purposes of this study, we define chronic pain as pain experienced most days for 3 months or longer. According to this definition, do you currently have chronic pain?"
/ options = ("No", "Yes")
/ required = true
/ orientation = vertical
</radiobuttons>

<slider pain_intensity>
/ caption = "On a scale from 0 to 10, where 0 = no pain at all and 10 = worst pain imaginable how would you rate your average pain in the past week?"
/ fontstyle = ("Arial", 3.13%, false, false, false, false, 5, 1)
/ labels = ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
/ range = (0, 10)
/ increment = 1
/ slidersize = (50, 5)
/ required = true
</slider>

<textbox pain_duration>
/ caption = "How long have you been experiencing chronic pain? (Please state the number of <b>months</b>)"
/ mask = alphanumeric
/ required = true
</textbox>

<radiobuttons pain_location1>
/ caption = "Please select your <b>worst</b> area of pain"
/ options = ("Back", "Head", "Neck", "Hand or arm", "Foot or leg")
/ required = true
/ orientation = vertical
</radiobuttons>

<checkboxes pain_location2>
/ caption = "Please select any other areas of pain"
/ options = ("Back", "Head", "Neck", "Hand or arm", "Foot or leg")
/ required = true
/ orientation = vertical
</checkboxes>

<radiobuttons pain_diagnosis>
/ caption = "Have you recieved a diagnosis for your chronic pain?"
/ options = ("No")
/ other = "Yes. If yes, please specify:"
/ required = true
/ orientation = vertical
</radiobuttons>

*******************************************************************************************************************
*******************************************************************************************************************
    SURVEYPAGES
*******************************************************************************************************************
*******************************************************************************************************************

<surveypage age_eligibility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.age_eligibility.response=="No") surveypage.disqualificationpage]
/ questions = [1 = age_eligibility]
</surveypage>

<surveypage colourblind_eligibility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.colourblind_eligibility.response=="Yes") surveypage.disqualificationpage]
/ questions = [1 = colourblind_eligibility]
</surveypage>

<surveypage English_eligbility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.English_eligibility.response=="No") surveypage.disqualificationpage]
/ questions = [1 = English_eligibility]
</surveypage>

<surveypage Email>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = email_question1, email_question2, email]
</surveypage>

<surveypage Demographics1>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = age, sex]
</surveypage>

<surveypage Demographics2>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = gender]
</surveypage>

<surveypage Demographics3>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = education_years, education_level]
</surveypage>

<surveypage Demographics4>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = occupation]
</surveypage>

<surveypage Demographics5>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = financial, city_rural]
</surveypage>

<surveypage Demographics6>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = country_live, country_birth]
</surveypage>

<surveypage Demographics7>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = refugee, race_ethnicity]
</surveypage>

<surveypage Demographics8>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = mental_health, neurological]
</surveypage>

<surveypage Demographics9>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = chronic_pain_question]
/ branch = [if(radiobuttons.chronic_pain_question.response=="No") surveypage.end]
</surveypage>

<surveypage Demographics10>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_intensity]
</surveypage>

<surveypage Demographics11>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_duration]
</surveypage>

<surveypage Demographics12>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_location1, pain_location2]
</surveypage>

<surveypage Demographics13>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_diagnosis]
</surveypage>

<surveypage disqualificationpage>
/ caption = "Sorry, you are not eligible to participate in this study. Thank you for your interest."
/ ontrialend = [if(radiobuttons.age_eligibility.response=="No") || if(radiobuttons.colourblind_eligibility.response=="Yes") || if(radiobuttons.English_eligibility.response=="No") script.abort();
]
</surveypage>

<surveypage end>
/ caption = "Thank you for completing the survey. You will now begin the next section"
</surveypage>

*******************************************************************************************************************
*******************************************************************************************************************
    SURVEY
*******************************************************************************************************************
*******************************************************************************************************************
Notes:
- presents the surveypages

<survey Demographics>
/ pages = [
    1 = age_eligibility;
    2 = colourblind_eligibility;
    3 = English_eligbility;
    4 = Email;
    5 = Demographics1;
    6 = Demographics2;
    7 = Demographics3;
    8 = Demographics4;
    9 = Demographics5;
    10 = Demographics6;
    11 = Demographics7;
    12 = Demographics8;
    13 = Demographics9;
    14 = Demographics10;
    15 = Demographics11;
    16 = Demographics12;
    17 = Demographics13;
    18 = disqualificationpage;
    19 = end]

> because adding the semicolon didn't change anything either.

The relevant change isn't the semicolon. It's the syntax in your if() condition that is broken, so please go back and review the fixed code in my previous response again.

That said, there is another issue:

<survey Demographics>
/ pages = [
  1 = age_eligibility;
  2 = colourblind_eligibility;
  3 = English_eligbility;
  4 = Email;
  5 = Demographics1;
  6 = Demographics2;
  7 = Demographics3;
  8 = Demographics4;
  9 = Demographics5;
  10 = Demographics6;
  11 = Demographics7;
  12 = Demographics8;
  13 = Demographics9;
  14 = Demographics10;
  15 = Demographics11;
  16 = Demographics12;
  17 = Demographics13;
  18 = disqualificationpage;
  19 = end]
</survey>

The disqualification page does not belong there. You invoke it dynamically via /branch from the various eligibility pages.

<surveypage age_eligibility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.age_eligibility.response=="No") surveypage.disqualificationpage]
/ questions = [1 = age_eligibility]
</surveypage>

<surveypage colourblind_eligibility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.colourblind_eligibility.response=="Yes") surveypage.disqualificationpage]
/ questions = [1 = colourblind_eligibility]
</surveypage>

<surveypage English_eligbility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.English_eligibility.response=="No") surveypage.disqualificationpage]
/ questions = [1 = English_eligibility]
</surveypage>

It makes absolutely no sense to also run the page unconditionally via your survey's /pages and thus show it to all participants, whether they're eligible or not.

Hi Dave,

Thank you very much for your help with this! Apologies for not picking up on the if() problem - these kind of errors are not always easy to spot.
Also, in regards to the survey page issue, I was working under the assumption that all survey pages had to also be included in the pages section too, but this clearly is not the case. I'll have to remember that anything conditional (i.e., when using /branch) does not belong in the pages section.

Thanks again,
Caitlin
By Dave - 10/26/2021

caithow - 10/26/2021
Dave - 10/26/2021
caithow - 10/26/2021
Dave - 10/26/2021
caithow - 10/26/2021
Hi there, 
I'm having a bit of trouble with the disqualification page of my survey. I have a few screening/eligibility questions where participants must respond a certain way in order to be eligible for the study (see first 3 questions). The survey works perfectly, except for the part at the end where I only want participants to see the disqualification page if they are ineligible for participation. At the moment, however, the disqualification page is presenting itself between the final question in the survey (survey page Demographics13 - pain diagnosis) and the end page. Basically, I do not want the disqualification page to present itself when participants have already been screened as being eligible. I have tried using the skip and branch functions to get around this issue but I still can't seem to put my finger on what I need to do to fix this problem. I also tried re-writing out the script because I thought there might have been a bug interfering with the presentation order, but this didn't seem to make any difference.

I'd be very appreciate of any insights into what might be causing this problem.
Thanks,
Caitlin

<radiobuttons age_eligibility>
/ caption = "Are you at least 18 years of age?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons colourblind_eligibility>
/ caption = "Are you colour-blind?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons English_eligibility>
/ caption = "Can you read and understand English?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>
***************************************************************************************************
<surveypage Demographics13>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_diagnosis]
</surveypage>

<surveypage disqualificationpage>
/ caption = "Sorry, you are not eligible to participate in this study. Thank you for your interest."
/ ontrialend = [if(radiobuttons.age_eligibility.response=="No" || radiobuttons.colourblind_eligibility.response=="Yes" || radiobuttons.English_eligibility.response=="No")
        script.abort();
]
</surveypage>


<surveypage end>
/ caption = "Thank you for completing the survey. You will now begin the next section"
</surveypage>


> / ontrialend = [if(radiobuttons.age_eligibility.response=="No") || if(radiobuttons.colourblind_eligibility.response=="Yes") || if(radiobuttons.English_eligibility.response=="No") script.abort()]

This syntax is off. Formulated correctly:

<surveypage disqualificationpage>
/ caption = "Sorry, you are not eligible to participate in this study. Thank you for your interest."
/ ontrialend = [if(radiobuttons.age_eligibility.response=="No" || radiobuttons.colourblind_eligibility.response=="Yes" || radiobuttons.English_eligibility.response=="No")
    script.abort();
]
</surveypage>


Beyond that, the few snippets you posted do not provide enough information to say whether there are other, additional mistakes. There is zero info on how you invoke the disqualification page in the first place.

Hi Dave,

Thanks for getting back to me so quickly. I think you're right, there must be other mistakes because adding the semicolon didn't change anything either. I've provided my script below, would you mind taking a look and seeing if you can spot anything that might be causing this to happen? 

Thanks,
Caitlin

<radiobuttons age_eligibility>
/ caption = "Are you at least 18 years of age?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons colourblind_eligibility>
/ caption = "Are you colour-blind?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons English_eligibility>
/ caption = "Can you read and understand English?"
/ options = ("Yes", "No")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons email_question1>
/ caption = "Do you wish to receive a summary of the results for this study?"
/ options = ("No")
/ other = "Yes. If yes, please leave your email address in the space below"
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons email_question2>
/ caption = "Would you like to be contacted about future research?"
/ options = ("No")
/ other = "Yes. If yes, please leave your email address in the space below"
/ required = true
/ orientation = vertical
</radiobuttons>

<textbox email>
/ caption = "If you ticked <b>yes</b> to either question above, please leave your email address here:"
/ mask = emailaddress
/ textboxsize = (40%, 5%)
/ required = false
</textbox>

<textbox age>
/ caption = "What is your age? Please state your age in <b>years</b>"
/ mask = positiveinteger
/ required = true
</textbox>

<radiobuttons sex>
/ caption = "What sex were you assigned at birth?"
/ options = ("Male", "Female", "Intersex,", "Not listed here", "I prefer not to answer this question")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons gender>
/ caption = "We recognise gender as a social construct and therefore your gender may or may not be the same as your answer above.
What is your current gender identity?"
/ options = ("Male", "Female", "Trans male", "Trans woman", "Agender", "Non-binary", "I prefer not to answer this question")
/ other = "My gender identity is not listed. I identify as:"
/ required = true
/ orientation = vertical
</radiobuttons>

<textbox education_years>
/ caption = "How many years of education have you completed?"
/ mask = positiveinteger
/ required = true
</textbox>

<radiobuttons education_level>
/ caption = "What is your highest form of education? If currently enrolled, please indicate your highest form of education received so far."
/ options = ("Primary school", "Secondary school (i.e., Year 12 or equivalent)", "Tertiary education (e.g., Trade qualification/Certificate/Diploma/Bachelor's degree)"
, "University higher degree (e.g., Masters, PhD)")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons occupation>
/ caption = "How would you best describe your current main activity/occupation?"
/ options = ("Unemployed", "Working - full time", "Working - part time/casual", "Unable to work (disability/work cover/carer)", "Student", "Home duties", "Retired")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons financial>
/ caption = "Which of the following statements best describes your current financial situation?"
/ options = ("Finding it difficult", "Getting by", "Living comfortably")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons city_rural>
/ caption = "How would you best describe where you live?"
/ options = ("Major city", "Medium to large rural town", "Small to medium rural town", "Remote community")
/ required = true
/ orientation = vertical
</radiobuttons>

<textbox country_live>
/ caption = "In what country do you live?"
/ mask = alphabetic
/ required = true
</textbox>

<textbox country_birth>
/ caption = "What was your country of birth?"
/ mask = alphabetic
/ required = true
</textbox>

<radiobuttons refugee>
/ caption = "Do you identify as being a refugee?"
/ options = ("No", "Yes", "I prefer not to answer this question")
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons race_ethnicity>
/ caption = "Do you identify with an ethnic or racial group?"
/ options = ("No", "I prefer not to answer this question")
/ other = "Yes. If yes, please state what group you identify with:"
/ required = true
/ orientation = vertical
</radiobuttons>

<radiobuttons mental_health>
/ caption = "Have you previously been diagnosed with a mental health condition?"
/ options = ("No")
/ other = "Yes. If yes, please state all that apply:"
/ required = true
/ orientation = vertical
</radiobuttons>

<checkboxes neurological>
/ caption = "Have you previously been diagnosed with any of the following conditions? Please select all that apply:"
/ options = ("Stroke", "Traumatic brain injury", "Dementia or Alzheimer's disease", "None of the above")
/ required = true
/ orientation = vertical
</checkboxes>

<radiobuttons chronic_pain_question>
/ caption = "For the purposes of this study, we define chronic pain as pain experienced most days for 3 months or longer. According to this definition, do you currently have chronic pain?"
/ options = ("No", "Yes")
/ required = true
/ orientation = vertical
</radiobuttons>

<slider pain_intensity>
/ caption = "On a scale from 0 to 10, where 0 = no pain at all and 10 = worst pain imaginable how would you rate your average pain in the past week?"
/ fontstyle = ("Arial", 3.13%, false, false, false, false, 5, 1)
/ labels = ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
/ range = (0, 10)
/ increment = 1
/ slidersize = (50, 5)
/ required = true
</slider>

<textbox pain_duration>
/ caption = "How long have you been experiencing chronic pain? (Please state the number of <b>months</b>)"
/ mask = alphanumeric
/ required = true
</textbox>

<radiobuttons pain_location1>
/ caption = "Please select your <b>worst</b> area of pain"
/ options = ("Back", "Head", "Neck", "Hand or arm", "Foot or leg")
/ required = true
/ orientation = vertical
</radiobuttons>

<checkboxes pain_location2>
/ caption = "Please select any other areas of pain"
/ options = ("Back", "Head", "Neck", "Hand or arm", "Foot or leg")
/ required = true
/ orientation = vertical
</checkboxes>

<radiobuttons pain_diagnosis>
/ caption = "Have you recieved a diagnosis for your chronic pain?"
/ options = ("No")
/ other = "Yes. If yes, please specify:"
/ required = true
/ orientation = vertical
</radiobuttons>

*******************************************************************************************************************
*******************************************************************************************************************
    SURVEYPAGES
*******************************************************************************************************************
*******************************************************************************************************************

<surveypage age_eligibility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.age_eligibility.response=="No") surveypage.disqualificationpage]
/ questions = [1 = age_eligibility]
</surveypage>

<surveypage colourblind_eligibility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.colourblind_eligibility.response=="Yes") surveypage.disqualificationpage]
/ questions = [1 = colourblind_eligibility]
</surveypage>

<surveypage English_eligbility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.English_eligibility.response=="No") surveypage.disqualificationpage]
/ questions = [1 = English_eligibility]
</surveypage>

<surveypage Email>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = email_question1, email_question2, email]
</surveypage>

<surveypage Demographics1>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = age, sex]
</surveypage>

<surveypage Demographics2>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = gender]
</surveypage>

<surveypage Demographics3>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = education_years, education_level]
</surveypage>

<surveypage Demographics4>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = occupation]
</surveypage>

<surveypage Demographics5>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = financial, city_rural]
</surveypage>

<surveypage Demographics6>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = country_live, country_birth]
</surveypage>

<surveypage Demographics7>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = refugee, race_ethnicity]
</surveypage>

<surveypage Demographics8>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = mental_health, neurological]
</surveypage>

<surveypage Demographics9>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ questions = [1 = chronic_pain_question]
/ branch = [if(radiobuttons.chronic_pain_question.response=="No") surveypage.end]
</surveypage>

<surveypage Demographics10>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_intensity]
</surveypage>

<surveypage Demographics11>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_duration]
</surveypage>

<surveypage Demographics12>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_location1, pain_location2]
</surveypage>

<surveypage Demographics13>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ skip = [radiobuttons.chronic_pain_question.response=="No"]
/ questions = [1 = pain_diagnosis]
</surveypage>

<surveypage disqualificationpage>
/ caption = "Sorry, you are not eligible to participate in this study. Thank you for your interest."
/ ontrialend = [if(radiobuttons.age_eligibility.response=="No") || if(radiobuttons.colourblind_eligibility.response=="Yes") || if(radiobuttons.English_eligibility.response=="No") script.abort();
]
</surveypage>

<surveypage end>
/ caption = "Thank you for completing the survey. You will now begin the next section"
</surveypage>

*******************************************************************************************************************
*******************************************************************************************************************
    SURVEY
*******************************************************************************************************************
*******************************************************************************************************************
Notes:
- presents the surveypages

<survey Demographics>
/ pages = [
    1 = age_eligibility;
    2 = colourblind_eligibility;
    3 = English_eligbility;
    4 = Email;
    5 = Demographics1;
    6 = Demographics2;
    7 = Demographics3;
    8 = Demographics4;
    9 = Demographics5;
    10 = Demographics6;
    11 = Demographics7;
    12 = Demographics8;
    13 = Demographics9;
    14 = Demographics10;
    15 = Demographics11;
    16 = Demographics12;
    17 = Demographics13;
    18 = disqualificationpage;
    19 = end]

> because adding the semicolon didn't change anything either.

The relevant change isn't the semicolon. It's the syntax in your if() condition that is broken, so please go back and review the fixed code in my previous response again.

That said, there is another issue:

<survey Demographics>
/ pages = [
  1 = age_eligibility;
  2 = colourblind_eligibility;
  3 = English_eligbility;
  4 = Email;
  5 = Demographics1;
  6 = Demographics2;
  7 = Demographics3;
  8 = Demographics4;
  9 = Demographics5;
  10 = Demographics6;
  11 = Demographics7;
  12 = Demographics8;
  13 = Demographics9;
  14 = Demographics10;
  15 = Demographics11;
  16 = Demographics12;
  17 = Demographics13;
  18 = disqualificationpage;
  19 = end]
</survey>

The disqualification page does not belong there. You invoke it dynamically via /branch from the various eligibility pages.

<surveypage age_eligibility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.age_eligibility.response=="No") surveypage.disqualificationpage]
/ questions = [1 = age_eligibility]
</surveypage>

<surveypage colourblind_eligibility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.colourblind_eligibility.response=="Yes") surveypage.disqualificationpage]
/ questions = [1 = colourblind_eligibility]
</surveypage>

<surveypage English_eligbility>
/ caption = "<%parameters.demographicpageinstructions%>"
/ subcaption = "<%parameters.quitinstructions%>"
/ branch = [if(radiobuttons.English_eligibility.response=="No") surveypage.disqualificationpage]
/ questions = [1 = English_eligibility]
</surveypage>

It makes absolutely no sense to also run the page unconditionally via your survey's /pages and thus show it to all participants, whether they're eligible or not.

Hi Dave,

Thank you very much for your help with this! Apologies for not picking up on the if() problem - these kind of errors are not always easy to spot.
Also, in regards to the survey page issue, I was working under the assumption that all survey pages had to also be included in the pages section too, but this clearly is not the case. I'll have to remember that anything conditional (i.e., when using /branch) does not belong in the pages section.

Thanks again,
Caitlin

You can refer back to https://www.millisecond.com/forums/FindPost32309.aspx for the difference between /branch and /skip.