Welcome to the LimeSurvey Community Forum

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

Re-ordering subquestions (multiple input) from previous answers (rank)

  • Filippo_nov
  • Filippo_nov's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 1 month ago #195462 by Filippo_nov
Hi everyone,

I'm new to LS and I'm trying to find out a way to order subquestions according to the answer to a previous question.

I'd like to ask the respondent to rank N items (ranking question) and then use the result to order the subquestions of a multiple input question.

For example:
Ranking question results:
    Coffee (#1)
    Tea (#2)
    Water (#3)


Multiple input question:
  1. Coffee [input field]
  2. Tea [input field]
  3. Water [input field]

Any clue?

Thank you!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 1 month ago #195466 by Joffm
Hi,
I hope you already activated your prototype survey, entered some data and had a look at the answer table.
This is important to know how the values of different question types are stored.

Well, in a ranking question (let's call it R1) the storage is:
R1_1 contains the code of the item on 1st place
R1_2 contains the code of the item on 2nd place
R1_3 contains the code of the item on 3rd place
...

As you might have read in the manual
manual.limesurvey.org/Expression_Manager#Access_to_Variables

Qcode.shown the dispay value for the question

So you just have to enter as subquestions of your multiple question
{R1_1.shown}
{R1_2.shown}
...

That's fine to display, but difficult to analyse later, because in the first column you get different objects (depending on the ranking)

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Filippo_nov
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 1 month ago #195468 by tpartner
Are both questions on the same page?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Filippo_nov
  • Filippo_nov's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 1 month ago #195581 by Filippo_nov
Thank you, it works perfecty!

I see your point on the analysis problem, but since I have to "post-process" some data I will take care of that later.

Just one more question: do you know where I could find examples or a list of how answers are stored for each type of question (I can't find it in the manual)?

R1_1 works for ranking but what bout, for example, multiple numerical input questions?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 1 month ago #195595 by tpartner
If you are referring to ExpressionScript variables - manual.limesurvey.org/ExpressionScript_-...#Access_to_variables

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, Filippo_nov
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 1 month ago #195596 by Joffm

Just one more question: do you know where I could find examples or a list of how answers are stored for each type of question (I can't find it in the manual)?


Create a sample survey with all question types (there was one in the sample surveys, but the link is broken at the moment)
Activate the survey and enter some well defined data.
Then have a look at the answer table.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Filippo_nov
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose