Welcome to the LimeSurvey Community Forum

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

List[Dropdown] sort all answers but one alphabetically [Version 3.7.2+180508]

  • Pascal_RU
  • Pascal_RU's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 11 months ago - 2 years 11 months ago #229439 by Pascal_RU
Hi everyone,

I have a list of country names that I want to present to my respondents. I would like to have one country on the top of the list, as 80% of respondents will be from that country (Netherland). At the same time I want all other countries to be sorted alphabetically. This on itself is no problem, as I can pre-sort country names and then add them to my Netherlands-entry. But my survey is bilingual, with Dutch being the main language and English the second. Country names in Dutch are different from their English counterparts, meaning that somehow I need the function "sort alphabetically" while excluding one entry from this function. Is this possible?
Thank you in advance.

Best wishes,
Pascal
Last edit: 2 years 11 months ago by Pascal_RU.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #229442 by holch
I don't think this is possible. Maybe you can do something with Javascript. But I think the sort order is only available for the main language, and then the other language is probably in the same order of countries, even if not in alphabetical order. But I am not 100%, because I hardly use bilingual studies.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
The following user(s) said Thank You: Pascal_RU

Please Log in to join the conversation.

  • Pascal_RU
  • Pascal_RU's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 11 months ago #229447 by Pascal_RU
Thank you for your answer, holch. I also did not find anything while googling this problem. Bad luck I guess. :-)

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #229449 by Joffm
It's not "bad luck".

You have a lot of options.

1. Split the question. Order the names in both question according to your wishes. Dislay depending on the language. Variable LANG (LANG=='nl', ...
2. Use an array(text) with drop-down layout (many examples here in the forum)
This very flexible one week ago.
[url] forums.limesurvey.org/forum/can-i-do-thi...-islamic-date#229197 [/url]
But there are many more
[url] forums.limesurvey.org/forum/can-i-do-thi...cific-columns#226861 [/url]

a. Insert the names depending on the language with an IF-statement in javascript

b. Use two subquestions one with the names in Dutch, one in English; display the subquestions by subquestion relevance (again: LANG=='nl', LANG=='en')

Joffm

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

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #229458 by tpartner
Here is a post describing how to sort the drop-down options - forums.limesurvey.org/forum/can-i-do-thi...lly-alphasort#172142

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: Pascal_RU

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #229463 by Joffm
And here the easy and in some way obvious solution.
Start the country you want to be at first place with a blank.
Here you see (version 3.27.17)
 



With these answer options
German, blank before " Deutschland"
 

Spanish, blank before " Espana"
 


As @holch already mentioned, I also seem to remember that some time - some versions - ago this multilingual sort didn't work.
Anyway you should consider an update of your 4 years old version.

Joffm

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

Please Log in to join the conversation.

  • Pascal_RU
  • Pascal_RU's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 11 months ago #229476 by Pascal_RU
Thank you tpartner and Joffm for your answers. Since I don't have any experience with javascript, I went with your extra blank space approach Joffm - and it worked perfectly fine. Thank you! However, I saved the scripts that you provided to play around with them when I have the time.

Hopefully we will be able to update LS in the near future!

Best,
Pascal

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose