Millisecond Forums

Branch on Survey Page if Certain Button Clicked

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

By bmont - 10/10/2018

Hi all,
On the first page of my study I have a consent form, and the question "Do you consent to this study?". I currently have it so "Yes" is the valid response, but would like to make it so if the participant clicks "Yes", they are able to progress through the study as usual, but if they click "No", they are sent to the last survey page (which will display a random code). I feel as though I am on the right track, but do not know where I am going wrong. I have tried removing /validresponse = ("Yes"), however the participant is still able to progress through the study when they click "No". Is there a way I can fix this?

My current syntax for this section is:

<radiobuttons consent>
/ caption = "Do you consent to participate in this study?"
/ options = ("Yes",
"No")
/ validresponse = ("Yes")
/ orientation = vertical
/ position = (35.25%, 75%)
/ required = true
</radiobuttons>


<surveypage consent_form>
/ fontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/ questions = [1 = Logo; 2 = ConsentForm; 3 = radiobuttons.consent]
/ txcolor = black
/showpagenumbers = false
/showquestionnumbers = false
/ nextbuttonposition = (85%, 90%)
/ recorddata = true
/ showbackbutton = false
/ branch = [if(radiobuttons.consent == "No"){surveypage.end_page}]
</surveypage>


Thank you so much!

By bmont - 10/10/2018

bmont - Wednesday, October 10, 2018
Hi all,
On the first page of my study I have a consent form, and the question "Do you consent to this study?". I currently have it so "Yes" is the valid response, but would like to make it so if the participant clicks "Yes", they are able to progress through the study as usual, but if they click "No", they are sent to the last survey page (which will display a random code). I feel as though I am on the right track, but do not know where I am going wrong. I have tried removing /validresponse = ("Yes"), however the participant is still able to progress through the study when they click "No". Is there a way I can fix this?

My current syntax for this section is:

<radiobuttons consent>
/ caption = "Do you consent to participate in this study?"
/ options = ("Yes",
"No")
/ validresponse = ("Yes")
/ orientation = vertical
/ position = (35.25%, 75%)
/ required = true
</radiobuttons>


<surveypage consent_form>
/ fontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/ questions = [1 = Logo; 2 = ConsentForm; 3 = radiobuttons.consent]
/ txcolor = black
/showpagenumbers = false
/showquestionnumbers = false
/ nextbuttonposition = (85%, 90%)
/ recorddata = true
/ showbackbutton = false
/ branch = [if(radiobuttons.consent == "No"){surveypage.end_page}]
</surveypage>


Thank you so much!


UPDATE: I have managed to fix this issue, using the script downloaded from this topic page: https://www.millisecond.com/forums/Topic2582.aspx

Thank you again!
By bmont - 10/10/2018

bmont - Wednesday, October 10, 2018
bmont - Wednesday, October 10, 2018
Hi all,
On the first page of my study I have a consent form, and the question "Do you consent to this study?". I currently have it so "Yes" is the valid response, but would like to make it so if the participant clicks "Yes", they are able to progress through the study as usual, but if they click "No", they are sent to the last survey page (which will display a random code). I feel as though I am on the right track, but do not know where I am going wrong. I have tried removing /validresponse = ("Yes"), however the participant is still able to progress through the study when they click "No". Is there a way I can fix this?

My current syntax for this section is:

<radiobuttons consent>
/ caption = "Do you consent to participate in this study?"
/ options = ("Yes",
"No")
/ validresponse = ("Yes")
/ orientation = vertical
/ position = (35.25%, 75%)
/ required = true
</radiobuttons>


<surveypage consent_form>
/ fontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/ questions = [1 = Logo; 2 = ConsentForm; 3 = radiobuttons.consent]
/ txcolor = black
/showpagenumbers = false
/showquestionnumbers = false
/ nextbuttonposition = (85%, 90%)
/ recorddata = true
/ showbackbutton = false
/ branch = [if(radiobuttons.consent == "No"){surveypage.end_page}]
</surveypage>


Thank you so much!


UPDATE: I have managed to fix this issue, using the script downloaded from this topic page: https://www.millisecond.com/forums/Topic2582.aspx

Thank you again!



Another update:
So while I have successfully branched the participant to the end page if they click "No", they are still able to click continue from the end page and progress through the study. Is there a way I can have the study terminate after they are presented with the end page? If a participant progresses through the study as usual, the "Finish" button on the end page closes the study, however in this case it is a "Continue" button. 

Thank you again (and sorry for all of the updates)!
By Dave - 10/10/2018

bmont - Wednesday, October 10, 2018



Another update:
So while I have successfully branched the participant to the end page if they click "No", they are still able to click continue from the end page and progress through the study. Is there a way I can have the study terminate after they are presented with the end page? If a participant progresses through the study as usual, the "Finish" button on the end page closes the study, however in this case it is a "Continue" button. 

Thank you again (and sorry for all of the updates)!

You should use /skip instead of /branch for that:

<radiobuttons consent>
/ caption = "Do you consent to participate in this study?"
/ options = ("Yes",
"No")
/ orientation = vertical
/ position = (35.25%, 75%)
/ required = true
</radiobuttons>

<surveypage consent_form>
/ caption = "Consent Form Placeholder"
/ fontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/ questions = [1 = radiobuttons.consent]
/ txcolor = black
/showpagenumbers = false
/showquestionnumbers = false
/ nextbuttonposition = (85%, 90%)
/ recorddata = true
/ showbackbutton = false
</surveypage>

<surveypage pg1>
/ skip = [
radiobuttons.consent.response == "No";
]

/ caption = "Page 1: You should not see this if you didn't consent"
</surveypage>

<surveypage pg2>
/ skip = [
radiobuttons.consent.response == "No";
]

/ caption = "Page 2: You should not see this if you didn't consent"
</surveypage>

<surveypage endpage>
/ caption = "This is the end."
/ showbackbutton = false
</surveypage>

<survey mysurvey>
/ pages = [1=consent_form; 2 = pg1; 3 = pg2; 4 = endpage]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>



And if you want differently behaving end pages for consent vs no consent, you can do:


<radiobuttons consent>
/ caption = "Do you consent to participate in this study?"
/ options = ("Yes",
"No")
/ orientation = vertical
/ position = (35.25%, 75%)
/ required = true
</radiobuttons>

<surveypage consent_form>
/ caption = "Consent Form Placeholder"
/ fontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/ questions = [1 = radiobuttons.consent]
/ txcolor = black
/showpagenumbers = false
/showquestionnumbers = false
/ nextbuttonposition = (85%, 90%)
/ recorddata = true
/ showbackbutton = false
</surveypage>

<surveypage pg1>
/ skip = [
radiobuttons.consent.response == "No";
]
/ caption = "Page 1: You should not see this if you didn't consent"
</surveypage>

<surveypage pg2>
/ skip = [
radiobuttons.consent.response == "No";
]
/ caption = "Page 2: You should not see this if you didn't consent"
</surveypage>

<surveypage regular_endpage>
/ skip = [
radiobuttons.consent.response == "No";
]
/ caption = "This is the end."
</surveypage>

<surveypage noconsent_endpage>
/ skip = [
radiobuttons.consent.response == "Yes";
]

/ caption = "This is the end."
/ showbackbutton = false
</surveypage>

<survey mysurvey>
/ pages = [1=consent_form; 2 = pg1; 3 = pg2; 4 = regular_endpage; 5 = noconsent_endpage]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>


By bmont - 10/10/2018

Dave - Wednesday, October 10, 2018
bmont - Wednesday, October 10, 2018



Another update:
So while I have successfully branched the participant to the end page if they click "No", they are still able to click continue from the end page and progress through the study. Is there a way I can have the study terminate after they are presented with the end page? If a participant progresses through the study as usual, the "Finish" button on the end page closes the study, however in this case it is a "Continue" button. 

Thank you again (and sorry for all of the updates)!

You should use /skip instead of /branch for that:

<radiobuttons consent>
/ caption = "Do you consent to participate in this study?"
/ options = ("Yes",
"No")
/ orientation = vertical
/ position = (35.25%, 75%)
/ required = true
</radiobuttons>

<surveypage consent_form>
/ caption = "Consent Form Placeholder"
/ fontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/ questions = [1 = radiobuttons.consent]
/ txcolor = black
/showpagenumbers = false
/showquestionnumbers = false
/ nextbuttonposition = (85%, 90%)
/ recorddata = true
/ showbackbutton = false
</surveypage>

<surveypage pg1>
/ skip = [
radiobuttons.consent.response == "No";
]

/ caption = "Page 1: You should not see this if you didn't consent"
</surveypage>

<surveypage pg2>
/ skip = [
radiobuttons.consent.response == "No";
]

/ caption = "Page 2: You should not see this if you didn't consent"
</surveypage>

<surveypage endpage>
/ caption = "This is the end."
/ showbackbutton = false
</surveypage>

<survey mysurvey>
/ pages = [1=consent_form; 2 = pg1; 3 = pg2; 4 = endpage]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>



And if you want differently behaving end pages for consent vs no consent, you can do:


<radiobuttons consent>
/ caption = "Do you consent to participate in this study?"
/ options = ("Yes",
"No")
/ orientation = vertical
/ position = (35.25%, 75%)
/ required = true
</radiobuttons>

<surveypage consent_form>
/ caption = "Consent Form Placeholder"
/ fontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/itemfontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/responsefontstyle = ("Arial", 1.2%, false, false, false, false, 5, 1)
/ questions = [1 = radiobuttons.consent]
/ txcolor = black
/showpagenumbers = false
/showquestionnumbers = false
/ nextbuttonposition = (85%, 90%)
/ recorddata = true
/ showbackbutton = false
</surveypage>

<surveypage pg1>
/ skip = [
radiobuttons.consent.response == "No";
]
/ caption = "Page 1: You should not see this if you didn't consent"
</surveypage>

<surveypage pg2>
/ skip = [
radiobuttons.consent.response == "No";
]
/ caption = "Page 2: You should not see this if you didn't consent"
</surveypage>

<surveypage regular_endpage>
/ skip = [
radiobuttons.consent.response == "No";
]
/ caption = "This is the end."
</surveypage>

<surveypage noconsent_endpage>
/ skip = [
radiobuttons.consent.response == "Yes";
]

/ caption = "This is the end."
/ showbackbutton = false
</surveypage>

<survey mysurvey>
/ pages = [1=consent_form; 2 = pg1; 3 = pg2; 4 = regular_endpage; 5 = noconsent_endpage]
/ showpagenumbers = false
/ showquestionnumbers = false
</survey>


Thank you, Dave! You have helped me so much throughout this!