Presenting new questions in the same order as previous, randomly ordered questions [SOLVED] | XM Community
Skip to main content

Hello,
I'm currently working on a survey where respondents will see 5 of 10 possible questions (1-10) in a random order. Based on the questions that respondents saw and the random order in which they saw those first 5 questions, I want to present 5 more questions that are paired with each of the 5 original questions.
--
Example:
Question 1 is paired with Question A, 2 with B, 3 with C, 4 with D, 5 with E
If Questions 1-5 appear in the order, 1/2/4/3/5, how do I ensure that Questions A-E appear in the order, A/B/D/C/E?
--
The random order will also vary across respondents. Please let me know if you'd like more detail or a sample survey and I'll get back to you.
--
Update:
I went with a variation of ahmedA's solution. It doesn't use regex, and uses more embedded data than they suggested. I also have no idea if ahmedA's solution works even though Qualtrics flagged it as accepted: presumably it does work, but I couldn't track down the relevant posts to fully implement their solution.
1) Make a Embedded Data (ED) field, "Test_Value", and set it to 0. This is the first object in the survey flow.
2) Within a randomizer (evenly present ALL elements), make 3 groups.
3) Within the first group, start with an ED field that increments Test_Value by 1. To do this, set the value of Test_Value to $e{ e://Field/Test_Value + 1 }.
4) Within the first group, show Block 1, which will only contain Question 1.
5) Add a branch within the first group for each possible value Test_Value could take.
6) Each of those branches should have its own ED. For the first branch, this ED can be "First", "Second" for the second, etc. The ED should be the only object under each branch.
7) Set First = A, Second = A, etc. within the first group in their respective branches.
8) Repeat steps 3-7 based on the number of initial questions you want to randomize. Per the example, this would mean 5 groups (Questions 1-5), but I'm going with 3 in the example because it's easier to check your work.
9) Make 3 more groups, called "First Conditional", "Second Conditional", and "Third Conditional." Below steps are for "First Conditional" but generalize to "Second" and "Third".
10) Within the group, add three branches. The branches should be subsets of the group, NOT of each other.
11) Each branch will set a different ED field equal to the relevant question. For example, in the group "First Conditional", the branches have the conditions "if First = A", "if Second = A", and "if Third = A".
12) Put the relevant question from questions A-E in each branch. For the group "First Conditional" and the branch "if First = A", that would be question A. If it's the branch "if First = B", that would be question B, etc.
13) Repeat steps 10-12 for "Second Conditional" and "Third Conditional."
If you don't know any Java (like me) or couldn't find the relevant forum posts to do this more efficiently, this should work.

Create can ED called display_order. Put each of the questions 1-5 in a block of their own. Put each of these blocks in a group, which contains the block and updates the display order ED. (Read the support pages/community to figure that out). It should be something like this, when 1 is displayed, 1 gets added (as a string) to the display order, same for 2 etc. So if the question order is 2-3-1-4-5 your display order ED should be 23145.
Now create 5 blocks, which contain all the 5 other questions (A-E). Lets call them BL1, BL2, BL3 etc. The purpose of each of these blocks is to show ONLY one question, which corresponds to the earlier display order. So, BL1 will show A if the first question was 1 and C if it was 3. Similarly, BL3 will show A if the third question was 1 and C if it was 3 etc.
In BL1 use matches regex display logic, which the following config:
A:

1....
, B:
2....
, C:
3....
, 😨
4....
, E:
5....

In BL2:
A:
.1...
, B:
.2...
, C:
.3...
, 😨
.4...
, E:
.5...

The others for A are:
..1..
,
...1.
,
....1

Continue in the same pattern for the others. Make note of the dots.


Thank you ahmedA! I'm going to try implementing this, and will follow up as needed.


Leave a Reply