Welcome to the LimeSurvey Community Forum

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

Re-ordering sub questions in translation

More
7 years 8 months ago #179644 by mainlevel
Dear all,
I'm having an issue with translating and re-ordering sub-questions. My survey is in two language (German / English). One multiple answer question has a long list of sub questions. The order of these sub questions needs to change in English (because it is alphabetical). Unfortunately, I cannot find out how to adjust the order of the sub-question in English.

I'd appreciate any help!!

Thank you so much!

Cheers
Daniel
The topic has been locked.
More
7 years 8 months ago #179651 by DenisChenu
Just use Sort answers alphabetically (alphasort) question advanced setting www.limesurvey.org/manual/Question_type_...ally_.28alphasort.29

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
7 years 8 months ago #179654 by elissa
It seems that there is no such a setting for multiple choice question.

Elzbieta Lesinska
LS voluntary Polish translator and supervisor
The following user(s) said Thank You: DenisChenu
The topic has been locked.
More
7 years 8 months ago #179661 by DenisChenu

elissa wrote: It seems that there is no such a setting for multiple choice question.

Oups,

Yes right elissa …

Sorry, bad reading.

No included solution then … JS way or Question Template way (or plugin) maybe …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
More
7 years 8 months ago #179662 by elissa
Maybe two questions each shown for different language? I'm not sure if you can set a condition on the language?

Elzbieta Lesinska
LS voluntary Polish translator and supervisor
The topic has been locked.
More
7 years 8 months ago #179666 by tpartner
Placing this script in the source of a multiple-choice question in version 3.15.x will sort the sub-questions alphabetically:

Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var thisQuestion = $('#question{QID}'); var thisList = $('li.answer-item:eq(0)', thisQuestion).closest('ul'); // Build an array of sub-question labels var optionsArr = []; $('li.answer-item', thisQuestion).each(function(i) { optionsArr.push($.trim($('label:eq(0)', this).text())); }); // Sort the array optionsArr.sort(); // Reposition the sub-questions $(optionsArr).each(function(i) { var thisVal = this; $('li.answer-item', thisQuestion).filter(function() { return $.trim($('label:eq(0)', this).text()) == thisVal; }).appendTo(thisList); }); }); </script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
Moderators: tpartner, holch

Lime-years ahead

Online-surveys for every purse and purpose