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
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago - 4 years 8 months ago #186456 by Joffm

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 8 months ago by Joffm.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago - 4 years 8 months ago #186461 by Joffm
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

File Attachment:

File Name: limesurvey...3929.lss
File Size:33 KB

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 8 months ago by Joffm.
The following user(s) said Thank You: Nighthawlk
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago #186475 by Joffm
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

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
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago #186477 by Joffm
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

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
4 years 8 months ago #186491 by Nighthawlk
Thank you very much, it is working properly :)

you saved my day :)
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose