Question presentation with java | XM Community
Skip to main content

Hello community,
i have 100 statements in 4 different versions: english-true, english-false, german-true and german-false.
The aim is for each person to get all 100 questions, but randomized across the 4 versions. Additionaly from each version 25 statements should be presented.
The statements are conditional. This means that if statement 1 is presented in the english-true version, the other versions may not be presented.
I am not so familiar with JavaScript. Does anyone of you know a solution/script with which I can implement these conditions?

Thank you kindly in advance,
Elisa

I believe survey flow randomisation of four blocks and advance randomisation of showing 25/100 question in each block should do the job
Hope it helps


Hey, thanks for your help.
But with this way I can't control that when one version of an item is selected, the other three versions of the same item can't be selected anymore.
I've thought that I could write a JavaScript that randomizes 1/4 version per question, which are in individual blocks, to 1. With the condition that when 25 items have been drawn for a version that those versions are no longer considered. But I don't know exactly how to implement this.
Or I would need a function to add +1 to a counter when drawing a version.
Is there a solution or other ways for this? 


JavaScript or a web service would be the best way to do it.
You can do it in the survey flow with a combination of a randomizers, branches, groups, and embedded data, but given that you have 400 items (100 questions x 4 versions) it would be a lot. You can use arithmetic expressions to keep counts in embedded data fields. For example:
english_true = $e{ e://Field/english_true + 1 }


Leave a Reply