Finishing survey after X questions answered | XM Community
Skip to main content

I am working on a quiz in which my students select how many questions they want to answer. I have an Embedded Data variable with this number, let's call it X.
I then have a set of 300 questions that are displayed to them randomly. But I would like the survey to end after they have answered X questions.
I thought about two ways on how to do it:

  • In Survey Flow, when I randomize the 300 blocks, telling the randomizer to randomly present ${e://Field/X} elements. This doesn't work, it asks me for a number.

  • In the Javascript of each question, introduce a counter. Tell the Javascript to send the student to the end of the survey if that counter is equal to X. I have figured how to introduce the counter, but I unfortunately lack the knowledge to introduce a function that will send students to the end of the survey.

Any help on how to do it (in either of these ways, or any other) is greatly appreciated. Thanks in advance!

This can be a time consuming solution: Create 300 embedded data (Q1, Q2.....).
Using JS set any random X number of ED to 1. Now add display logic on each question as display if its respective embedded data is equal to 1.


Question_Limit.qsfI do not think it's possible to do that while having questions on different pages. The issue is that, there is no "Finish/Exit" survey option in Qualtrics, so you'll need to create a hidden MC question on each page, and use skip logic it to end the survey.
An alternate approach would be to have all the question on the same page, show them one by one, and then click the next button once you have shown the required number of questions. Demo here.





Thanks a lot to both of you for your answers! I have tried both of your solutions and they work fantastically. In the end, I implemented a mix between both solutions, which allows me to easily scale the number of questions. Thank you!


Leave a Reply