- Posts: 11
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
question text
- plab
- Topic Author
- Offline
- New Member
Less
More
6 years 10 months ago #154954
by plab
question text was created by plab
Hi there,
how can I show the question text in different sequence?
for example the question is:
Thinking about public expenditure on UNEMPLOYMENT BENEFITS, DEFENSE, OLD-AGE PENSIONS, and WELFARE BENEFITS, which one you think should be more than now?
some people will see the other sequence, like
Thinking about public expenditure on OLD-AGE PENSIONS, UNEMPLOYMENT BENEFITS, WELFARE BENEFITS and OLD-AGE PENSIONS, which one you think should be more than now?
Thinking about public expenditure on OLD-AGE PENSIONS, WELFARE BENEFITS, OLD-AGE PENSIONS and UNEMPLOYMENT BENEFITS, which one you think should be more than now?
is that we can do this question text type on the limesurvey?
many thanks.
how can I show the question text in different sequence?
for example the question is:
Thinking about public expenditure on UNEMPLOYMENT BENEFITS, DEFENSE, OLD-AGE PENSIONS, and WELFARE BENEFITS, which one you think should be more than now?
some people will see the other sequence, like
Thinking about public expenditure on OLD-AGE PENSIONS, UNEMPLOYMENT BENEFITS, WELFARE BENEFITS and OLD-AGE PENSIONS, which one you think should be more than now?
Thinking about public expenditure on OLD-AGE PENSIONS, WELFARE BENEFITS, OLD-AGE PENSIONS and UNEMPLOYMENT BENEFITS, which one you think should be more than now?
is that we can do this question text type on the limesurvey?
many thanks.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10632
- Thank you received: 3697
6 years 10 months ago - 6 years 10 months ago #154965
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic question text
You can use Expression Manager to load a hidden equation question with a random number between 1 and 3. Then you can use nested IF statements to display one of those 3 text strings.
Code:
{if(random == 1, 'Text string 1.', if(random == 2, 'Text string 2.', 'Text string 3.'))}
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 6 years 10 months ago by tpartner.
The topic has been locked.
- plab
- Topic Author
- Offline
- New Member
Less
More
- Posts: 11
- Thank you received: 1
6 years 10 months ago - 6 years 10 months ago #154989
by plab
Replied by plab on topic question text
Attached file 1 is the hidden equation question with a random number between 1 and 3.
Attached file 2 is when I setting the question, I have no idea where the nested IF statements should be display.
Attached file 2 is when I setting the question, I have no idea where the nested IF statements should be display.
Code:
{if(random == 1, 'Text string 1.', if(random == 2, 'Text string 2.', 'Text string 3.'))}
Last edit: 6 years 10 months ago by plab.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10632
- Thank you received: 3697
6 years 10 months ago #155008
by tpartner
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic question text
It's simply placed in the question text.I have no idea where the nested IF statements should be display.
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The following user(s) said Thank You: plab
The topic has been locked.
- plab
- Topic Author
- Offline
- New Member
Less
More
- Posts: 11
- Thank you received: 1
6 years 10 months ago - 6 years 10 months ago #155044
by plab
Replied by plab on topic question text
many thanks.
IF I have more than 3 Text string need to show in different sequence, how the nested IF statements should be present?
or
BECAUSE I need more than 6 Text string to show in different sequence, but when I try 5, it seems to some problem.
IF I have more than 3 Text string need to show in different sequence, how the nested IF statements should be present?
Code:
{if(random == 1, 'Text string 1.', if(random == 2, 'Text string 2.', 'Text string 3.', 'Text string 4.', 'Text string 5.'))}
or
Code:
{if(random == 1, 'Text string 1.', if(random == 2, 'Text string 2.', if(random == 3, 'Text string 3.', 'Text string 4.', 'Text string 5.'))}
BECAUSE I need more than 6 Text string to show in different sequence, but when I try 5, it seems to some problem.
Attachments:
Last edit: 6 years 10 months ago by plab.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10632
- Thank you received: 3697
6 years 10 months ago #155058
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic question text
The IF statements work like this:
If nesting (multiple IF statements) is necessary, replace 'Returned result if false' with another complete IF statement like this (line-breaks inserted for clarity):
So, in your example, it would be like this (line-breaks inserted for clarity):
Code:
{if(condition, 'Returned result if true', 'Returned result if false')}
If nesting (multiple IF statements) is necessary, replace 'Returned result if false' with another complete IF statement like this (line-breaks inserted for clarity):
Code:
{if(condition1, 'Returned if true', if(condition2, 'Returned if true', if(condition3, 'Returned if true', if(condition4, 'Returned if true', if(condition5, 'Returned if true', 'Returned if all conditions false' ))))}
So, in your example, it would be like this (line-breaks inserted for clarity):
Code:
{if(random == 1, 'Text string 1.', if(random == 2, 'Text string 2.', if(random == 3, 'Text string 3.', if(random == 4, 'Text string 4.', 'Text string 5.' ))))}
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: plab
The topic has been locked.