- Posts: 12943
- Thank you received: 3979
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Can I select a random answer from a multiple choice question
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
4 years 9 months ago - 4 years 9 months ago #186456
by Joffm
No, because there are only if-statements but nothing what you want to join.
And, please, send a whole survey (*.lss) with only the relevant questions.
lsq and lsg are language dependent.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Can I select a random answer from a multiple choice question
that would mean, my example 2 should work properly although it doesn't, right?
No, because there are only if-statements but nothing what you want to join.
And, please, send a whole survey (*.lss) with only the relevant questions.
lsq and lsg are language dependent.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 9 months ago by Joffm.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12943
- Thank you received: 3979
4 years 9 months ago - 4 years 9 months ago #186461
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Can I select a random answer from a multiple choice question
Hi, here your survey back.
There was an error in the join-statement. (no brackets in front of the "if")
join(if( ! is_empty(NW1_SQ001), "01", ""),(if( ! is_empty(NW1_SQ002), "02", ""),(if( ! is_empty(NW1_SQ003), "03", ""),...
The bracket in front of the first "if" is the bracket of the join function.
And I set subquestion relevance to zhe first question so that one row after the other is displayed.
And the equations have to be on a different page.
I explained it already in a different post with the same approach.
www.limesurvey.org/forum/can-i-do-this-w...ildren-randomization
If the random-function is on the same page it will be fired each time and each time you will get a new value.
To avoid this we use "if(is_empty(random),rand(1,5),random).
But in this case the random function will fire after your first entry, selects "1" as random value, which never is changed.
Best regards
Joffm
There was an error in the join-statement. (no brackets in front of the "if")
join(if( ! is_empty(NW1_SQ001), "01", ""),(if( ! is_empty(NW1_SQ002), "02", ""),(if( ! is_empty(NW1_SQ003), "03", ""),...
The bracket in front of the first "if" is the bracket of the join function.
And I set subquestion relevance to zhe first question so that one row after the other is displayed.
And the equations have to be on a different page.
I explained it already in a different post with the same approach.
www.limesurvey.org/forum/can-i-do-this-w...ildren-randomization
If the random-function is on the same page it will be fired each time and each time you will get a new value.
To avoid this we use "if(is_empty(random),rand(1,5),random).
But in this case the random function will fire after your first entry, selects "1" as random value, which never is changed.
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 9 months ago by Joffm.
The following user(s) said Thank You: Nighthawlk
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12943
- Thank you received: 3979
4 years 9 months ago #186475
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Can I select a random answer from a multiple choice question
Furthermore: remove the equation "JOIN".
It is not used ib your survey.
You see, you use all filled fields of your first question.
The "trick" to create a string by joining characters was used if you'd only consider entries that have to fulfill a condition.
Joffm
It is not used ib your survey.
You see, you use all filled fields of your first question.
The "trick" to create a string by joining characters was used if you'd only consider entries that have to fulfill a condition.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Nighthawlk
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12943
- Thank you received: 3979
4 years 9 months ago #186477
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Can I select a random answer from a multiple choice question
Another addition:
You may shorten your "count" equation by:
{countifop(">","",that.NW1)}
You may read here:
manual.limesurvey.org/Expression_Manager....22that.22_variables
and
manual.limesurvey.org/Expression_Manager...mplemented_functions
Joffm
You may shorten your "count" equation by:
{countifop(">","",that.NW1)}
You may read here:
manual.limesurvey.org/Expression_Manager....22that.22_variables
and
manual.limesurvey.org/Expression_Manager...mplemented_functions
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- Nighthawlk
- Offline
- New Member
Less
More
- Posts: 6
- Thank you received: 0
4 years 9 months ago #186491
by Nighthawlk
Replied by Nighthawlk on topic Can I select a random answer from a multiple choice question
Thank you very much, it is working properly
you saved my day
you saved my day
The topic has been locked.