Survey branching


Author
Message
darbyh
darbyh
Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)
Group: Forum Members
Posts: 22, Visits: 77
Hi!

I'm trying to have a survey where, if the participant responds with "Guilty", then they get sent to another set of survey pages, and if they respond "Not guilty" they get sent to a different set of survey pages. However, whenever I try to branch within the survey, the first question (the verdict question) is skipped over and it goes straight to the next survey. It then seems to get stuck in an infinite loop. Is there a way to fix this? Here is what the script looks like:

<survey verdict>
/ pages=[1=verdict1]
/ showbackbutton=false
/ screencolor = white
/ branch = [
if (surveypage.verdict.response == "Guilty") survey.guiltysurvey else survey.notguiltysurvey
]
</survey>

<surveypage verdict1>
/questions = [1 = verdict1]
/showpagenumbers = false
/showquestionnumbers = false
/ nextbuttonposition = (90%, 90%)
/ navigationbuttonfontstyle = ("Arial", 1.5%, true, false, false, false, 5, 0)
</surveypage>

<radiobuttons verdict1>
/caption ="What would your verdict be as a juror in this case?"
/ fontstyle = ("Arial", 4%, true, false, false, false, 5, 0)
/ txcolor = black
/ options = ("Not Guilty", "Guilty")
/ order = random
/required = true
/orientation = horizontal
/ responsefontstyle = ("Arial", 3.5%, true, false, false, false, 5, 0)
/ position = (10%, 25%)
/ size = (500,500)
</radiobuttons>

<survey guiltysurvey>
/ pages = [1=confidence; 2=sentence1; 3=fine1; 4=verdictchangeguilty; 5=sentence2addict; 6=fine2addict]
/ showbackbutton = false
/ screencolor = white
</survey>

<survey notguiltysurvey>
/ pages = [1=confidence; 2=sentence1; 3=fine1; 4=verdictchangenotguilty; 5=sentence2addict; 6=fine2addict]
/ showbackbutton = false
/ screencolor = white
</survey>

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: 12K, Visits: 98K
darbyh - Thursday, February 2, 2017
Hi!

I'm trying to have a survey where, if the participant responds with "Guilty", then they get sent to another set of survey pages, and if they respond "Not guilty" they get sent to a different set of survey pages. However, whenever I try to branch within the survey, the first question (the verdict question) is skipped over and it goes straight to the next survey. It then seems to get stuck in an infinite loop. Is there a way to fix this? Here is what the script looks like:

<survey verdict>
/ pages=[1=verdict1]
/ showbackbutton=false
/ screencolor = white
/ branch = [
if (surveypage.verdict.response == "Guilty") survey.guiltysurvey else survey.notguiltysurvey
]
</survey>

<surveypage verdict1>
/questions = [1 = verdict1]
/showpagenumbers = false
/showquestionnumbers = false
/ nextbuttonposition = (90%, 90%)
/ navigationbuttonfontstyle = ("Arial", 1.5%, true, false, false, false, 5, 0)
</surveypage>

<radiobuttons verdict1>
/caption ="What would your verdict be as a juror in this case?"
/ fontstyle = ("Arial", 4%, true, false, false, false, 5, 0)
/ txcolor = black
/ options = ("Not Guilty", "Guilty")
/ order = random
/required = true
/orientation = horizontal
/ responsefontstyle = ("Arial", 3.5%, true, false, false, false, 5, 0)
/ position = (10%, 25%)
/ size = (500,500)
</radiobuttons>

<survey guiltysurvey>
/ pages = [1=confidence; 2=sentence1; 3=fine1; 4=verdictchangeguilty; 5=sentence2addict; 6=fine2addict]
/ showbackbutton = false
/ screencolor = white
</survey>

<survey notguiltysurvey>
/ pages = [1=confidence; 2=sentence1; 3=fine1; 4=verdictchangenotguilty; 5=sentence2addict; 6=fine2addict]
/ showbackbutton = false
/ screencolor = white
</survey>

#1:

<survey verdict>
/ pages=[1=verdict1]
/ showbackbutton=false
/ screencolor = white
/ branch = [
if (surveypage.verdict.response == "Guilty") survey.guiltysurvey else survey.notguiltysurvey
]

</survey>

The /branch condition seems wrong. A <surveypage> has no response property. You'll want radiobuttons.verdict1.response; there also isn't any <survepage> called verdict in the code you posted, there is only a page called verdict1.

#2: You need an <expt> element to control in which order the script is supposed to run the surveys (a <survey> is a type of <block>). Otherwise the running the script will execute all <survey>s in alphabetical order.

<expt>
/ blocks = [1=verdict]
</expt>


<survey verdict>
/ pages=[1=verdict1]
/ showbackbutton=false
/ screencolor = white
/ branch = [
if (radiobuttons.verdict1.response == "Guilty") survey.guiltysurvey else survey.notguiltysurvey
]
</survey>

<surveypage verdict1>
/questions = [1 = verdict1]
/showpagenumbers = false
/showquestionnumbers = false
/ nextbuttonposition = (90%, 90%)
/ navigationbuttonfontstyle = ("Arial", 1.5%, true, false, false, false, 5, 0)
</surveypage>

<radiobuttons verdict1>
/caption ="What would your verdict be as a juror in this case?"
/ fontstyle = ("Arial", 4%, true, false, false, false, 5, 0)
/ txcolor = black
/ options = ("Not Guilty", "Guilty")
/ order = random
/required = true
/orientation = horizontal
/ responsefontstyle = ("Arial", 3.5%, true, false, false, false, 5, 0)
/ position = (10%, 25%)
/ size = (500,500)
</radiobuttons>

<survey guiltysurvey>
/ pages = [1=confidence; 2=sentence1; 3=fine1; 4=verdictchangeguilty; 5=sentence2addict; 6=fine2addict]
/ showbackbutton = false
/ screencolor = white
</survey>

<survey notguiltysurvey>
/ pages = [1=confidence; 2=sentence1; 3=fine1; 4=verdictchangenotguilty; 5=sentence2addict; 6=fine2addict]
/ showbackbutton = false
/ screencolor = white
</survey>


darbyh
darbyh
Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)
Group: Forum Members
Posts: 22, Visits: 77
Dave - Thursday, February 2, 2017
darbyh - Thursday, February 2, 2017
Hi!

I'm trying to have a survey where, if the participant responds with "Guilty", then they get sent to another set of survey pages, and if they respond "Not guilty" they get sent to a different set of survey pages. However, whenever I try to branch within the survey, the first question (the verdict question) is skipped over and it goes straight to the next survey. It then seems to get stuck in an infinite loop. Is there a way to fix this? Here is what the script looks like:

<survey verdict>
/ pages=[1=verdict1]
/ showbackbutton=false
/ screencolor = white
/ branch = [
if (surveypage.verdict.response == "Guilty") survey.guiltysurvey else survey.notguiltysurvey
]
</survey>

<surveypage verdict1>
/questions = [1 = verdict1]
/showpagenumbers = false
/showquestionnumbers = false
/ nextbuttonposition = (90%, 90%)
/ navigationbuttonfontstyle = ("Arial", 1.5%, true, false, false, false, 5, 0)
</surveypage>

<radiobuttons verdict1>
/caption ="What would your verdict be as a juror in this case?"
/ fontstyle = ("Arial", 4%, true, false, false, false, 5, 0)
/ txcolor = black
/ options = ("Not Guilty", "Guilty")
/ order = random
/required = true
/orientation = horizontal
/ responsefontstyle = ("Arial", 3.5%, true, false, false, false, 5, 0)
/ position = (10%, 25%)
/ size = (500,500)
</radiobuttons>

<survey guiltysurvey>
/ pages = [1=confidence; 2=sentence1; 3=fine1; 4=verdictchangeguilty; 5=sentence2addict; 6=fine2addict]
/ showbackbutton = false
/ screencolor = white
</survey>

<survey notguiltysurvey>
/ pages = [1=confidence; 2=sentence1; 3=fine1; 4=verdictchangenotguilty; 5=sentence2addict; 6=fine2addict]
/ showbackbutton = false
/ screencolor = white
</survey>

#1:

<survey verdict>
/ pages=[1=verdict1]
/ showbackbutton=false
/ screencolor = white
/ branch = [
if (surveypage.verdict.response == "Guilty") survey.guiltysurvey else survey.notguiltysurvey
]

</survey>

The /branch condition seems wrong. A <surveypage> has no response property. You'll want radiobuttons.verdict1.response; there also isn't any <survepage> called verdict in the code you posted, there is only a page called verdict1.

#2: You need an <expt> element to control in which order the script is supposed to run the surveys (a <survey> is a type of <block>). Otherwise the running the script will execute all <survey>s in alphabetical order.

<expt>
/ blocks = [1=verdict]
</expt>


<survey verdict>
/ pages=[1=verdict1]
/ showbackbutton=false
/ screencolor = white
/ branch = [
if (radiobuttons.verdict1.response == "Guilty") survey.guiltysurvey else survey.notguiltysurvey
]
</survey>

<surveypage verdict1>
/questions = [1 = verdict1]
/showpagenumbers = false
/showquestionnumbers = false
/ nextbuttonposition = (90%, 90%)
/ navigationbuttonfontstyle = ("Arial", 1.5%, true, false, false, false, 5, 0)
</surveypage>

<radiobuttons verdict1>
/caption ="What would your verdict be as a juror in this case?"
/ fontstyle = ("Arial", 4%, true, false, false, false, 5, 0)
/ txcolor = black
/ options = ("Not Guilty", "Guilty")
/ order = random
/required = true
/orientation = horizontal
/ responsefontstyle = ("Arial", 3.5%, true, false, false, false, 5, 0)
/ position = (10%, 25%)
/ size = (500,500)
</radiobuttons>

<survey guiltysurvey>
/ pages = [1=confidence; 2=sentence1; 3=fine1; 4=verdictchangeguilty; 5=sentence2addict; 6=fine2addict]
/ showbackbutton = false
/ screencolor = white
</survey>

<survey notguiltysurvey>
/ pages = [1=confidence; 2=sentence1; 3=fine1; 4=verdictchangenotguilty; 5=sentence2addict; 6=fine2addict]
/ showbackbutton = false
/ screencolor = white
</survey>


Thank you! It works now! However, I need this verdict question (and its subsequent questions) to come after stimuli and before other questions. I had put all of the other questions into their own experiments using blocks and was hoping that this verdict series would be able to be inserted in between the first and second blocks. Here is the script for the big experiment:

<expt Cond1>
/ blocks = [1=cond1trialsumm; 2=cond1manip; 3=belief; 4=cond1believability; 5=cond1support]
</expt> 

The hope was to have the verdict question after the trial summary (1) and before the manipulation check (2), but would that be possible if the verdict questions are only able to be ordered by putting them into an experiment? 


Thank you so much for your help!
darbyh
darbyh
Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)
Group: Forum Members
Posts: 22, Visits: 77
I'm sorry--just realized I could insert it as its own block. Thank you so much!!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search