- Posts: 5
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Display questions only if 3 or more answers are selected in the previous MCquest
- dianavieiraf
- Topic Author
- Offline
- New Member
Less
More
4 years 4 weeks ago #195933
by dianavieiraf
Display questions only if 3 or more answers are selected in the previous MCquest was created by dianavieiraf
Hello,
I want to display a question only if the participant selects 3 or more answers in the previous multiple choice question. I've tried to insert count(PTSDJ4.NAOK) > 3 in question relevance but it keeps saying that the variable is not defined, even though it is (I think). I have also read a lot of manuals but I could not find a solution in any of them.
I'm not very familiar with LimeSurvey, so I would really appreciate if you could explain this to me!
Thanks!
I want to display a question only if the participant selects 3 or more answers in the previous multiple choice question. I've tried to insert count(PTSDJ4.NAOK) > 3 in question relevance but it keeps saying that the variable is not defined, even though it is (I think). I have also read a lot of manuals but I could not find a solution in any of them.
I'm not very familiar with LimeSurvey, so I would really appreciate if you could explain this to me!
Thanks!
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12937
- Thank you received: 3979
4 years 4 weeks ago - 4 years 4 weeks ago #195937
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Display questions only if 3 or more answers are selected in the previous MCquest
PTSDJ4 is the code of the question. But you really want to count the subquestions.
So the "count" of the question is obviously useless and not supported by this function.
You have to use:
count(PTSDJ4_SQ001.NAOK, PTSDJ4_SQ002.NAOK,...)>3
To shorten this you may use the "that" variable.
manual.limesurvey.org/ExpressionScript_-....22that.22_variables
You will see that
count(that.PTSDJ4.NAOK) > 3
expands to
count(PTSDJ4_SQ001.NAOK, PTSDJ4_SQ002.NAOK, PTSDJ4_SQ003.NAOK, PTSDJ4_SQ004.NAOK, PTSDJ4_SQ005.NAOK, PTSDJ4_SQ006.NAOK, PTSDJ4_SQ007.NAOK) > 3
You see that now the subquestions are counted; of course only "selected" subquestions are counted.
Joffm
So the "count" of the question is obviously useless and not supported by this function.
You have to use:
count(PTSDJ4_SQ001.NAOK, PTSDJ4_SQ002.NAOK,...)>3
To shorten this you may use the "that" variable.
manual.limesurvey.org/ExpressionScript_-....22that.22_variables
You will see that
count(that.PTSDJ4.NAOK) > 3
expands to
count(PTSDJ4_SQ001.NAOK, PTSDJ4_SQ002.NAOK, PTSDJ4_SQ003.NAOK, PTSDJ4_SQ004.NAOK, PTSDJ4_SQ005.NAOK, PTSDJ4_SQ006.NAOK, PTSDJ4_SQ007.NAOK) > 3
You see that now the subquestions are counted; of course only "selected" subquestions are counted.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 4 weeks ago by Joffm.
The topic has been locked.
- dianavieiraf
- Topic Author
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
4 years 4 weeks ago #195945
by dianavieiraf
Replied by dianavieiraf on topic Display questions only if 3 or more answers are selected in the previous MCquest
Thanks!!!
The topic has been locked.