Welcome to the LimeSurvey Community Forum

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

To display ramdomly not selected choice

  • Chouchicorita
  • Chouchicorita's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
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 ! 

 
Last edit: 3 years 4 weeks ago by Chouchicorita.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 weeks ago #214103 by tpartner
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
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 weeks ago #214109 by Joffm
Replied by Joffm on topic To display ramdomly not selected choice
Hi,
you say 

If the answer is pizza, there appears pasta or salade in following question. 

Does it mean one of the not selected dishes randomly?

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
  • Chouchicorita's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
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 ?
Last edit: 3 years 4 weeks ago by Chouchicorita.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 weeks ago #214124 by Joffm
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.

   



 

File Attachment:

File Name: limesurvey...5635.lss
File Size:21 KB


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
  • Chouchicorita's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
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
  • Chouchicorita's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
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.
 

File Attachment:

File Name: limesurvey...0326.lsq
File Size:6 KB


Thank you in advance. 
Last edit: 3 years 2 weeks ago by Chouchicorita.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 weeks ago #214585 by Joffm
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


 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 weeks ago - 3 years 2 weeks ago #214587 by Joffm
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
  • Chouchicorita's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
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
 

File Attachment:

File Name: limesurvey...78-2.lss
File Size:21 KB


Best regards 
Last edit: 3 years 2 weeks ago by Chouchicorita.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 weeks ago #214626 by Joffm
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:
 

File Attachment:

File Name: limesurvey...3978.lss
File Size:25 KB


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
  • Chouchicorita's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
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 ?
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose