- Posts: 23
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
To display ramdomly not selected choice
- Chouchicorita
- Topic Author
- Offline
- Junior Member
Less
More
3 years 4 weeks ago - 3 years 4 weeks ago #214098
by Chouchicorita
To display ramdomly not selected choice was created by Chouchicorita
Hi,
I know the function {question code_reponse code.shown} to display the answer of previous question and i wonder if it is possible to show one of the choices not selected in previous question. (If possible, without using Javascript because i'm not really familiar with use of the language)
For example, Q. What kind of dishes did you take ? A. Pizza ; Pasta ; Salad
If the answer is pizza, there appears pasta or salade in following question.
Thank you !
I know the function {question code_reponse code.shown} to display the answer of previous question and i wonder if it is possible to show one of the choices not selected in previous question. (If possible, without using Javascript because i'm not really familiar with use of the language)
For example, Q. What kind of dishes did you take ? A. Pizza ; Pasta ; Salad
If the answer is pizza, there appears pasta or salade in following question.
Thank you !
Last edit: 3 years 4 weeks ago by Chouchicorita.
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
3 years 4 weeks ago #214103
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 To display ramdomly not selected choice
Not directly, but assuming Q1 is a multiple choice, you can do something like this:
Code:
{if(is_empty(Q1_SQ001), ' Pizza', '')}{if(is_empty(Q1_SQ002), ' Pasta', '')}{if(is_empty(Q1_SQ003), ' Salad', '')}
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: DenisChenu, Chouchicorita
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12921
- Thank you received: 3977
3 years 4 weeks ago #214109
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic To display ramdomly not selected choice
Hi,
you say
And what is the following question?.
Do you want to display this one selected dish? Or as subquestion-/answer option?
Like this?
Joffm
you say
Does it mean one of the not selected dishes randomly?If the answer is pizza, there appears pasta or salade in following question.
And what is the following question?.
Do you want to display this one selected dish? Or as subquestion-/answer option?
Like this?
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Chouchicorita
The topic has been locked.
- Chouchicorita
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 23
- Thank you received: 0
3 years 4 weeks ago - 3 years 4 weeks ago #214114
by Chouchicorita
Replied by Chouchicorita on topic To display ramdomly not selected choice
Yes exactly, in order that one of the not selected answers randomly appears. Actually, i'd like to have it appearing in the name of following question group.
Could you let me know how to make it work ?
Could you let me know how to make it work ?
Last edit: 3 years 4 weeks ago by Chouchicorita.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12921
- Thank you received: 3977
3 years 4 weeks ago #214124
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic To display ramdomly not selected choice
Here you are.
This is the "long" version with three equations.
In my opinion it is easier to understand and to adapt.
At the moment these equations are not hidden; so you see what happens.
In your real survey you will hide them.
You could combine all equations into one, but this is really confusing
Joffm
This is the "long" version with three equations.
In my opinion it is easier to understand and to adapt.
At the moment these equations are not hidden; so you see what happens.
In your real survey you will hide them.
You could combine all equations into one, but this is really confusing
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Chouchicorita
The topic has been locked.
- Chouchicorita
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 23
- Thank you received: 0
3 years 4 weeks ago #214155
by Chouchicorita
Replied by Chouchicorita on topic To display ramdomly not selected choice
Thank you, it works !
The topic has been locked.
- Chouchicorita
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 23
- Thank you received: 0
3 years 2 weeks ago - 3 years 2 weeks ago #214582
by Chouchicorita
Replied by Chouchicorita on topic To display ramdomly not selected choice
Hi,
I encountered another problem intergrating this function and i'd like you to take a look at it.
The dishes (from 1 to 6) should be conditionned to answers of the previous question which asks "in which restaurant did you take the dish ?". The fact is that available dishes can vary from one restaurant to another (in case of dish 5 and 6). In this case, the possible "not selected choice" which appears in the next question (in the text of G2) should be conditionned as well, in order that the not selected choice is randomly selected not from all of the rest, but from the rest of possible choices left according to the restaurant.
For example, i don't want dish 5 to appear as a non choice, for those who chose restaurant C. Simply because dish 5 is not a possible option in this restaurant.
Please check the file attached below.
Thank you in advance.
I encountered another problem intergrating this function and i'd like you to take a look at it.
The dishes (from 1 to 6) should be conditionned to answers of the previous question which asks "in which restaurant did you take the dish ?". The fact is that available dishes can vary from one restaurant to another (in case of dish 5 and 6). In this case, the possible "not selected choice" which appears in the next question (in the text of G2) should be conditionned as well, in order that the not selected choice is randomly selected not from all of the rest, but from the rest of possible choices left according to the restaurant.
For example, i don't want dish 5 to appear as a non choice, for those who chose restaurant C. Simply because dish 5 is not a possible option in this restaurant.
Please check the file attached below.
Thank you in advance.
Last edit: 3 years 2 weeks ago by Chouchicorita.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12921
- Thank you received: 3977
3 years 2 weeks ago #214585
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic To display ramdomly not selected choice
Please, do not send lsq nor lsg exports, only lss.
lsq (question) and lsg (group) exports are language sensitive.
You cannot import a lsg export into a survey with a different base language.
So if you send a lsq/lsg export we have to create a survey - hopefully with the correct base language - to be able to import the export.
And these exports do not include the gemeral settings of a survey which often are inportant.
Therefore copy your survey, remove all questions not related to your problem / your question and send this as lss export.
Kind regards
Joffm
lsq (question) and lsg (group) exports are language sensitive.
You cannot import a lsg export into a survey with a different base language.
So if you send a lsq/lsg export we have to create a survey - hopefully with the correct base language - to be able to import the export.
And these exports do not include the gemeral settings of a survey which often are inportant.
Therefore copy your survey, remove all questions not related to your problem / your question and send this as lss export.
Kind regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12921
- Thank you received: 3977
3 years 2 weeks ago - 3 years 2 weeks ago #214587
by Joffm
Then add something to the join equation, like
if(is_empty(Q1_SQ005) and Qrestaurant!="C","E","")
Now letter "E" is only added if the dish Q1_SQ005 was not selected and the Restaurant question "Qrestaurant" was not answered "C".
Or you use the property "relevanceStatus"
like
if(is_empty(Q1_SQ005) and Q1_SQ005.relevanceStatus==1,"E","")
meaning Q1_SQ005 was empty, but it was displayed.
Read this part of the manual
[url] manual.limesurvey.org/ExpressionScript_-...#Access_to_variables [/url]
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic To display ramdomly not selected choice
For example, i don't want dish 5 to appear as a non choice, for those who chose restaurant C
Then add something to the join equation, like
if(is_empty(Q1_SQ005) and Qrestaurant!="C","E","")
Now letter "E" is only added if the dish Q1_SQ005 was not selected and the Restaurant question "Qrestaurant" was not answered "C".
Or you use the property "relevanceStatus"
like
if(is_empty(Q1_SQ005) and Q1_SQ005.relevanceStatus==1,"E","")
meaning Q1_SQ005 was empty, but it was displayed.
Read this part of the manual
[url] manual.limesurvey.org/ExpressionScript_-...#Access_to_variables [/url]
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 2 weeks ago by Joffm.
The topic has been locked.
- Chouchicorita
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 23
- Thank you received: 0
3 years 2 weeks ago - 3 years 2 weeks ago #214618
by Chouchicorita
Replied by Chouchicorita on topic To display ramdomly not selected choice
Hi,
I'm sorry, i thought that i attached Iss file. I've realized i didn't upload the right file.
So i inserted the Qrestaurant! command, but the problem is, when i choose restaurant C and the dish 6, the dish 6 appears as a non choice, which is completely illogical.
May i have a solution to this problem ?
Below is the questionnaire iss file
Best regards
I'm sorry, i thought that i attached Iss file. I've realized i didn't upload the right file.
So i inserted the Qrestaurant! command, but the problem is, when i choose restaurant C and the dish 6, the dish 6 appears as a non choice, which is completely illogical.
May i have a solution to this problem ?
Below is the questionnaire iss file
Best regards
Last edit: 3 years 2 weeks ago by Chouchicorita.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12921
- Thank you received: 3977
3 years 2 weeks ago #214626
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic To display ramdomly not selected choice
Hi,
But you saw that in my example that the questions are displayed "question by question"?
If you display "group by group" this will not work.
It can't be on the same page.
You have to restructure a bit.
Like this:
Joffm
I would not show The Restaurants and the dishes on the same page.
Doesn't look professionally that the dishes change while selecting a restaurant.
But you saw that in my example that the questions are displayed "question by question"?
If you display "group by group" this will not work.
It can't be on the same page.
You have to restructure a bit.
Like this:
Joffm
I would not show The Restaurants and the dishes on the same page.
Doesn't look professionally that the dishes change while selecting a restaurant.
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- Chouchicorita
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 23
- Thank you received: 0
3 years 2 weeks ago #214670
by Chouchicorita
Replied by Chouchicorita on topic To display ramdomly not selected choice
Hi,
I really appreciate your answer.
So do you mean i should separate hidden conditioning questions (eq) from visible questions ? And the final showing phrase (non choice) from two other groups as well ?
I really appreciate your answer.
So do you mean i should separate hidden conditioning questions (eq) from visible questions ? And the final showing phrase (non choice) from two other groups as well ?
The topic has been locked.