Welcome to the LimeSurvey Community Forum

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

Can I use answer of ranking question in following questions?

  • rockyist
  • rockyist's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 5 months ago - 1 year 5 months ago #242307 by rockyist
  Please help us help you and fill where relevant:
Your LimeSurvey version: [Version 5.6.14+230403]
Own server or LimeSurvey hosting: 
Survey theme/template: 
==================
Hello guys.
I'm working on a survey with ranking questions. Now I want to use the answer to the ranking question (I want to use the first four choices later). 
In my case, I want the respondents to choose their first four preferred travel modes, then the selected options in ranking will be used as subquestions in the next question (as shown in the attached). 
In my survey, I used information from previous questions by SGQA in JavaScript (e.g., "{INSERTANS:479167X12X4373SQ1}"). But I didn't find an example of ranking question SGQA. 

Do you have any idea how I can achieve it?

 

File Attachment:

File Name: limesurvey...4-11.lss
File Size:34 KB
Last edit: 1 year 5 months ago by rockyist.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 5 months ago #242309 by Joffm
Hi,
please don't send lsq nor lsg exports, only lss.

To answer your question:
Don't use this "Insertans" stuff.
It's outdated. Use ExpressionScript!

It's just (Q1 code of rank question)
1st ranked object: {Q1_1}
2nd ranked object: {Q1_2}

I always advise to activate the survey, enter some responses, and have a look at the answer table.
Here you see how to access your variables

Joffm 
​​​​​​

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

  • rockyist
  • rockyist's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 5 months ago #242314 by rockyist
Hello Joffm,

Thank you for your quick response. Based on your suggestion, I have re-uploaded the survey file (.lss). And ExpressionScript works well in the test survey!!!

Please Log in to join the conversation.

  • rockyist
  • rockyist's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 5 months ago #242685 by rockyist
Hello Joffm,

I'm still working on the ranking question, but now ranking options will be filtered before the question. Some factors affect whether a specific travel mode will be displayed in the ranking question. If a person cannot walk or cycle, walking or a private bike will not appear in the ranking question. If they say "I'll never use shared scooter" in an irrelevant question, then the shared scooter will also disappear from the ranking options. 
I understand both expression manager and JS code can achieve it. But I'm not aware of where I made a mistake. I will really appreciate it if you can have a look at my code in the question ranking (as attached below). 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 5 months ago #242696 by Joffm
Buzzword: Array exclusion filter

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • rockyist
  • rockyist's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 5 months ago #242697 by rockyist
Thanks. But can I achieve what I want in exclusion filter?
Because WalkingAbility and CycleAbility questions don't have the same subquestion code as that in the ranking question.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 5 months ago #242702 by Joffm
Sorry, I missed this.

Assign this to the "multiple question" by an expression like{IrrelavantCopy_SQ1=if(WalkingAbilityCopy=="Y","Y",IrrelavantCopy_SQ1)}{IrrelavantCopy_SQ2=if(CycleAbilityCopy=="Y","Y",IrrelavantCopy_SQ2)}You should not display it in the same group

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • rockyist
  • rockyist's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 5 months ago #242729 by rockyist
Thank you, Joffm.

I tried to add these expressions to my question, but it doesn't work. No the options in the multiple question cannot be affected by previous options. Could you share the successfully working .lss file?

Please Log in to join the conversation.

  • rockyist
  • rockyist's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 5 months ago - 1 year 5 months ago #242730 by rockyist
Now I see the result shown as "true" or " ". But what I want is the option is shown or hidden/disabled based on the previous answer.
Last edit: 1 year 5 months ago by rockyist.

Please Log in to join the conversation.

  • rockyist
  • rockyist's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 5 months ago #242731 by rockyist
Another point is how I can refer to the ranking choices. If ranking can be referred to in the expression (e.g., {Preference_SQ1}, how about the choices (before they are selected or double-clicked)?

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 5 months ago #242733 by Joffm
Where is your lss export?

How can we know what you did (and what you did wrong) without seeing it?

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • rockyist
  • rockyist's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 5 months ago #242734 by rockyist
Now I uploaded it again. Please check it. 
You can see two groups in this lss. What I want is explained here: people will answer the first two questions (in the first group), then the first question in the second group (irrelevant). If they choose yes in the "WalkingAbility" question or "CycleAbility" question, then Walking and Private bike will not be displayed in the ranking question as choices. If they choose the private car in the irrelevant question, then private car will not be displayed in the ranking question either. 

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose