Surveypage branching


Author
Message
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
becgwin - Monday, July 31, 2017
Hi again,

I have another question re surveypages!  I am running a lab study using a batch file, with multiple scripts ranging from surveys to perception tasks, and have a couple of questions re branching:

1. In one of the surveys, past behaviour is measured for a range of products in terms of frequency and volume.  If there is a negative response to the frequency question, I want to skip the volume question, but can't work out how to do that within a surveypage element.  Within the script there are a number of dropdowns that are then used in the surveypage. If a participant selects "never" in response to the frequency question, I want to branch to the next product's frequency question.  I have tried a number of branching expressions but none seem to work.  Below are elements of the script for your reference.  I have tried branching from the dropdown.chocblockpb = "never" and questions.chocblockpb = "never" as well as the surveypage as below but none work. I have put the warning I get for the following script below.  Can you tell me what I am doing wrong!? 

<dropdown chocblockpb>
/ caption = "Please think about your patterns of eating CHOCOLATE BLOCKS, such as a Cadbury or Lindt chocolate block, over the past year.  On average, how many times have you snacked on chocolate blocks over the PAST TWELVE MONTHS?"
/ options = ("never", "haven't in the past year", "once in the year", "twice in the year", "three or four times a year", "once a month", "twice a month", "three times a month", "once a week", "twice a week", "three or four times a week", "almost every day", "daily", "twice daily", "three times daily", "four times daily", "more than four times daily" )
</dropdown>

...........

<surveypage chocolate1>
/ caption = "The next set of questions asks more about your consumption of SPECIFIC TYPES OF CHOCOLATE over the past year.  Please answer the following questions in regards to chocolate blocks."
/ fontstyle = ("Arial", 2.2%, true, false, false, false, 5, 0)
/ questions = [1=chocblockpb]
/ branch = if [surveypage.chocolate1 = "never"] surveypage.chocolate3
/ showquestionnumbers = false
</surveypage>

<surveypage chocolate2>
/ caption = "Please answer the following questions in regards to chocolate blocks"
/ fontstyle = ("Arial", 2.2%, true, false, false, false, 5, 0)
/ questions = [1=chocblockvol]
/showquestionnumbers = false
</surveypage>

<surveypage chocolate3>
/ caption = "Please answer the following questions in regards to chocolate confectionary bars"
/ fontstyle = ("Arial", 2.2%, true, false, false, false, 5, 0)
/ questions = [1=chocbarpb]
/showquestionnumbers = false
</surveypage>





2.  I am also screening for a particular medical condition.  While there will be verbal screening, I also want to put in a question in the demographics survey script (which comes first in the batch script for the study) so that if they answer "yes" in the dropdown to having the condition they are thanked for their participation and the batch script ceases.  I am not sure where to branch this?  In the demographics script, the batch script or a combination?  And how to branch within each of these. I hope that makes sense.


Many thanks,

Rebecca

 



Re. #1:
/ branch = if [surveypage.chocolate1 = "never"] surveypage.chocolate3]

The syntax here is wrong on several accounts:
- surveypage.chocolate1 returns nothing, and certainly not a the value of a response. You need to check the <dropdown>'s response property.
- You are using the wrong operator. "=" is the assignment operator, but what you need is the logical comparison operator "==".
- The use of brackets is completely off.

In sum, the /branch ought to read

/ branch = [if (dropdown.chocblockpb.response == "never") surveypage.chocolate3]

Re. #2:
You should use some /skip logic here, see e.g. https://www.millisecond.com/forums/FindPost22054.aspx , along with the script.abort() function if you wish to terminate the entire <batch>. Based on the example in the linked post, you would call the abort function /ontrialend here:

<surveypage disqualificationpage>
/ ontrialend = [script.abort(); ]
/ caption = "you are not eligible to participate (neither black nor white)"
</surveypage>


becgwin
becgwin
Guru (7K reputation)Guru (7K reputation)Guru (7K reputation)Guru (7K reputation)Guru (7K reputation)Guru (7K reputation)Guru (7K reputation)Guru (7K reputation)Guru (7K reputation)
Group: Forum Members
Posts: 53, Visits: 313
Hi again,

I have another question re surveypages!  I am running a lab study using a batch file, with multiple scripts ranging from surveys to perception tasks, and have a couple of questions re branching:

1. In one of the surveys, past behaviour is measured for a range of products in terms of frequency and volume.  If there is a negative response to the frequency question, I want to skip the volume question, but can't work out how to do that within a surveypage element.  Within the script there are a number of dropdowns that are then used in the surveypage. If a participant selects "never" in response to the frequency question, I want to branch to the next product's frequency question.  I have tried a number of branching expressions but none seem to work.  Below are elements of the script for your reference.  I have tried branching from the dropdown.chocblockpb = "never" and questions.chocblockpb = "never" as well as the surveypage as below but none work. I have put the warning I get for the following script below.  Can you tell me what I am doing wrong!? 

<dropdown chocblockpb>
/ caption = "Please think about your patterns of eating CHOCOLATE BLOCKS, such as a Cadbury or Lindt chocolate block, over the past year.  On average, how many times have you snacked on chocolate blocks over the PAST TWELVE MONTHS?"
/ options = ("never", "haven't in the past year", "once in the year", "twice in the year", "three or four times a year", "once a month", "twice a month", "three times a month", "once a week", "twice a week", "three or four times a week", "almost every day", "daily", "twice daily", "three times daily", "four times daily", "more than four times daily" )
</dropdown>

...........

<surveypage chocolate1>
/ caption = "The next set of questions asks more about your consumption of SPECIFIC TYPES OF CHOCOLATE over the past year.  Please answer the following questions in regards to chocolate blocks."
/ fontstyle = ("Arial", 2.2%, true, false, false, false, 5, 0)
/ questions = [1=chocblockpb]
/ branch = if [surveypage.chocolate1 = "never"] surveypage.chocolate3
/ showquestionnumbers = false
</surveypage>

<surveypage chocolate2>
/ caption = "Please answer the following questions in regards to chocolate blocks"
/ fontstyle = ("Arial", 2.2%, true, false, false, false, 5, 0)
/ questions = [1=chocblockvol]
/showquestionnumbers = false
</surveypage>

<surveypage chocolate3>
/ caption = "Please answer the following questions in regards to chocolate confectionary bars"
/ fontstyle = ("Arial", 2.2%, true, false, false, false, 5, 0)
/ questions = [1=chocbarpb]
/showquestionnumbers = false
</surveypage>





2.  I am also screening for a particular medical condition.  While there will be verbal screening, I also want to put in a question in the demographics survey script (which comes first in the batch script for the study) so that if they answer "yes" in the dropdown to having the condition they are thanked for their participation and the batch script ceases.  I am not sure where to branch this?  In the demographics script, the batch script or a combination?  And how to branch within each of these. I hope that makes sense.


Many thanks,

Rebecca

 



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search