Is there any way you can display the order of answers differently per language?
Thank you
Another way to do it would be to use JavaScript to sort the list on the fly.
> Ok thanks , indeed duplicating would be less ideal. I'm not a Java expert though, is there a peace of code that i can copy in?
No, there isn't any code I'm aware of that you could copy. The JS would be fairly complex.
> Ok thanks , indeed duplicating would be less ideal. I'm not a Java expert though, is there a peace of code that i can copy in?
Did you happen to find a solution for this or develop JS? I'm working on a survey with over 10 translations so different versions of each would not be ideal at all.
https://www.qualtrics.com/community/discussion/comment/23399#Comment_23399JodieG hi, I'm also implementing a survey in 10 languages. Were you able to resolve this for the 10 translations?
https://www.qualtrics.com/community/discussion/comment/23399#Comment_23399The following JavaScript worked for me. It will grab the language currently selected in Qualtrics by the survey respondent and works with single choice, multiple answer, dropdowns, and select boxes.
/* Tweak to ensure dropdowns are sorted in other languages */
// Pull choices from current question
let targetElement = this.getChoiceContainer();
let myChoices = targetElement.children;
myChoices = Array.prototype.slice.call(myChoices);
// Sort choices
myChoices.sort(function(a, b) {
return a.textContent.localeCompare(b.textContent, '${e://Field/Q_Language}', {sensitivity: 'base', ignorePunctuation: true, numeric: true});
});
// Return choices to current question
for (let i=0; i < myChoices.length; i++) {
targetElement.appendChild(myChoices[i]);
}
https://www.qualtrics.com/community/discussion/comment/33043#Comment_33043It's fine if you only want to sort French.
Since the original post several months ago, I've written a JS function that provides a more robust solution (not free). It alphabetizes multiple choice questions (vertical single answer, vertical multi-answer, dropdown list, select box and multi-select box) on-the-fly based on the current language. It also supports anchored choices.
If anyone is interested, feel free to contact me by private message.
https://www.qualtrics.com/community/discussion/comment/33045#Comment_33045Hey Tom, good point. I make a tweak to the above so it works with the language currently selected in Qualtrics by the survey respondent.
https://www.qualtrics.com/community/discussion/comment/23399#Comment_23399The following JavaScript worked for me. It will grab the language currently selected in Qualtrics by the survey respondent and works with single choice, multiple answer, dropdowns, and select boxes.
/* Tweak to ensure dropdowns are sorted in other languages */
// Pull choices from current question
let targetElement = this.getChoiceContainer();
let myChoices = targetElement.children;
myChoices = Array.prototype.slice.call(myChoices);
// Sort choices
myChoices.sort(function(a, b) {
return a.textContent.localeCompare(b.textContent, '${e://Field/Q_Language}', {sensitivity: 'base', ignorePunctuation: true, numeric: true});
});
// Return choices to current question
for (let i=0; i < myChoices.length; i++) {
targetElement.appendChild(myChoices[i]);
}
wow, this worked amazingly well - thank you for sharing!
one question: is there a way to exclude answer options like ‘other’ or ‘none of these’ from the sorting? I appreciate any leads :)
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.