Randomising participants into groups based on language | XM Community
Solved

Randomising participants into groups based on language

  • 9 October 2020
  • 7 replies
  • 2 views

Hi,
Hoping someone can help! I am trying to set up the survey flow so participants are allocated to one of four groups. I would like their language choice (EN or PT) to determine whether they are placed in either an EN or PT group and then randomiser to split them to either intervention or control - therefore they will be four groups in the end (intervention EN, waitlist EN, intervention PT, waitlist PT). I have looked through many posts on here and have tried to implement a flow based on what I have read but it still isn't working - e.g. even if I select PT as the language, I could still get allocated to the intervention EN group. Is it even possible to do what I am trying to achieve just in the survey flow? Screenshots of what I currently have in the flow:
Qualtrics EN.pngQualtrics PT.pngMany thanks in advance!!!

icon

Best answer by TomG 13 October 2020, 14:11

View original

7 replies

Userlevel 7
Badge +27

What you have basically looks correct. However, those branches would have to be after the first question block where they select a language. If it is before that it will always be the default language (EN).

Thanks for your reply Tom. I think that might be the problem, how can I insert a question where they select their language and the language of the survey changes? At the moment, it is just a drop down button at the top right of the screen. Many thanks

Userlevel 7
Badge +27

https://www.qualtrics.com/community/discussion/comment/31019#Comment_31019You would write JavaScript to do that. It would change the value of the language drop down down when a choice is selected.

OK, thanks for your help!

Hi TomG
I added this JS to a question 'Please choose your language' but it still isn't working (if language selected is EN, the PT group can still be chosen and vice versa) - any tips please?
Qualtrics.SurveyEngine.addOnReady(function()
{

jQuery("select[id='Q_lang']").hide();

var selectedRecode; 

   this.questionclick = function(event, element) {
    if(element.type == "radio")
     {selectedRecode = Number(this.getChoiceRecodeValue(this.getSelectedChoices()));

if (selectedRecode == 1) {
jQuery("select[id='Q_lang']").val("EN");
jQuery("select[id='Q_lang']").trigger( "change" );
Qualtrics.SurveyEngine.setEmbeddedData("language","EN")
}
else {
jQuery("select[id='Q_lang']").val("PT");
jQuery("select[id='Q_lang']").trigger( "change" );
Qualtrics.SurveyEngine.setEmbeddedData("language","PT")
}
 
   }
}


});

Userlevel 7
Badge +27

https://www.qualtrics.com/community/discussion/comment/31059#Comment_31059You'll want to hide the language selector throughout the whole survey. Add this to Look & Feel Custom CSS:
.LanguageSelectorContainer { display:none; }
Also:

  1. With the CSS above, you don't need to hide Q_lang in the script

  2. You don't need the embedded data field "language"; the embedded data field Q_Language always contains the current language.

Hi Beth_R123 ,
I'm dealing with a similar issue as the one you posted directly above. Did you ever find a solution and if so would you mind sharing it?
thanks,
Brian

Leave a Reply