Check out the LimeSurvey source code on GitHub!

how to use ranking type question answer in other question?

  • limesun
  • limesun's Avatar Topic Author
  • Visitor
  • Visitor
3 years 4 months ago #100642 by limesun
add one ranking type question,with 5 items:a,b,c,d,e.
suppose participant rank item a as the first, item e as the sencond.then i need to use the ranking result in other question:

you rank a as the first, rank e as the second

.
the problem is: i have no idea how to do it.

Please Log in to join the conversation.

More
3 years 4 months ago #100749 by tpartner
If the ranking question code is "rank1", then try this:

you rank {rank1_1.shown} as the first, rank {rank1_2.shown} as the second...

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • limesun
  • limesun's Avatar Topic Author
  • Visitor
  • Visitor
3 years 4 months ago #100786 by limesun
the key problem is how to get{first},{second}

Please Log in to join the conversation.

More
3 years 4 months ago #100803 by tpartner
Did you try it? Those expressions will give the first ranked and second ranked items.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
3 years 3 months ago #101156 by mikuhrs
Hello there,

I have an additional question regarding this topic:

After a ranking question, I want to use a the top ranked fruit name (e. g. "apple") in the next question: "Why do you like apple?".

Unfortunately, what I get is an error (s. attachment).

Any ideas what went wrong?

Thanks in advance an best regards

Michael
Attachments:

Please Log in to join the conversation.

More
3 years 3 months ago #101158 by tpartner
What is the question code of your ranking type question?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
3 years 3 months ago - 3 years 3 months ago #101159 by mikuhrs
Hello Tony,

the question code is "Auswahl" (it is in question 2644).

Best regards

Michael
Last Edit: 3 years 3 months ago by mikuhrs. Reason: typo

Please Log in to join the conversation.

More
3 years 3 months ago #101160 by tpartner
Then this should work:

{Auswahl_1.shown}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
3 years 1 month ago #103508 by MarcellavZ
Hello Tony,

I have a follow-up question on the question ascribed above. I also want to use a answer in the text of the next question. It's a multiple choice question with the option 'other'. Participants need to choose what kind of snack they eat the most and than i want to know what kind of snack specific they eat. I tried the solution you described but when I try it I only see the 'equation' surrounded by thick red lines. The answer isn't coming up in the text. What am I doing wrong? The code of the question is 'gs'.

Thanks!

Please Log in to join the conversation.

More
3 years 1 month ago #103510 by tpartner
Can you attach a small sample survey?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
3 years 1 month ago #103519 by MarcellavZ
Yes, off course but it is in Dutch so I don't know if it would be of any help..

The link to the survey is:
survey.fss.uu.nl/416242/lang-nl-informal

The question is about the last 2 questions. The answer of the second last question needs to be linked to the text of the follow up question.

Please Log in to join the conversation.

More
3 years 1 month ago #103524 by tpartner
No, I mean attach an export of a sample survey containing the pertinent groups so I can see your question codes, etc.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
3 years 1 month ago #103526 by MarcellavZ
I'm sorry. I just started so it's all abracadabra for me. I exported two files, but when I export my survey structure I get a blank file. My computer can't open it, bu you will find it under .lss. The other file I exported was a 'tab-sepereted-values format' and that one is a PDF file. The questions where it is about are marked in yellow. I don't know if this is the export you mean, but I can't export anymore. Thanks anyway for the quick responding and your help!
Attachments:

Please Log in to join the conversation.

More
3 years 1 month ago - 3 years 1 month ago #103527 by tpartner
Okay. it's the .lss file that I was looking for.

I'm not sure why you are using a multiple-choice for question "gs" and then limit the answers to 1 selection.

I would use a List (Radio) for question "gs" and set "other comment mandatory" to yes.

Then your expression for the piped text in the following question could be:
{if(gs.shown != '-oth-', gs.shown, gs_other.shown)}

This effectively says:
- If gs does not equal "Other", display the radio label
- Otherwise, display the "Other" text input value

Here is your survey back with those changes made.

File Attachment:

File Name: limesurvey...FIED.lss
File Size:44 KB


Oh, and I noticed several invalid question codes. They should all be unique, consist of only letters and numbers with no spaces and start with a letter.

.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last Edit: 3 years 1 month ago by tpartner.

Please Log in to join the conversation.

More
3 years 1 month ago #103536 by MarcellavZ
Good morning! Thank you very much. I woke up very happy seeing that it works now. Thanks for the tips. I will change it immediately. And I see that you changed the lay-out. Much better now (how you did it, I don't know but than again I am still learning and I have a long way to go). Thanks again!

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form