Hello!!
I have been trying to randomize the language of the entire survey for some time. I have defined an embedded data as the two different languages that the survey is in. I need the Java Script for the survey to choose one of the languages at random.
Any help is appreciated!
Is your embedded data Q_Lanuguage?
https://community.qualtrics.com/XMcommunity/discussion/comment/54768#Comment_54768So Q_Language is the data that is already embedded without me trying, but I thought I would need to set another embedded data that can be randomised. But I am open to randomising Q_Language if possible with overriding the automatic language selection Qualtrics does via Chrome search language.
Step 1: Create a survey where you use randomiser to randomly assign the language to the field Q_Language.
Step 2: Redirect the survey to your original survey along with Q_Language where language code is randomly assigned from survey into the link.
Hope this helps!
You could add this JS to a question on the first page of the survey:
Qualtrics.SurveyEngine.addOnload(function() {
if("${e://Field/randlang}"!="1") {
var qlang = jQuery("#Q_lang");
var langs = qlang.find("option");
qlang.val(langs.get(Math.floor(Math.random() * langs.length)).value);
Qualtrics.SurveyEngine.setEmbeddedData("randlang","1");
}
});
https://community.qualtrics.com/XMcommunity/discussion/comment/54841#Comment_54841Thank you so much! I have been trying to find this somewhere for so long. You practically saved me hours and hours of labour if I had to do it manually (different blocks for different languages and so on).
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.