Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Neeed to display some questions if I check many options

  • Bti2024
  • Bti2024's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 months 3 days ago #257081 by Bti2024
Please help us help you and fill where relevant:
Your LimeSurvey version: LimeSurvey Cloud
Version 5.6.54
Own server or LimeSurvey hosting:
Survey theme/template:
==================
Hi,

I have a multiple choice question (Type M) , 2 checked boxes.  My need is: if I checked one of those checked boxes it will display one or 2 questions.

For example (see attached picture): if I check the "Executif" choice it will display a question related to this choice. And if I checked both check boxes "Executif"+"Chef de projet" it will display the 2 related questions.

Thanks a lot!
 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 months 3 days ago #257083 by Joffm
And what is your question?
I suppose you know how a condition is set on a checkbox.

And to check if both are checked, you may simply use an AND to combine the two parts, like QCODE1 is checked AND QCODE2 is checked
Or you can use the function "count()" to checjk, like count(QCODE1,QCODE2)==2

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Bti2024
  • Bti2024's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 months 3 days ago #257093 by Bti2024
Thanks for your feedback ,no this is the first time I use check boxe type.

I used the QCODE1 is checked formulat as in the attached picture but doesnt work.


Knowing that the "Executive" check box response has the code SQ1.

Thanks
 

 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 months 3 days ago #257094 by Joffm
Hi,
if you read the manual you'd know that QCODE is a placeholder for the real question code.
[url] manual.limesurvey.org/ExpressionScript_-...code_variable_naming [/url]

Knowing that the "Executive" check box response has the code SQ1.

Okay, now you know how your "QCODE" looks like

Now in your condition you enter a logical term that is either TRUE or FALSE. If TRUE the question is displayed, if FALSE not.
To find out what "QCode is checked" means, the best is to activate your survey, enter some data and have a look at the response table.
Here you see, how you access the respective variables and how the answers are stored.
You have several options:
Either you say: 
QCode is not empty -> then it is selected. 
And in the "implemented functions"
[url] manual.limesurvey.org/ExpressionScript_-...mplemented_functions [/url]
you find the functiuon "is_empty()"
Here 
[url] manual.limesurvey.org/ExpressionScript_-...ntation/en#Operators [/url]
you see that "!" is the "not" operator.
Now "QCode is not empty" is in LimeSurvey syntax !is_empty(QCode)

Or you say 
QCode is equal to this value
If you followed my advice to activate the survey, enter data and investigate the response table, you will have seen that a multiple question stores
selected : "Y"
not selected: ""
 

Attachment not found


Meaning: To say "QCode is selected" in LimeSurvey syntax QCode=="Y"

Now yopu should be able to create your condition.

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose