Millisecond Forums

Branching for demographics survey

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

By caithow - 10/11/2021

Hello, 

Apologies in advance, but I'm new to Inquisit. For my study we are collecting information from healthy controls and people with chronic pain. For the demographics questionnaire, all participants are exposed to the same questions except when they are asked about chronic pain. Anyone who identifies as having chronic pain will be asked additional questions about their pain; however, I want to use branching so that HCs do not see these questions. This is what I have so far but I can't quite figure out I need to add anything else or how I format my questions after this section of code...

Does anyone know how to fix this? Everything I have tried just gives me an error code, or does not display some of my questions altogether.

<surveypage Demographics7>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = chronic_pain_question]
/ branch = [if (radiobuttons.chronic_pain_question=="Yes") surveypage.Demographics8]
</surveypage>


Thanks in advance,
Caitlin


By Dave - 10/11/2021

caithow - 10/12/2021
Hello, 

Apologies in advance, but I'm new to Inquisit. For my study we are collecting information from healthy controls and people with chronic pain. For the demographics questionnaire, all participants are exposed to the same questions except when they are asked about chronic pain. Anyone who identifies as having chronic pain will be asked additional questions about their pain; however, I want to use branching so that HCs do not see these questions. This is what I have so far but I can't quite figure out I need to add anything else or how I format my questions after this section of code...

Does anyone know how to fix this? Everything I have tried just gives me an error code, or does not display some of my questions altogether.

<surveypage Demographics7>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = chronic_pain_question]
/ branch = [if (radiobuttons.chronic_pain_question=="Yes") surveypage.Demographics8]
</surveypage>


Thanks in advance,
Caitlin



This almost certainly needs to read:

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

You can generally refer to https://www.millisecond.com/forums/FindPost5461.aspx as example.
By caithow - 10/11/2021

Dave - 10/12/2021
caithow - 10/12/2021
Hello, 

Apologies in advance, but I'm new to Inquisit. For my study we are collecting information from healthy controls and people with chronic pain. For the demographics questionnaire, all participants are exposed to the same questions except when they are asked about chronic pain. Anyone who identifies as having chronic pain will be asked additional questions about their pain; however, I want to use branching so that HCs do not see these questions. This is what I have so far but I can't quite figure out I need to add anything else or how I format my questions after this section of code...

Does anyone know how to fix this? Everything I have tried just gives me an error code, or does not display some of my questions altogether.

<surveypage Demographics7>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = chronic_pain_question]
/ branch = [if (radiobuttons.chronic_pain_question=="Yes") surveypage.Demographics8]
</surveypage>


Thanks in advance,
Caitlin



This almost certainly needs to read:

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

Hi Dave,

Thank you very much for the prompt reply to this matter. I have now amended the code accordingly. However, I am still running into problems. The script is still allowing HCs to answer pain related questions. 

The bolded section is what I have entered into my "Questions" section and the non-bold section is what I have entered into my "Survey pages" section. I have started at the point where I need it to branch off because everything else runs perfectly up until this point. Would you mind taking a look through and seeing if you can identify what I might be doing wrong?

Best,
Caitlin

<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 = worse 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 years/months)"
/ mask = alphanumeric
/ required = true
</textbox>

<textbox pain_location>
/ caption = "Which area do you consider to be the main location of your pain?"
/ mask = alphabetic
/ required = true
</textbox>

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



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

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

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

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

<surveypage Demographics11>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = pain_diagnosis]
</surveypage>
By Dave - 10/11/2021

caithow - 10/12/2021
Dave - 10/12/2021
caithow - 10/12/2021
Hello, 

Apologies in advance, but I'm new to Inquisit. For my study we are collecting information from healthy controls and people with chronic pain. For the demographics questionnaire, all participants are exposed to the same questions except when they are asked about chronic pain. Anyone who identifies as having chronic pain will be asked additional questions about their pain; however, I want to use branching so that HCs do not see these questions. This is what I have so far but I can't quite figure out I need to add anything else or how I format my questions after this section of code...

Does anyone know how to fix this? Everything I have tried just gives me an error code, or does not display some of my questions altogether.

<surveypage Demographics7>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = chronic_pain_question]
/ branch = [if (radiobuttons.chronic_pain_question=="Yes") surveypage.Demographics8]
</surveypage>


Thanks in advance,
Caitlin



This almost certainly needs to read:

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

Hi Dave,

Thank you very much for the prompt reply to this matter. I have now amended the code accordingly. However, I am still running into problems. The script is still allowing HCs to answer pain related questions. 

The bolded section is what I have entered into my "Questions" section and the non-bold section is what I have entered into my "Survey pages" section. I have started at the point where I need it to branch off because everything else runs perfectly up until this point. Would you mind taking a look through and seeing if you can identify what I might be doing wrong?

Best,
Caitlin

<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 = worse 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 years/months)"
/ mask = alphanumeric
/ required = true
</textbox>

<textbox pain_location>
/ caption = "Which area do you consider to be the main location of your pain?"
/ mask = alphabetic
/ required = true
</textbox>

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



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

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

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

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

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

You have to ask yourself how you are invoking those pages. If you want to branch to them, you may not have them in your survey element's /pages (or your block's /trials). But then you must of course branch from surveypage demographics8 to page demographics9, from page demographics9 to demographics10 and so forth.

Otherwise use /skip, not /branch, as shown in the example I referred you to.
By Dave - 10/11/2021

Dave - 10/12/2021
caithow - 10/12/2021
Dave - 10/12/2021
caithow - 10/12/2021
Hello, 

Apologies in advance, but I'm new to Inquisit. For my study we are collecting information from healthy controls and people with chronic pain. For the demographics questionnaire, all participants are exposed to the same questions except when they are asked about chronic pain. Anyone who identifies as having chronic pain will be asked additional questions about their pain; however, I want to use branching so that HCs do not see these questions. This is what I have so far but I can't quite figure out I need to add anything else or how I format my questions after this section of code...

Does anyone know how to fix this? Everything I have tried just gives me an error code, or does not display some of my questions altogether.

<surveypage Demographics7>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = chronic_pain_question]
/ branch = [if (radiobuttons.chronic_pain_question=="Yes") surveypage.Demographics8]
</surveypage>


Thanks in advance,
Caitlin



This almost certainly needs to read:

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

Hi Dave,

Thank you very much for the prompt reply to this matter. I have now amended the code accordingly. However, I am still running into problems. The script is still allowing HCs to answer pain related questions. 

The bolded section is what I have entered into my "Questions" section and the non-bold section is what I have entered into my "Survey pages" section. I have started at the point where I need it to branch off because everything else runs perfectly up until this point. Would you mind taking a look through and seeing if you can identify what I might be doing wrong?

Best,
Caitlin

<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 = worse 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 years/months)"
/ mask = alphanumeric
/ required = true
</textbox>

<textbox pain_location>
/ caption = "Which area do you consider to be the main location of your pain?"
/ mask = alphabetic
/ required = true
</textbox>

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



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

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

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

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

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

You have to ask yourself how you are invoking those pages. If you want to branch to them, you may not have them in your survey element's /pages (or your block's /trials). But then you must of course branch from surveypage demographics8 to page demographics9, from page demographics9 to demographics10 and so forth.

Otherwise use /skip, not /branch, as shown in the example I referred you to.

Here are two longer examples. The /branch option:

<survey mysurvey>
/ pages = [1=pg1; 2=end]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>

<surveypage pg1>
/ questions = [1=q1]
/ branch = [
    if (radiobuttons.q1.response == "yes") surveypage.pg2;
]
</surveypage>

<surveypage pg2>
/ caption = "You only get to see page 2 because you selected yes."
/ branch = [
    surveypage.pg3;
]
</surveypage>

<surveypage pg3>
/ caption = "You only get to see page 3 because you selected yes."
/ branch = [
    surveypage.pg4;
]
</surveypage>

<surveypage pg4>
/ caption = "You only get to see page 4 because you selected yes."
</surveypage>

<surveypage end>
/ caption = "Everybody gets to see this page. It's the end."
</surveypage>

<radiobuttons q1>
/ caption = "Do you want to see extra pages?"
/ options = ("yes", "no")
</radiobuttons>


Pay attention to what is and isn't in the <survey>'s /pages.

The same thing, but with /skip:

<survey mysurvey>
/ pages = [1=pg1; 2=pg2; 3=pg3; 4=pg4; 5=end]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>

<surveypage pg1>
/ questions = [1=q1]
</surveypage>

<surveypage pg2>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 2 because you selected yes."
</surveypage>

<surveypage pg3>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 3 because you selected yes."
</surveypage>

<surveypage pg4>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 4 because you selected yes."
</surveypage>

<surveypage end>
/ caption = "Everybody gets to see this page. It's the end."
</surveypage>

<radiobuttons q1>
/ caption = "Do you want to see extra pages?"
/ options = ("yes", "no")
</radiobuttons>
By caithow - 10/11/2021

Dave - 10/12/2021
Dave - 10/12/2021
caithow - 10/12/2021
Dave - 10/12/2021
caithow - 10/12/2021
Hello, 

Apologies in advance, but I'm new to Inquisit. For my study we are collecting information from healthy controls and people with chronic pain. For the demographics questionnaire, all participants are exposed to the same questions except when they are asked about chronic pain. Anyone who identifies as having chronic pain will be asked additional questions about their pain; however, I want to use branching so that HCs do not see these questions. This is what I have so far but I can't quite figure out I need to add anything else or how I format my questions after this section of code...

Does anyone know how to fix this? Everything I have tried just gives me an error code, or does not display some of my questions altogether.

<surveypage Demographics7>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = chronic_pain_question]
/ branch = [if (radiobuttons.chronic_pain_question=="Yes") surveypage.Demographics8]
</surveypage>


Thanks in advance,
Caitlin



This almost certainly needs to read:

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

Hi Dave,

Thank you very much for the prompt reply to this matter. I have now amended the code accordingly. However, I am still running into problems. The script is still allowing HCs to answer pain related questions. 

The bolded section is what I have entered into my "Questions" section and the non-bold section is what I have entered into my "Survey pages" section. I have started at the point where I need it to branch off because everything else runs perfectly up until this point. Would you mind taking a look through and seeing if you can identify what I might be doing wrong?

Best,
Caitlin

<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 = worse 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 years/months)"
/ mask = alphanumeric
/ required = true
</textbox>

<textbox pain_location>
/ caption = "Which area do you consider to be the main location of your pain?"
/ mask = alphabetic
/ required = true
</textbox>

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



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

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

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

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

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

You have to ask yourself how you are invoking those pages. If you want to branch to them, you may not have them in your survey element's /pages (or your block's /trials). But then you must of course branch from surveypage demographics8 to page demographics9, from page demographics9 to demographics10 and so forth.

Otherwise use /skip, not /branch, as shown in the example I referred you to.

Here are two longer examples. The /branch option:

<survey mysurvey>
/ pages = [1=pg1; 2=end]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>

<surveypage pg1>
/ questions = [1=q1]
/ branch = [
    if (radiobuttons.q1.response == "yes") surveypage.pg2;
]
</surveypage>

<surveypage pg2>
/ caption = "You only get to see page 2 because you selected yes."
/ branch = [
    surveypage.pg3;
]
</surveypage>

<surveypage pg3>
/ caption = "You only get to see page 3 because you selected yes."
/ branch = [
    surveypage.pg4;
]
</surveypage>

<surveypage pg4>
/ caption = "You only get to see page 4 because you selected yes."
</surveypage>

<surveypage end>
/ caption = "Everybody gets to see this page. It's the end."
</surveypage>

<radiobuttons q1>
/ caption = "Do you want to see extra pages?"
/ options = ("yes", "no")
</radiobuttons>


Pay attention to what is and isn't in the <survey>'s /pages.

The same thing, but with /skip:

<survey mysurvey>
/ pages = [1=pg1; 2=pg2; 3=pg3; 4=pg4; 5=end]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>

<surveypage pg1>
/ questions = [1=q1]
</surveypage>

<surveypage pg2>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 2 because you selected yes."
</surveypage>

<surveypage pg3>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 3 because you selected yes."
</surveypage>

<surveypage pg4>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 4 because you selected yes."
</surveypage>

<surveypage end>
/ caption = "Everybody gets to see this page. It's the end."
</surveypage>

<radiobuttons q1>
/ caption = "Do you want to see extra pages?"
/ options = ("yes", "no")
</radiobuttons>

Thanks very much Dave - after staring at the code for a little while it finally clicked. I didn't realise at first that the code was written for different sections.

I do have a few more questions that I'm hoping you might be able to help with. 

1. I'm wanting to add in four additional questions (before the demographic survey) that 'screen' participants to ensure they meet the eligibility criteria for our study. Therefore, I need participants who give a response that would deem them ineligible (i.e., below 18 years of age) to be discontinued from completing the survey altogether. Ideally, it would be great if those participants are redirected to a page that informs them that they are ineligible for participation. Is there a way to do this? 

2. I'm planning on purchasing a license for the Web version of Inquisit, and many of the tests that I want to use already have scripts that I can just upload in their current form. However, I need some participants to receive one survey order (i.e., eligibility questions, demographics, WCST, BDI and CFI) and others to receive the other order (i.e., eligibility questions, demographics, CFI, BDI and WCST). I know that I need to create a batch script, but I'm not entirely sure how to pull off counterbalancing the order of the tests that participants receive. Are there any examples that you can refer me to?

3. At the end of the last test (either WCST or CFI) I need to redirect participants to a page that allows them to provide their email address if they wish. What would be the easiest way to do this since I'm intending on having the test order change across participants? 

Thanks very much for your help!

Thanks,
Caitlin

By Dave - 10/12/2021

caithow - 10/12/2021
Dave - 10/12/2021
Dave - 10/12/2021
caithow - 10/12/2021
Dave - 10/12/2021
caithow - 10/12/2021
Hello, 

Apologies in advance, but I'm new to Inquisit. For my study we are collecting information from healthy controls and people with chronic pain. For the demographics questionnaire, all participants are exposed to the same questions except when they are asked about chronic pain. Anyone who identifies as having chronic pain will be asked additional questions about their pain; however, I want to use branching so that HCs do not see these questions. This is what I have so far but I can't quite figure out I need to add anything else or how I format my questions after this section of code...

Does anyone know how to fix this? Everything I have tried just gives me an error code, or does not display some of my questions altogether.

<surveypage Demographics7>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = chronic_pain_question]
/ branch = [if (radiobuttons.chronic_pain_question=="Yes") surveypage.Demographics8]
</surveypage>


Thanks in advance,
Caitlin



This almost certainly needs to read:

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

Hi Dave,

Thank you very much for the prompt reply to this matter. I have now amended the code accordingly. However, I am still running into problems. The script is still allowing HCs to answer pain related questions. 

The bolded section is what I have entered into my "Questions" section and the non-bold section is what I have entered into my "Survey pages" section. I have started at the point where I need it to branch off because everything else runs perfectly up until this point. Would you mind taking a look through and seeing if you can identify what I might be doing wrong?

Best,
Caitlin

<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 = worse 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 years/months)"
/ mask = alphanumeric
/ required = true
</textbox>

<textbox pain_location>
/ caption = "Which area do you consider to be the main location of your pain?"
/ mask = alphabetic
/ required = true
</textbox>

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



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

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

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

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

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

You have to ask yourself how you are invoking those pages. If you want to branch to them, you may not have them in your survey element's /pages (or your block's /trials). But then you must of course branch from surveypage demographics8 to page demographics9, from page demographics9 to demographics10 and so forth.

Otherwise use /skip, not /branch, as shown in the example I referred you to.

Here are two longer examples. The /branch option:

<survey mysurvey>
/ pages = [1=pg1; 2=end]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>

<surveypage pg1>
/ questions = [1=q1]
/ branch = [
    if (radiobuttons.q1.response == "yes") surveypage.pg2;
]
</surveypage>

<surveypage pg2>
/ caption = "You only get to see page 2 because you selected yes."
/ branch = [
    surveypage.pg3;
]
</surveypage>

<surveypage pg3>
/ caption = "You only get to see page 3 because you selected yes."
/ branch = [
    surveypage.pg4;
]
</surveypage>

<surveypage pg4>
/ caption = "You only get to see page 4 because you selected yes."
</surveypage>

<surveypage end>
/ caption = "Everybody gets to see this page. It's the end."
</surveypage>

<radiobuttons q1>
/ caption = "Do you want to see extra pages?"
/ options = ("yes", "no")
</radiobuttons>


Pay attention to what is and isn't in the <survey>'s /pages.

The same thing, but with /skip:

<survey mysurvey>
/ pages = [1=pg1; 2=pg2; 3=pg3; 4=pg4; 5=end]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>

<surveypage pg1>
/ questions = [1=q1]
</surveypage>

<surveypage pg2>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 2 because you selected yes."
</surveypage>

<surveypage pg3>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 3 because you selected yes."
</surveypage>

<surveypage pg4>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 4 because you selected yes."
</surveypage>

<surveypage end>
/ caption = "Everybody gets to see this page. It's the end."
</surveypage>

<radiobuttons q1>
/ caption = "Do you want to see extra pages?"
/ options = ("yes", "no")
</radiobuttons>

Thanks very much Dave - after staring at the code for a little while it finally clicked. I didn't realise at first that the code was written for different sections.

I do have a few more questions that I'm hoping you might be able to help with. 

1. I'm wanting to add in four additional questions (before the demographic survey) that 'screen' participants to ensure they meet the eligibility criteria for our study. Therefore, I need participants who give a response that would deem them ineligible (i.e., below 18 years of age) to be discontinued from completing the survey altogether. Ideally, it would be great if those participants are redirected to a page that informs them that they are ineligible for participation. Is there a way to do this? 

2. I'm planning on purchasing a license for the Web version of Inquisit, and many of the tests that I want to use already have scripts that I can just upload in their current form. However, I need some participants to receive one survey order (i.e., eligibility questions, demographics, WCST, BDI and CFI) and others to receive the other order (i.e., eligibility questions, demographics, CFI, BDI and WCST). I know that I need to create a batch script, but I'm not entirely sure how to pull off counterbalancing the order of the tests that participants receive. Are there any examples that you can refer me to?

3. At the end of the last test (either WCST or CFI) I need to redirect participants to a page that allows them to provide their email address if they wish. What would be the easiest way to do this since I'm intending on having the test order change across participants? 

Thanks very much for your help!

Thanks,
Caitlin


> 1. I'm wanting to add in four additional questions (before the demographic survey) that 'screen' participants to ensure they meet the eligibility criteria for our study. Therefore, I need participants who give a response that would deem them ineligible (i.e., below 18 years of age) to be discontinued from completing the survey altogether. Ideally, it would be great if those participants are redirected to a page that informs them that they are ineligible for participation. Is there a way to do this?

If eligibility is not met, /branch to a surveypage that informs participants accordingly. In that surveypage, call script.abort() /ontrialend.

https://www.millisecond.com/support/docs/v6/html/language/functions/abort.htm

> 2. I'm planning on purchasing a license for the Web version of Inquisit, and many of the tests that I want to use already have scripts that I can just upload in their current form. However, I need some participants to receive one survey order (i.e., eligibility questions, demographics, WCST, BDI and CFI) and others to receive the other order (i.e., eligibility questions, demographics, CFI, BDI and WCST). I know that I need to create a batch script, but I'm not entirely sure how to pull off counterbalancing the order of the tests that participants receive. Are there any examples that you can refer me to?

This is covered in the documentation for the batch element: https://www.millisecond.com/support/docs/v6/html/articles/batchscripts.htm under "Between-Subject Manipulations Using Batch Elements" -- you want two different orders between subjects.

> 3. At the end of the last test (either WCST or CFI) I need to redirect participants to a page that allows them to provide their email address if they wish. What would be the easiest way to do this since I'm intending on having the test order change across participants?

You can specify a URL to redirect to in the web experiment settings.
By caithow - 10/12/2021

Dave - 10/12/2021
caithow - 10/12/2021
Dave - 10/12/2021
Dave - 10/12/2021
caithow - 10/12/2021
Dave - 10/12/2021
caithow - 10/12/2021
Hello, 

Apologies in advance, but I'm new to Inquisit. For my study we are collecting information from healthy controls and people with chronic pain. For the demographics questionnaire, all participants are exposed to the same questions except when they are asked about chronic pain. Anyone who identifies as having chronic pain will be asked additional questions about their pain; however, I want to use branching so that HCs do not see these questions. This is what I have so far but I can't quite figure out I need to add anything else or how I format my questions after this section of code...

Does anyone know how to fix this? Everything I have tried just gives me an error code, or does not display some of my questions altogether.

<surveypage Demographics7>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = chronic_pain_question]
/ branch = [if (radiobuttons.chronic_pain_question=="Yes") surveypage.Demographics8]
</surveypage>


Thanks in advance,
Caitlin



This almost certainly needs to read:

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

Hi Dave,

Thank you very much for the prompt reply to this matter. I have now amended the code accordingly. However, I am still running into problems. The script is still allowing HCs to answer pain related questions. 

The bolded section is what I have entered into my "Questions" section and the non-bold section is what I have entered into my "Survey pages" section. I have started at the point where I need it to branch off because everything else runs perfectly up until this point. Would you mind taking a look through and seeing if you can identify what I might be doing wrong?

Best,
Caitlin

<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 = worse 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 years/months)"
/ mask = alphanumeric
/ required = true
</textbox>

<textbox pain_location>
/ caption = "Which area do you consider to be the main location of your pain?"
/ mask = alphabetic
/ required = true
</textbox>

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



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

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

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

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

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

You have to ask yourself how you are invoking those pages. If you want to branch to them, you may not have them in your survey element's /pages (or your block's /trials). But then you must of course branch from surveypage demographics8 to page demographics9, from page demographics9 to demographics10 and so forth.

Otherwise use /skip, not /branch, as shown in the example I referred you to.

Here are two longer examples. The /branch option:

<survey mysurvey>
/ pages = [1=pg1; 2=end]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>

<surveypage pg1>
/ questions = [1=q1]
/ branch = [
    if (radiobuttons.q1.response == "yes") surveypage.pg2;
]
</surveypage>

<surveypage pg2>
/ caption = "You only get to see page 2 because you selected yes."
/ branch = [
    surveypage.pg3;
]
</surveypage>

<surveypage pg3>
/ caption = "You only get to see page 3 because you selected yes."
/ branch = [
    surveypage.pg4;
]
</surveypage>

<surveypage pg4>
/ caption = "You only get to see page 4 because you selected yes."
</surveypage>

<surveypage end>
/ caption = "Everybody gets to see this page. It's the end."
</surveypage>

<radiobuttons q1>
/ caption = "Do you want to see extra pages?"
/ options = ("yes", "no")
</radiobuttons>


Pay attention to what is and isn't in the <survey>'s /pages.

The same thing, but with /skip:

<survey mysurvey>
/ pages = [1=pg1; 2=pg2; 3=pg3; 4=pg4; 5=end]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>

<surveypage pg1>
/ questions = [1=q1]
</surveypage>

<surveypage pg2>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 2 because you selected yes."
</surveypage>

<surveypage pg3>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 3 because you selected yes."
</surveypage>

<surveypage pg4>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 4 because you selected yes."
</surveypage>

<surveypage end>
/ caption = "Everybody gets to see this page. It's the end."
</surveypage>

<radiobuttons q1>
/ caption = "Do you want to see extra pages?"
/ options = ("yes", "no")
</radiobuttons>

Thanks very much Dave - after staring at the code for a little while it finally clicked. I didn't realise at first that the code was written for different sections.

I do have a few more questions that I'm hoping you might be able to help with. 

1. I'm wanting to add in four additional questions (before the demographic survey) that 'screen' participants to ensure they meet the eligibility criteria for our study. Therefore, I need participants who give a response that would deem them ineligible (i.e., below 18 years of age) to be discontinued from completing the survey altogether. Ideally, it would be great if those participants are redirected to a page that informs them that they are ineligible for participation. Is there a way to do this? 

2. I'm planning on purchasing a license for the Web version of Inquisit, and many of the tests that I want to use already have scripts that I can just upload in their current form. However, I need some participants to receive one survey order (i.e., eligibility questions, demographics, WCST, BDI and CFI) and others to receive the other order (i.e., eligibility questions, demographics, CFI, BDI and WCST). I know that I need to create a batch script, but I'm not entirely sure how to pull off counterbalancing the order of the tests that participants receive. Are there any examples that you can refer me to?

3. At the end of the last test (either WCST or CFI) I need to redirect participants to a page that allows them to provide their email address if they wish. What would be the easiest way to do this since I'm intending on having the test order change across participants? 

Thanks very much for your help!

Thanks,
Caitlin


> 1. I'm wanting to add in four additional questions (before the demographic survey) that 'screen' participants to ensure they meet the eligibility criteria for our study. Therefore, I need participants who give a response that would deem them ineligible (i.e., below 18 years of age) to be discontinued from completing the survey altogether. Ideally, it would be great if those participants are redirected to a page that informs them that they are ineligible for participation. Is there a way to do this?

If eligibility is not met, /branch to a surveypage that informs participants accordingly. In that surveypage, call script.abort() /ontrialend.

https://www.millisecond.com/support/docs/v6/html/language/functions/abort.htm

> 2. I'm planning on purchasing a license for the Web version of Inquisit, and many of the tests that I want to use already have scripts that I can just upload in their current form. However, I need some participants to receive one survey order (i.e., eligibility questions, demographics, WCST, BDI and CFI) and others to receive the other order (i.e., eligibility questions, demographics, CFI, BDI and WCST). I know that I need to create a batch script, but I'm not entirely sure how to pull off counterbalancing the order of the tests that participants receive. Are there any examples that you can refer me to?

This is covered in the documentation for the batch element: https://www.millisecond.com/support/docs/v6/html/articles/batchscripts.htm under "Between-Subject Manipulations Using Batch Elements" -- you want two different orders between subjects.

> 3. At the end of the last test (either WCST or CFI) I need to redirect participants to a page that allows them to provide their email address if they wish. What would be the easiest way to do this since I'm intending on having the test order change across participants?

You can specify a URL to redirect to in the web experiment settings.

Hi Dave, 

1. Thank you very much, that worked perfectly!

2. I've read through the information you provided; however I'm not sure this is exactly what I'm after. Specifically, I do not want to counterbalance between two different groups (i.e., I do not want all pain patients getting one order, and all controls getting the other order). Rather, I’m wanting Inquisit to flip the order that the tests are presented in each time a subject opens up the survey, regardless of which group they are in. From my understanding, I think I want them to be assigned "randomly on the fly" like that link states. How do you do this? 
Also, does Inquisit also provide you with information about which participants were given ‘batch 1’ and which participants were given ‘batch 2’, so that we can account for order effects in our data analysis?

3. Is there a way to do this internally in Inquisit rather than re-directing to an external URL? 

Thanks,
Caitlin


By Dave - 10/13/2021

caithow - 10/13/2021
Dave - 10/12/2021
caithow - 10/12/2021
Dave - 10/12/2021
Dave - 10/12/2021
caithow - 10/12/2021
Dave - 10/12/2021
caithow - 10/12/2021
Hello, 

Apologies in advance, but I'm new to Inquisit. For my study we are collecting information from healthy controls and people with chronic pain. For the demographics questionnaire, all participants are exposed to the same questions except when they are asked about chronic pain. Anyone who identifies as having chronic pain will be asked additional questions about their pain; however, I want to use branching so that HCs do not see these questions. This is what I have so far but I can't quite figure out I need to add anything else or how I format my questions after this section of code...

Does anyone know how to fix this? Everything I have tried just gives me an error code, or does not display some of my questions altogether.

<surveypage Demographics7>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = chronic_pain_question]
/ branch = [if (radiobuttons.chronic_pain_question=="Yes") surveypage.Demographics8]
</surveypage>


Thanks in advance,
Caitlin



This almost certainly needs to read:

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

Hi Dave,

Thank you very much for the prompt reply to this matter. I have now amended the code accordingly. However, I am still running into problems. The script is still allowing HCs to answer pain related questions. 

The bolded section is what I have entered into my "Questions" section and the non-bold section is what I have entered into my "Survey pages" section. I have started at the point where I need it to branch off because everything else runs perfectly up until this point. Would you mind taking a look through and seeing if you can identify what I might be doing wrong?

Best,
Caitlin

<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 = worse 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 years/months)"
/ mask = alphanumeric
/ required = true
</textbox>

<textbox pain_location>
/ caption = "Which area do you consider to be the main location of your pain?"
/ mask = alphabetic
/ required = true
</textbox>

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



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

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

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

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

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

You have to ask yourself how you are invoking those pages. If you want to branch to them, you may not have them in your survey element's /pages (or your block's /trials). But then you must of course branch from surveypage demographics8 to page demographics9, from page demographics9 to demographics10 and so forth.

Otherwise use /skip, not /branch, as shown in the example I referred you to.

Here are two longer examples. The /branch option:

<survey mysurvey>
/ pages = [1=pg1; 2=end]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>

<surveypage pg1>
/ questions = [1=q1]
/ branch = [
    if (radiobuttons.q1.response == "yes") surveypage.pg2;
]
</surveypage>

<surveypage pg2>
/ caption = "You only get to see page 2 because you selected yes."
/ branch = [
    surveypage.pg3;
]
</surveypage>

<surveypage pg3>
/ caption = "You only get to see page 3 because you selected yes."
/ branch = [
    surveypage.pg4;
]
</surveypage>

<surveypage pg4>
/ caption = "You only get to see page 4 because you selected yes."
</surveypage>

<surveypage end>
/ caption = "Everybody gets to see this page. It's the end."
</surveypage>

<radiobuttons q1>
/ caption = "Do you want to see extra pages?"
/ options = ("yes", "no")
</radiobuttons>


Pay attention to what is and isn't in the <survey>'s /pages.

The same thing, but with /skip:

<survey mysurvey>
/ pages = [1=pg1; 2=pg2; 3=pg3; 4=pg4; 5=end]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>

<surveypage pg1>
/ questions = [1=q1]
</surveypage>

<surveypage pg2>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 2 because you selected yes."
</surveypage>

<surveypage pg3>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 3 because you selected yes."
</surveypage>

<surveypage pg4>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 4 because you selected yes."
</surveypage>

<surveypage end>
/ caption = "Everybody gets to see this page. It's the end."
</surveypage>

<radiobuttons q1>
/ caption = "Do you want to see extra pages?"
/ options = ("yes", "no")
</radiobuttons>

Thanks very much Dave - after staring at the code for a little while it finally clicked. I didn't realise at first that the code was written for different sections.

I do have a few more questions that I'm hoping you might be able to help with. 

1. I'm wanting to add in four additional questions (before the demographic survey) that 'screen' participants to ensure they meet the eligibility criteria for our study. Therefore, I need participants who give a response that would deem them ineligible (i.e., below 18 years of age) to be discontinued from completing the survey altogether. Ideally, it would be great if those participants are redirected to a page that informs them that they are ineligible for participation. Is there a way to do this? 

2. I'm planning on purchasing a license for the Web version of Inquisit, and many of the tests that I want to use already have scripts that I can just upload in their current form. However, I need some participants to receive one survey order (i.e., eligibility questions, demographics, WCST, BDI and CFI) and others to receive the other order (i.e., eligibility questions, demographics, CFI, BDI and WCST). I know that I need to create a batch script, but I'm not entirely sure how to pull off counterbalancing the order of the tests that participants receive. Are there any examples that you can refer me to?

3. At the end of the last test (either WCST or CFI) I need to redirect participants to a page that allows them to provide their email address if they wish. What would be the easiest way to do this since I'm intending on having the test order change across participants? 

Thanks very much for your help!

Thanks,
Caitlin


> 1. I'm wanting to add in four additional questions (before the demographic survey) that 'screen' participants to ensure they meet the eligibility criteria for our study. Therefore, I need participants who give a response that would deem them ineligible (i.e., below 18 years of age) to be discontinued from completing the survey altogether. Ideally, it would be great if those participants are redirected to a page that informs them that they are ineligible for participation. Is there a way to do this?

If eligibility is not met, /branch to a surveypage that informs participants accordingly. In that surveypage, call script.abort() /ontrialend.

https://www.millisecond.com/support/docs/v6/html/language/functions/abort.htm

> 2. I'm planning on purchasing a license for the Web version of Inquisit, and many of the tests that I want to use already have scripts that I can just upload in their current form. However, I need some participants to receive one survey order (i.e., eligibility questions, demographics, WCST, BDI and CFI) and others to receive the other order (i.e., eligibility questions, demographics, CFI, BDI and WCST). I know that I need to create a batch script, but I'm not entirely sure how to pull off counterbalancing the order of the tests that participants receive. Are there any examples that you can refer me to?

This is covered in the documentation for the batch element: https://www.millisecond.com/support/docs/v6/html/articles/batchscripts.htm under "Between-Subject Manipulations Using Batch Elements" -- you want two different orders between subjects.

> 3. At the end of the last test (either WCST or CFI) I need to redirect participants to a page that allows them to provide their email address if they wish. What would be the easiest way to do this since I'm intending on having the test order change across participants?

You can specify a URL to redirect to in the web experiment settings.

Hi Dave, 

1. Thank you very much, that worked perfectly!

2. I've read through the information you provided; however I'm not sure this is exactly what I'm after. Specifically, I do not want to counterbalance between two different groups (i.e., I do not want all pain patients getting one order, and all controls getting the other order). Rather, I’m wanting Inquisit to flip the order that the tests are presented in each time a subject opens up the survey, regardless of which group they are in. From my understanding, I think I want them to be assigned "randomly on the fly" like that link states. How do you do this? 
Also, does Inquisit also provide you with information about which participants were given ‘batch 1’ and which participants were given ‘batch 2’, so that we can account for order effects in our data analysis?

3. Is there a way to do this internally in Inquisit rather than re-directing to an external URL? 

Thanks,
Caitlin



> 2. I've read through the information you provided; however I'm not sure this is exactly what I'm after. Specifically, I do not want to counterbalance between two different groups (i.e., I do not want all pain patients getting one order, and all controls getting the other order). Rather, I’m wanting Inquisit to flip the order that the tests are presented in each time a subject opens up the survey, regardless of which group they are in. From my understanding, I think I want them to be assigned "randomly on the fly" like that link states. How do you do this?
Also, does Inquisit also provide you with information about which participants were given ‘batch 1’ and which participants were given ‘batch 2’, so that we can account for order effects in our data analysis?

I'm not sure what you mean by "flip the order each time a subject opens the survey." That said, if you want to randomly determine the order a given participant gets each time, then what I linked you to is exactly on point. Assign by group number, select random group number generation in the web experiment's settings, and indicate the number of groups as 2.

> Also, does Inquisit also provide you with information about which participants were given ‘batch 1’ and which participants were given ‘batch 2’, so that we can account for order effects in our data analysis?

Well, yes, the group number is typically logged to the data files. If you write your own scripts, make sure to log it. Also see https://www.millisecond.com/forums/Topic13856.aspx

> 3. Is there a way to do this internally in Inquisit rather than re-directing to an external URL?

You are free to have Inquisit collect the email address via a textbox on a surveypage or an openended trial.
By caithow - 10/14/2021

Dave - 10/13/2021
caithow - 10/13/2021
Dave - 10/12/2021
caithow - 10/12/2021
Dave - 10/12/2021
Dave - 10/12/2021
caithow - 10/12/2021
Dave - 10/12/2021
caithow - 10/12/2021
Hello, 

Apologies in advance, but I'm new to Inquisit. For my study we are collecting information from healthy controls and people with chronic pain. For the demographics questionnaire, all participants are exposed to the same questions except when they are asked about chronic pain. Anyone who identifies as having chronic pain will be asked additional questions about their pain; however, I want to use branching so that HCs do not see these questions. This is what I have so far but I can't quite figure out I need to add anything else or how I format my questions after this section of code...

Does anyone know how to fix this? Everything I have tried just gives me an error code, or does not display some of my questions altogether.

<surveypage Demographics7>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = chronic_pain_question]
/ branch = [if (radiobuttons.chronic_pain_question=="Yes") surveypage.Demographics8]
</surveypage>


Thanks in advance,
Caitlin



This almost certainly needs to read:

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

Hi Dave,

Thank you very much for the prompt reply to this matter. I have now amended the code accordingly. However, I am still running into problems. The script is still allowing HCs to answer pain related questions. 

The bolded section is what I have entered into my "Questions" section and the non-bold section is what I have entered into my "Survey pages" section. I have started at the point where I need it to branch off because everything else runs perfectly up until this point. Would you mind taking a look through and seeing if you can identify what I might be doing wrong?

Best,
Caitlin

<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 = worse 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 years/months)"
/ mask = alphanumeric
/ required = true
</textbox>

<textbox pain_location>
/ caption = "Which area do you consider to be the main location of your pain?"
/ mask = alphabetic
/ required = true
</textbox>

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



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

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

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

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

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

You have to ask yourself how you are invoking those pages. If you want to branch to them, you may not have them in your survey element's /pages (or your block's /trials). But then you must of course branch from surveypage demographics8 to page demographics9, from page demographics9 to demographics10 and so forth.

Otherwise use /skip, not /branch, as shown in the example I referred you to.

Here are two longer examples. The /branch option:

<survey mysurvey>
/ pages = [1=pg1; 2=end]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>

<surveypage pg1>
/ questions = [1=q1]
/ branch = [
    if (radiobuttons.q1.response == "yes") surveypage.pg2;
]
</surveypage>

<surveypage pg2>
/ caption = "You only get to see page 2 because you selected yes."
/ branch = [
    surveypage.pg3;
]
</surveypage>

<surveypage pg3>
/ caption = "You only get to see page 3 because you selected yes."
/ branch = [
    surveypage.pg4;
]
</surveypage>

<surveypage pg4>
/ caption = "You only get to see page 4 because you selected yes."
</surveypage>

<surveypage end>
/ caption = "Everybody gets to see this page. It's the end."
</surveypage>

<radiobuttons q1>
/ caption = "Do you want to see extra pages?"
/ options = ("yes", "no")
</radiobuttons>


Pay attention to what is and isn't in the <survey>'s /pages.

The same thing, but with /skip:

<survey mysurvey>
/ pages = [1=pg1; 2=pg2; 3=pg3; 4=pg4; 5=end]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>

<surveypage pg1>
/ questions = [1=q1]
</surveypage>

<surveypage pg2>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 2 because you selected yes."
</surveypage>

<surveypage pg3>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 3 because you selected yes."
</surveypage>

<surveypage pg4>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 4 because you selected yes."
</surveypage>

<surveypage end>
/ caption = "Everybody gets to see this page. It's the end."
</surveypage>

<radiobuttons q1>
/ caption = "Do you want to see extra pages?"
/ options = ("yes", "no")
</radiobuttons>

Thanks very much Dave - after staring at the code for a little while it finally clicked. I didn't realise at first that the code was written for different sections.

I do have a few more questions that I'm hoping you might be able to help with. 

1. I'm wanting to add in four additional questions (before the demographic survey) that 'screen' participants to ensure they meet the eligibility criteria for our study. Therefore, I need participants who give a response that would deem them ineligible (i.e., below 18 years of age) to be discontinued from completing the survey altogether. Ideally, it would be great if those participants are redirected to a page that informs them that they are ineligible for participation. Is there a way to do this? 

2. I'm planning on purchasing a license for the Web version of Inquisit, and many of the tests that I want to use already have scripts that I can just upload in their current form. However, I need some participants to receive one survey order (i.e., eligibility questions, demographics, WCST, BDI and CFI) and others to receive the other order (i.e., eligibility questions, demographics, CFI, BDI and WCST). I know that I need to create a batch script, but I'm not entirely sure how to pull off counterbalancing the order of the tests that participants receive. Are there any examples that you can refer me to?

3. At the end of the last test (either WCST or CFI) I need to redirect participants to a page that allows them to provide their email address if they wish. What would be the easiest way to do this since I'm intending on having the test order change across participants? 

Thanks very much for your help!

Thanks,
Caitlin


> 1. I'm wanting to add in four additional questions (before the demographic survey) that 'screen' participants to ensure they meet the eligibility criteria for our study. Therefore, I need participants who give a response that would deem them ineligible (i.e., below 18 years of age) to be discontinued from completing the survey altogether. Ideally, it would be great if those participants are redirected to a page that informs them that they are ineligible for participation. Is there a way to do this?

If eligibility is not met, /branch to a surveypage that informs participants accordingly. In that surveypage, call script.abort() /ontrialend.

https://www.millisecond.com/support/docs/v6/html/language/functions/abort.htm

> 2. I'm planning on purchasing a license for the Web version of Inquisit, and many of the tests that I want to use already have scripts that I can just upload in their current form. However, I need some participants to receive one survey order (i.e., eligibility questions, demographics, WCST, BDI and CFI) and others to receive the other order (i.e., eligibility questions, demographics, CFI, BDI and WCST). I know that I need to create a batch script, but I'm not entirely sure how to pull off counterbalancing the order of the tests that participants receive. Are there any examples that you can refer me to?

This is covered in the documentation for the batch element: https://www.millisecond.com/support/docs/v6/html/articles/batchscripts.htm under "Between-Subject Manipulations Using Batch Elements" -- you want two different orders between subjects.

> 3. At the end of the last test (either WCST or CFI) I need to redirect participants to a page that allows them to provide their email address if they wish. What would be the easiest way to do this since I'm intending on having the test order change across participants?

You can specify a URL to redirect to in the web experiment settings.

Hi Dave, 

1. Thank you very much, that worked perfectly!

2. I've read through the information you provided; however I'm not sure this is exactly what I'm after. Specifically, I do not want to counterbalance between two different groups (i.e., I do not want all pain patients getting one order, and all controls getting the other order). Rather, I’m wanting Inquisit to flip the order that the tests are presented in each time a subject opens up the survey, regardless of which group they are in. From my understanding, I think I want them to be assigned "randomly on the fly" like that link states. How do you do this? 
Also, does Inquisit also provide you with information about which participants were given ‘batch 1’ and which participants were given ‘batch 2’, so that we can account for order effects in our data analysis?

3. Is there a way to do this internally in Inquisit rather than re-directing to an external URL? 

Thanks,
Caitlin



> 2. I've read through the information you provided; however I'm not sure this is exactly what I'm after. Specifically, I do not want to counterbalance between two different groups (i.e., I do not want all pain patients getting one order, and all controls getting the other order). Rather, I’m wanting Inquisit to flip the order that the tests are presented in each time a subject opens up the survey, regardless of which group they are in. From my understanding, I think I want them to be assigned "randomly on the fly" like that link states. How do you do this?
Also, does Inquisit also provide you with information about which participants were given ‘batch 1’ and which participants were given ‘batch 2’, so that we can account for order effects in our data analysis?

I'm not sure what you mean by "flip the order each time a subject opens the survey." That said, if you want to randomly determine the order a given participant gets each time, then what I linked you to is exactly on point. Assign by group number, select random group number generation in the web experiment's settings, and indicate the number of groups as 2.

> Also, does Inquisit also provide you with information about which participants were given ‘batch 1’ and which participants were given ‘batch 2’, so that we can account for order effects in our data analysis?

Well, yes, the group number is typically logged to the data files. If you write your own scripts, make sure to log it. Also see https://www.millisecond.com/forums/Topic13856.aspx

> 3. Is there a way to do this internally in Inquisit rather than re-directing to an external URL?

You are free to have Inquisit collect the email address via a textbox on a surveypage or an openended trial.

Hi Dave,

1. Sorry, what I meant by that was I want the test order to be randomised for each participant that conducts the survey as a way of counterbalancing test order effects. Could you please specify what 'group' means in the context of Inquisit? Does 'groups' reflect the number of groups (i.e., healthy controls and pain patients) or does it reflect the number of test order groups (test with XX order, test with YY order)? To be clear, I do not want pain patients getting one order, and HCs getting the other order, rather I want the test order to be random across all participants regardless of which group they end up being in - I hope this is clear. In this case, would your previous suggestion still be appropriate? (i.e., assign by group number, select random group number in settings, and indicate the no. of groups as 2). I think what is confusing me is that I have also come across the selectionmode function but this appears (at least to me) to for the randomisation of items, for example, if I wanted to randomise the items within a single questionnaire (which I do not want to do because I only want to change the test order, not the order of the items within tests). Is my line of thinking correct here?

2. Could you please provide an example of how log the data files in the script? I have read through the link you provided but it isn't very clear where I should be entering this information, or what information I need to tell the script to run. Do I need to write that formula into the script? Apologies, I'm probably missing the point here...

3. Is is possible to give participants the option to withdraw from the study after they have been fully informed of the intent and purposes of the study - that is, after being debriefed? Specifically, it would be great if after participants have completed the batch of tests they are taken to the debriefing page that informs them of the purposes of the study and allows them to agree or disagree (via a button click) to have their data collected and included. Is this at all possible to do through Inquisit where Inquisit will remove and not collect any data unless participants select that they agree to have their data included? 

Once again, thanks for the very helpful and prompt responses to this long-winded forum post.

Thanks,
Caitlin
By Dave - 10/15/2021

caithow - 10/15/2021
Dave - 10/13/2021
caithow - 10/13/2021
Dave - 10/12/2021
caithow - 10/12/2021
Dave - 10/12/2021
Dave - 10/12/2021
caithow - 10/12/2021
Dave - 10/12/2021
caithow - 10/12/2021
Hello, 

Apologies in advance, but I'm new to Inquisit. For my study we are collecting information from healthy controls and people with chronic pain. For the demographics questionnaire, all participants are exposed to the same questions except when they are asked about chronic pain. Anyone who identifies as having chronic pain will be asked additional questions about their pain; however, I want to use branching so that HCs do not see these questions. This is what I have so far but I can't quite figure out I need to add anything else or how I format my questions after this section of code...

Does anyone know how to fix this? Everything I have tried just gives me an error code, or does not display some of my questions altogether.

<surveypage Demographics7>
/caption ="<%parameters.demographicpageinstructions%>"
/subcaption = "<%parameters.quitinstructions%>"
/questions = [1 = chronic_pain_question]
/ branch = [if (radiobuttons.chronic_pain_question=="Yes") surveypage.Demographics8]
</surveypage>


Thanks in advance,
Caitlin



This almost certainly needs to read:

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

Hi Dave,

Thank you very much for the prompt reply to this matter. I have now amended the code accordingly. However, I am still running into problems. The script is still allowing HCs to answer pain related questions. 

The bolded section is what I have entered into my "Questions" section and the non-bold section is what I have entered into my "Survey pages" section. I have started at the point where I need it to branch off because everything else runs perfectly up until this point. Would you mind taking a look through and seeing if you can identify what I might be doing wrong?

Best,
Caitlin

<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 = worse 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 years/months)"
/ mask = alphanumeric
/ required = true
</textbox>

<textbox pain_location>
/ caption = "Which area do you consider to be the main location of your pain?"
/ mask = alphabetic
/ required = true
</textbox>

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



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

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

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

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

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

You have to ask yourself how you are invoking those pages. If you want to branch to them, you may not have them in your survey element's /pages (or your block's /trials). But then you must of course branch from surveypage demographics8 to page demographics9, from page demographics9 to demographics10 and so forth.

Otherwise use /skip, not /branch, as shown in the example I referred you to.

Here are two longer examples. The /branch option:

<survey mysurvey>
/ pages = [1=pg1; 2=end]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>

<surveypage pg1>
/ questions = [1=q1]
/ branch = [
    if (radiobuttons.q1.response == "yes") surveypage.pg2;
]
</surveypage>

<surveypage pg2>
/ caption = "You only get to see page 2 because you selected yes."
/ branch = [
    surveypage.pg3;
]
</surveypage>

<surveypage pg3>
/ caption = "You only get to see page 3 because you selected yes."
/ branch = [
    surveypage.pg4;
]
</surveypage>

<surveypage pg4>
/ caption = "You only get to see page 4 because you selected yes."
</surveypage>

<surveypage end>
/ caption = "Everybody gets to see this page. It's the end."
</surveypage>

<radiobuttons q1>
/ caption = "Do you want to see extra pages?"
/ options = ("yes", "no")
</radiobuttons>


Pay attention to what is and isn't in the <survey>'s /pages.

The same thing, but with /skip:

<survey mysurvey>
/ pages = [1=pg1; 2=pg2; 3=pg3; 4=pg4; 5=end]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>

<surveypage pg1>
/ questions = [1=q1]
</surveypage>

<surveypage pg2>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 2 because you selected yes."
</surveypage>

<surveypage pg3>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 3 because you selected yes."
</surveypage>

<surveypage pg4>
/ skip = [
    radiobuttons.q1.response == "No";
]
/ caption = "You only get to see page 4 because you selected yes."
</surveypage>

<surveypage end>
/ caption = "Everybody gets to see this page. It's the end."
</surveypage>

<radiobuttons q1>
/ caption = "Do you want to see extra pages?"
/ options = ("yes", "no")
</radiobuttons>

Thanks very much Dave - after staring at the code for a little while it finally clicked. I didn't realise at first that the code was written for different sections.

I do have a few more questions that I'm hoping you might be able to help with. 

1. I'm wanting to add in four additional questions (before the demographic survey) that 'screen' participants to ensure they meet the eligibility criteria for our study. Therefore, I need participants who give a response that would deem them ineligible (i.e., below 18 years of age) to be discontinued from completing the survey altogether. Ideally, it would be great if those participants are redirected to a page that informs them that they are ineligible for participation. Is there a way to do this? 

2. I'm planning on purchasing a license for the Web version of Inquisit, and many of the tests that I want to use already have scripts that I can just upload in their current form. However, I need some participants to receive one survey order (i.e., eligibility questions, demographics, WCST, BDI and CFI) and others to receive the other order (i.e., eligibility questions, demographics, CFI, BDI and WCST). I know that I need to create a batch script, but I'm not entirely sure how to pull off counterbalancing the order of the tests that participants receive. Are there any examples that you can refer me to?

3. At the end of the last test (either WCST or CFI) I need to redirect participants to a page that allows them to provide their email address if they wish. What would be the easiest way to do this since I'm intending on having the test order change across participants? 

Thanks very much for your help!

Thanks,
Caitlin


> 1. I'm wanting to add in four additional questions (before the demographic survey) that 'screen' participants to ensure they meet the eligibility criteria for our study. Therefore, I need participants who give a response that would deem them ineligible (i.e., below 18 years of age) to be discontinued from completing the survey altogether. Ideally, it would be great if those participants are redirected to a page that informs them that they are ineligible for participation. Is there a way to do this?

If eligibility is not met, /branch to a surveypage that informs participants accordingly. In that surveypage, call script.abort() /ontrialend.

https://www.millisecond.com/support/docs/v6/html/language/functions/abort.htm

> 2. I'm planning on purchasing a license for the Web version of Inquisit, and many of the tests that I want to use already have scripts that I can just upload in their current form. However, I need some participants to receive one survey order (i.e., eligibility questions, demographics, WCST, BDI and CFI) and others to receive the other order (i.e., eligibility questions, demographics, CFI, BDI and WCST). I know that I need to create a batch script, but I'm not entirely sure how to pull off counterbalancing the order of the tests that participants receive. Are there any examples that you can refer me to?

This is covered in the documentation for the batch element: https://www.millisecond.com/support/docs/v6/html/articles/batchscripts.htm under "Between-Subject Manipulations Using Batch Elements" -- you want two different orders between subjects.

> 3. At the end of the last test (either WCST or CFI) I need to redirect participants to a page that allows them to provide their email address if they wish. What would be the easiest way to do this since I'm intending on having the test order change across participants?

You can specify a URL to redirect to in the web experiment settings.

Hi Dave, 

1. Thank you very much, that worked perfectly!

2. I've read through the information you provided; however I'm not sure this is exactly what I'm after. Specifically, I do not want to counterbalance between two different groups (i.e., I do not want all pain patients getting one order, and all controls getting the other order). Rather, I’m wanting Inquisit to flip the order that the tests are presented in each time a subject opens up the survey, regardless of which group they are in. From my understanding, I think I want them to be assigned "randomly on the fly" like that link states. How do you do this? 
Also, does Inquisit also provide you with information about which participants were given ‘batch 1’ and which participants were given ‘batch 2’, so that we can account for order effects in our data analysis?

3. Is there a way to do this internally in Inquisit rather than re-directing to an external URL? 

Thanks,
Caitlin



> 2. I've read through the information you provided; however I'm not sure this is exactly what I'm after. Specifically, I do not want to counterbalance between two different groups (i.e., I do not want all pain patients getting one order, and all controls getting the other order). Rather, I’m wanting Inquisit to flip the order that the tests are presented in each time a subject opens up the survey, regardless of which group they are in. From my understanding, I think I want them to be assigned "randomly on the fly" like that link states. How do you do this?
Also, does Inquisit also provide you with information about which participants were given ‘batch 1’ and which participants were given ‘batch 2’, so that we can account for order effects in our data analysis?

I'm not sure what you mean by "flip the order each time a subject opens the survey." That said, if you want to randomly determine the order a given participant gets each time, then what I linked you to is exactly on point. Assign by group number, select random group number generation in the web experiment's settings, and indicate the number of groups as 2.

> Also, does Inquisit also provide you with information about which participants were given ‘batch 1’ and which participants were given ‘batch 2’, so that we can account for order effects in our data analysis?

Well, yes, the group number is typically logged to the data files. If you write your own scripts, make sure to log it. Also see https://www.millisecond.com/forums/Topic13856.aspx

> 3. Is there a way to do this internally in Inquisit rather than re-directing to an external URL?

You are free to have Inquisit collect the email address via a textbox on a surveypage or an openended trial.

Hi Dave,

1. Sorry, what I meant by that was I want the test order to be randomised for each participant that conducts the survey as a way of counterbalancing test order effects. Could you please specify what 'group' means in the context of Inquisit? Does 'groups' reflect the number of groups (i.e., healthy controls and pain patients) or does it reflect the number of test order groups (test with XX order, test with YY order)? To be clear, I do not want pain patients getting one order, and HCs getting the other order, rather I want the test order to be random across all participants regardless of which group they end up being in - I hope this is clear. In this case, would your previous suggestion still be appropriate? (i.e., assign by group number, select random group number in settings, and indicate the no. of groups as 2). I think what is confusing me is that I have also come across the selectionmode function but this appears (at least to me) to for the randomisation of items, for example, if I wanted to randomise the items within a single questionnaire (which I do not want to do because I only want to change the test order, not the order of the items within tests). Is my line of thinking correct here?

2. Could you please provide an example of how log the data files in the script? I have read through the link you provided but it isn't very clear where I should be entering this information, or what information I need to tell the script to run. Do I need to write that formula into the script? Apologies, I'm probably missing the point here...

3. Is is possible to give participants the option to withdraw from the study after they have been fully informed of the intent and purposes of the study - that is, after being debriefed? Specifically, it would be great if after participants have completed the batch of tests they are taken to the debriefing page that informs them of the purposes of the study and allows them to agree or disagree (via a button click) to have their data collected and included. Is this at all possible to do through Inquisit where Inquisit will remove and not collect any data unless participants select that they agree to have their data included? 

Once again, thanks for the very helpful and prompt responses to this long-winded forum post.

Thanks,
Caitlin

1) is explained at https://www.millisecond.com/forums/Topic13856.aspx as linked previously.

Re. 2) see
https://www.millisecond.com/support/docs/v6/html/language/attributes/columns.htm
https://www.millisecond.com/support/docs/v6/html/language/attributes/summarydatacolumns.htm
and generally
https://www.millisecond.com/support/docs/v6/html/language/datarecording.htm

You may refer to virtually any script available in the library as example. https://www.millisecond.com/download/library/

Re. 3), not automatically. You will have to remove participants' data manually if they withdrew consent after already completing the study.