Survey Flow Loop Affect | XM Community
Skip to main content

Hi.
I have 5 blocks of questions, indicating the level of difficulty of the questions contained within: Level-1 (very easy) to Level-5 (very hard).
Beginning with a random Level-3 (moderate difficulty) question, the survey logic should display a random question from the next level if the current question is answered correctly, or from the previous level if incorrect. This excludes where a user gets a Level-1 question wrong, or a Level-5 question right, in which case the next random question should come from the current level.
The survey will continue until the user has seen 10 questions, with no question repeated.
I know how to randomise blocks, count completed questions, check whether the correct answer was selected and add elements or conditions to the survey flow. However, how do I achieve the affect of a survey flow loop when this functionality is not possible? Loop and Merge seems to relate to questions rather than blocks.
Also, how do I ensure that no question appears more than once?
Kind regards.


Hmm, this bends Qualtrics' playbook pretty far out of it's scope, which just means more custom code, complexity, and chance of breaking. However, I love this idea, makes me think of Pluralsight's competencies if you're familiar. Anyways, let me throw out a scenario which I believe is possible.
I'm picturing 5 embedded data fields to house the questions: Level1Questions, Level2Questions, etc. When the survey loads, have your JavaScript in the welcome question (so the code loads the questions in before you try to access the embData fields. If you try to load them and use them on the same page, your values will be null until a page refresh.). That JS would do the work of making the embData fields arrays with the questions probably comma-separated. You'll also want an embData field called "currentQuestion" or something like it. You need to be able to set "currentQuestion" before the next page loads.
This all should let you have a loop and merge block that runs 10 times, period. When the respondent clicks the next button, you'll need an eventHandler that checks if their answer was correct, pulls down the right embData array variable, splits on the comma, shuffles the available questions, and then returns "currentQuestion" and drops it from that level so as not to be reused. When the next page loads, "currentQuestion" will still be displayed to the user, but the value will have been updated. You'll need to handle Level 1 and 5 so they pull from within their own levels, of course.
Hope this either works for you or I was able to spark your own vein of genius! Good luck!


Kia ora JeremyK. Many thanks for your prompt response. Although I understand the theory of it, it is unfortunately way above my skill level. I am more comfortable using Qualtrics' front-facing survey builder elements, than back-door coding (eg. Javascript, eventHandlers, etc). I would need to Google every aspect of it: how to store questions in an array, how to generate a random JS number to determine which question to retrieve from the array, how to shuffle and drop questions. Even the bit I have working (check if the answer is correct) may not work if dropped into your solution scenario. This may prove to be an 'aspirational' project for a rainy month, I think. Guru indeed!


Leave a Reply