branching in questionnaire problem with skipping question


branching in questionnaire problem with skipping question

Author
Message
Evelien
Evelien
Associate Member
Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)

Group: Forum Members
Posts: 3, Visits: 14
Hi,

In a questionnaire on drug use I want a follow-up question if the answer to the previous question (checkboxes) is on of a few options and another follow-up question if they reply with another type of drug use.
E.g. if one replies to have used alcohol only, I only want the follow-up questions for alcohol; if one replies to have used nothing, I want them to skip all the follow-up questions and if one replies to have used both alcohol and hard drugs, I want the follow-up questions for both alcohol and hard-drugs. 

I think something goes wrong with the "/ skip=[checkboxes.ZRM11middelen.response!="..alcohol gedronken."], and mainly the != part (the skip ..== script goes perfectly), but I can't see what. 

I attached some of the questions and the surveypage script. 

Hopefully someone can help me out! Thanks!
Evelien






Attachments
questionnaire drug use script.rtf (37 views, 12.00 KB)
Dave
Dave
Supreme Being
Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)

Group: Administrators
Posts: 9.2K, Visits: 39K
Evelien - Monday, April 16, 2018
Hi,

In a questionnaire on drug use I want a follow-up question if the answer to the previous question (checkboxes) is on of a few options and another follow-up question if they reply with another type of drug use.
E.g. if one replies to have used alcohol only, I only want the follow-up questions for alcohol; if one replies to have used nothing, I want them to skip all the follow-up questions and if one replies to have used both alcohol and hard drugs, I want the follow-up questions for both alcohol and hard-drugs. 

I think something goes wrong with the "/ skip=[checkboxes.ZRM11middelen.response!="..alcohol gedronken."], and mainly the != part (the skip ..== script goes perfectly), but I can't see what. 

I attached some of the questions and the surveypage script. 

Hopefully someone can help me out! Thanks!
Evelien






"..alcohol gedronken." (note the dot at the end) is not the response in <checkboxes ZRM11middelen>. The response is "..alcohol gedronken" _without_ any dot at the end:

< checkboxes ZRM11middelen>
/caption = "De volgende stellingen gaan over middelengebruik. In de afgelopen 30 dagen heb ik..: (U mag hier meerdere antwoorden kiezen)"
/ options = ("..alcohol gedronken", "..sigaretten gerookt",
, "..harddrugs gebruikt","..softdrugs gebruikt","..gegokt","..geen van bovenstaande middelen gebruikt. Ik heb ook niet gegokt.")
/orientation = vertical
/required = true
</ checkboxes >

I.e.

/ skip=[checkboxes.ZRM11middelen.response!="..alcohol gedronken."]

cannot work, it needs to read

/ skip=[checkboxes.ZRM11middelen.response!="..alcohol gedronken"]
Evelien
Evelien
Associate Member
Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)

Group: Forum Members
Posts: 3, Visits: 14
Dave - Monday, April 16, 2018
Evelien - Monday, April 16, 2018
Hi,

In a questionnaire on drug use I want a follow-up question if the answer to the previous question (checkboxes) is on of a few options and another follow-up question if they reply with another type of drug use.
E.g. if one replies to have used alcohol only, I only want the follow-up questions for alcohol; if one replies to have used nothing, I want them to skip all the follow-up questions and if one replies to have used both alcohol and hard drugs, I want the follow-up questions for both alcohol and hard-drugs. 

I think something goes wrong with the "/ skip=[checkboxes.ZRM11middelen.response!="..alcohol gedronken."], and mainly the != part (the skip ..== script goes perfectly), but I can't see what. 

I attached some of the questions and the surveypage script. 

Hopefully someone can help me out! Thanks!
Evelien






"..alcohol gedronken." (note the dot at the end) is not the response in <checkboxes ZRM11middelen>. The response is "..alcohol gedronken" _without_ any dot at the end:

< checkboxes ZRM11middelen>
/caption = "De volgende stellingen gaan over middelengebruik. In de afgelopen 30 dagen heb ik..: (U mag hier meerdere antwoorden kiezen)"
/ options = ("..alcohol gedronken", "..sigaretten gerookt",
, "..harddrugs gebruikt","..softdrugs gebruikt","..gegokt","..geen van bovenstaande middelen gebruikt. Ik heb ook niet gegokt.")
/orientation = vertical
/required = true
</ checkboxes >

I.e.

/ skip=[checkboxes.ZRM11middelen.response!="..alcohol gedronken."]

cannot work, it needs to read

/ skip=[checkboxes.ZRM11middelen.response!="..alcohol gedronken"]

thanks for the quick reply! that was a fairly stupid mistake...

however, if multiple checkboxes are ticked the follow-up questions do not show up either. (e.g. if alcohol only has been selected, the alcohol follow-up question does appear, but if alcohol and harddrugs have been selected no follow-up questions appear at all)

Also, the follow-up question which drug has been used does not appear:

/ skip=[checkboxes.ZRM11middelen.response!="..softdrugs gebruikt" ||
checkboxes.ZRM11middelen.response!="..harddrugs gebruikt"]

Dave
Dave
Supreme Being
Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)

Group: Administrators
Posts: 9.2K, Visits: 39K
Evelien - Monday, April 16, 2018
Dave - Monday, April 16, 2018
Evelien - Monday, April 16, 2018
Hi,

In a questionnaire on drug use I want a follow-up question if the answer to the previous question (checkboxes) is on of a few options and another follow-up question if they reply with another type of drug use.
E.g. if one replies to have used alcohol only, I only want the follow-up questions for alcohol; if one replies to have used nothing, I want them to skip all the follow-up questions and if one replies to have used both alcohol and hard drugs, I want the follow-up questions for both alcohol and hard-drugs. 

I think something goes wrong with the "/ skip=[checkboxes.ZRM11middelen.response!="..alcohol gedronken."], and mainly the != part (the skip ..== script goes perfectly), but I can't see what. 

I attached some of the questions and the surveypage script. 

Hopefully someone can help me out! Thanks!
Evelien






"..alcohol gedronken." (note the dot at the end) is not the response in <checkboxes ZRM11middelen>. The response is "..alcohol gedronken" _without_ any dot at the end:

< checkboxes ZRM11middelen>
/caption = "De volgende stellingen gaan over middelengebruik. In de afgelopen 30 dagen heb ik..: (U mag hier meerdere antwoorden kiezen)"
/ options = ("..alcohol gedronken", "..sigaretten gerookt",
, "..harddrugs gebruikt","..softdrugs gebruikt","..gegokt","..geen van bovenstaande middelen gebruikt. Ik heb ook niet gegokt.")
/orientation = vertical
/required = true
</ checkboxes >

I.e.

/ skip=[checkboxes.ZRM11middelen.response!="..alcohol gedronken."]

cannot work, it needs to read

/ skip=[checkboxes.ZRM11middelen.response!="..alcohol gedronken"]

thanks for the quick reply! that was a fairly stupid mistake...

however, if multiple checkboxes are ticked the follow-up questions do not show up either. (e.g. if alcohol only has been selected, the alcohol follow-up question does appear, but if alcohol and harddrugs have been selected no follow-up questions appear at all)

Also, the follow-up question which drug has been used does not appear:

/ skip=[checkboxes.ZRM11middelen.response!="..softdrugs gebruikt" ||
checkboxes.ZRM11middelen.response!="..harddrugs gebruikt"]

If you need to check for multiple options, the proper syntax would be

<checkboxes mycb>
/ options = ("a", "b", "c")
</checkboxes>

<surveypage mypage>
/ questions = [1=mycb]
</surveypage>

<surveypage a_or_b>
/ skip = [
    !checkboxes.mycb.selected.1 && !checkboxes.mycb.selected.2
]
/ caption = "you should only see this if you selected a or b"
</surveypage>

<block myblock>
/ trials = [1=mypage; 2=a_or_b]
</block>





Evelien
Evelien
Associate Member
Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)Associate Member (92 reputation)

Group: Forum Members
Posts: 3, Visits: 14
Dave - Tuesday, April 17, 2018
Evelien - Monday, April 16, 2018
Dave - Monday, April 16, 2018
Evelien - Monday, April 16, 2018
Hi,

In a questionnaire on drug use I want a follow-up question if the answer to the previous question (checkboxes) is on of a few options and another follow-up question if they reply with another type of drug use.
E.g. if one replies to have used alcohol only, I only want the follow-up questions for alcohol; if one replies to have used nothing, I want them to skip all the follow-up questions and if one replies to have used both alcohol and hard drugs, I want the follow-up questions for both alcohol and hard-drugs. 

I think something goes wrong with the "/ skip=[checkboxes.ZRM11middelen.response!="..alcohol gedronken."], and mainly the != part (the skip ..== script goes perfectly), but I can't see what. 

I attached some of the questions and the surveypage script. 

Hopefully someone can help me out! Thanks!
Evelien






"..alcohol gedronken." (note the dot at the end) is not the response in <checkboxes ZRM11middelen>. The response is "..alcohol gedronken" _without_ any dot at the end:

< checkboxes ZRM11middelen>
/caption = "De volgende stellingen gaan over middelengebruik. In de afgelopen 30 dagen heb ik..: (U mag hier meerdere antwoorden kiezen)"
/ options = ("..alcohol gedronken", "..sigaretten gerookt",
, "..harddrugs gebruikt","..softdrugs gebruikt","..gegokt","..geen van bovenstaande middelen gebruikt. Ik heb ook niet gegokt.")
/orientation = vertical
/required = true
</ checkboxes >

I.e.

/ skip=[checkboxes.ZRM11middelen.response!="..alcohol gedronken."]

cannot work, it needs to read

/ skip=[checkboxes.ZRM11middelen.response!="..alcohol gedronken"]

thanks for the quick reply! that was a fairly stupid mistake...

however, if multiple checkboxes are ticked the follow-up questions do not show up either. (e.g. if alcohol only has been selected, the alcohol follow-up question does appear, but if alcohol and harddrugs have been selected no follow-up questions appear at all)

Also, the follow-up question which drug has been used does not appear:

/ skip=[checkboxes.ZRM11middelen.response!="..softdrugs gebruikt" ||
checkboxes.ZRM11middelen.response!="..harddrugs gebruikt"]

If you need to check for multiple options, the proper syntax would be

<checkboxes mycb>
/ options = ("a", "b", "c")
</checkboxes>

<surveypage mypage>
/ questions = [1=mycb]
</surveypage>

<surveypage a_or_b>
/ skip = [
    !checkboxes.mycb.selected.1 && !checkboxes.mycb.selected.2
]
/ caption = "you should only see this if you selected a or b"
</surveypage>

<block myblock>
/ trials = [1=mypage; 2=a_or_b]
</block>





Hi Dave,

thanks for all the help!

Most of the syntax works fine now. Only one thing puzzles me; I have several different follow-up questions following different responses. Most of the time it works fine, but some (??) of the combinations don't always work.

e.g. when someone answers to type of drugs used, both alcohol AND softdrugs, the softdrugs follow-up questions does appear, but the alcohol questions does not. However, in exactly the same situations but when alcohol and harddrugs are selected, both the alcohol and harddrugs follow-up questions appear correctly. The harddrugs and softdrugs follow-up question always appear when they need to, it's the alcohol question which sometimes does and sometimes doesn't appear, depending on the combination with which other drugs is selected as well. I tried different combinations to find out where it goes wrong; with all types selected it doesn't appear, also it doesn't with alcohol, softdrugs, harddrugs and sigarettes selected, and neither with alcohol and softdrugs selected. However, in alcohol in combination with harddrugs only, or with sigarettes only, or in combination with sigarettes and softdrugs it does appear. 

I attached the parts in the script on the types of drugs and the follow-up questions. 

 I hope you can help me figure out why some combinations work to show the correct follow-up questions and other combinations don't!  

thanks in advance!













Attachments
180514_zrm script alcohol.docx (46 views, 3.00 KB)
Dave
Dave
Supreme Being
Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)Supreme Being (516K reputation)

Group: Administrators
Posts: 9.2K, Visits: 39K
Evelien - Monday, May 14, 2018
Dave - Tuesday, April 17, 2018
Evelien - Monday, April 16, 2018
Dave - Monday, April 16, 2018
Evelien - Monday, April 16, 2018
Hi,

In a questionnaire on drug use I want a follow-up question if the answer to the previous question (checkboxes) is on of a few options and another follow-up question if they reply with another type of drug use.
E.g. if one replies to have used alcohol only, I only want the follow-up questions for alcohol; if one replies to have used nothing, I want them to skip all the follow-up questions and if one replies to have used both alcohol and hard drugs, I want the follow-up questions for both alcohol and hard-drugs. 

I think something goes wrong with the "/ skip=[checkboxes.ZRM11middelen.response!="..alcohol gedronken."], and mainly the != part (the skip ..== script goes perfectly), but I can't see what. 

I attached some of the questions and the surveypage script. 

Hopefully someone can help me out! Thanks!
Evelien






"..alcohol gedronken." (note the dot at the end) is not the response in <checkboxes ZRM11middelen>. The response is "..alcohol gedronken" _without_ any dot at the end:

< checkboxes ZRM11middelen>
/caption = "De volgende stellingen gaan over middelengebruik. In de afgelopen 30 dagen heb ik..: (U mag hier meerdere antwoorden kiezen)"
/ options = ("..alcohol gedronken", "..sigaretten gerookt",
, "..harddrugs gebruikt","..softdrugs gebruikt","..gegokt","..geen van bovenstaande middelen gebruikt. Ik heb ook niet gegokt.")
/orientation = vertical
/required = true
</ checkboxes >

I.e.

/ skip=[checkboxes.ZRM11middelen.response!="..alcohol gedronken."]

cannot work, it needs to read

/ skip=[checkboxes.ZRM11middelen.response!="..alcohol gedronken"]

thanks for the quick reply! that was a fairly stupid mistake...

however, if multiple checkboxes are ticked the follow-up questions do not show up either. (e.g. if alcohol only has been selected, the alcohol follow-up question does appear, but if alcohol and harddrugs have been selected no follow-up questions appear at all)

Also, the follow-up question which drug has been used does not appear:

/ skip=[checkboxes.ZRM11middelen.response!="..softdrugs gebruikt" ||
checkboxes.ZRM11middelen.response!="..harddrugs gebruikt"]

If you need to check for multiple options, the proper syntax would be

<checkboxes mycb>
/ options = ("a", "b", "c")
</checkboxes>

<surveypage mypage>
/ questions = [1=mycb]
</surveypage>

<surveypage a_or_b>
/ skip = [
    !checkboxes.mycb.selected.1 && !checkboxes.mycb.selected.2
]
/ caption = "you should only see this if you selected a or b"
</surveypage>

<block myblock>
/ trials = [1=mypage; 2=a_or_b]
</block>





Hi Dave,

thanks for all the help!

Most of the syntax works fine now. Only one thing puzzles me; I have several different follow-up questions following different responses. Most of the time it works fine, but some (??) of the combinations don't always work.

e.g. when someone answers to type of drugs used, both alcohol AND softdrugs, the softdrugs follow-up questions does appear, but the alcohol questions does not. However, in exactly the same situations but when alcohol and harddrugs are selected, both the alcohol and harddrugs follow-up questions appear correctly. The harddrugs and softdrugs follow-up question always appear when they need to, it's the alcohol question which sometimes does and sometimes doesn't appear, depending on the combination with which other drugs is selected as well. I tried different combinations to find out where it goes wrong; with all types selected it doesn't appear, also it doesn't with alcohol, softdrugs, harddrugs and sigarettes selected, and neither with alcohol and softdrugs selected. However, in alcohol in combination with harddrugs only, or with sigarettes only, or in combination with sigarettes and softdrugs it does appear. 

I attached the parts in the script on the types of drugs and the follow-up questions. 

 I hope you can help me figure out why some combinations work to show the correct follow-up questions and other combinations don't!  

thanks in advance!













Please reference the questions and options you are referring to by name exactly as they are called in the script. Also, please attach code that is actually runnable. It's not possible for me to determine when what surveypage is actually supposed to be run from the code you attached.

With that said, I am unable to reproduce this

"with all types selected it [the alcohol follow-up] doesn't appear"

when putting the code you attached into an executable form (i.e. adding a block that actually runs the pages). See the attached script and data file.

So please provide an actually executable script that exhibits the issue for you and a data file that illustrates it. Thanks!

Attachments
script.iqx (109 views, 5.00 KB)
script_raw.iqdat (106 views, 1.00 KB)
GO


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....






Millisecond Forums


Search