Welcome to the LimeSurvey Community Forum

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

If question A is answered yes, quesiton B will has 50% probablity of being shown

  • LISHANGQI
  • LISHANGQI's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 6 months ago #222873 by LISHANGQI
Please help us help you and fill where relevant: [3.27.24]
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting: Own
Theme: If question A is answered yes, quesiton B will has 50% probablity of being shown

==================
Dear all, 

I was wondering if I can set a condition to a question with a certain probability?  

For example,  if certain options in question A are selected, I  want question B to be 50% possibility to be shown. 

Is this possible in Limesurvey? If so, would you please provide me with some ideas? Thanks in advance!

Best regards,
LSQ
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 6 months ago - 3 years 6 months ago #222882 by Joffm

if certain options in question A are selected

Please, which options, which type of question?

So a rough answer:

1. Create a question of type equation (eq1) that gives a result of 1, if the "certain options" are selected or 2, if not.
No example possible without more details.

2. Create a question of type equation (eq2) where you generate a random number between 1 and 2, if the first equation is 1 and a fixed value of 2, if the first equation is 2.
Like
{if(eq1==1,if(is_empty(eq2),rand(1,2),eq2),2)}
So, only if eq1==1 a random number is created otherwise the value of eq2 is 2.

And your question B gets the relevance equation: eq2==1

Joffm

If I take your topic into account "If question A is answered yes"
then it is more simple; you have only one equation

eq2
{if(QA=="Y",if(is_empty(eq2),rand(1,2),eq2),2)}

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 6 months ago by Joffm.
The following user(s) said Thank You: DenisChenu, LISHANGQI
The topic has been locked.
  • LISHANGQI
  • LISHANGQI's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 6 months ago #222884 by LISHANGQI
Thank you very much Joffm, I got the solution!
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose