Survey progress bar with a limited randomized number of blocks counted | XM Community
Skip to main content

Hi!
In my survey, besides the demographic information and the instructions, I have 108 blocks of which only 20 are randomly shown to each participant (10 from a 36 blocks group and 10 from a 72 blocks group). However, the Qualtrics progress bar shows progress assuming all 108 of those blocks, and that confuses participants, as either it doesn't move for a while or at certain points it moves to rapidly.
Can anyone help me on this, please? It is my first survey, so I dont' understand nothing about user programming.
Thanks

You can exclude certain branches from your survey flow to not consider for progress bar calculations. See this page for more information - https://www.qualtrics.com/support/survey-platform/survey-module/survey-flow/standard-elements/branch-logic/#ExcludefromProgressBar


Thank you Mishraji, but it is not a question of branches. It is a matter of only want to count 20 blocks randomly chosen from 108. Each participant only has to answer 20 blocks of questions but the system shows the progress bar as if the participants had to answer to the all 108 blocks.


Got it. Then you will have to add a custom progress bar using javascript. To add a custom progress bar, refer to this discussion. Please copy the custom progress bar code and add it to your look and feel-->header. Also, add the 'pb' embedded data to the start of your survey flow and set it to '0'.
Now you will have to count the total number of questions/block that can be displayed to a user add below JS to each question/bock:
***************JS Starts here*****************
Qualtrics.SurveyEngine.addOnReady(function()
{
var new_pb;
new_pb = Qualtrics.SurveyEngine.getEmbeddedData( 'pb');
var total = parseInt(new_pb) + 10;
Qualtrics.SurveyEngine.setEmbeddedData( 'pb', total);
});
***************JS Ends here*****************
What you are doing is basically incrementing the progress bar by an x percentage either for each question or each block. The sum of these increments should be equal to 100. In the above example, I have incremented it by 10 for each question displayed. My survey has 50 questions but only 10 will be displayed to a respondent.

Hope this makes sense. Let me know if you have any questions.


Thank you Mishraji!


Hi again Mishraj,
When I copy the custom progress bar script to the look and feel header the text of that script appears in the beginning of my survey instead of working as a script 😞. What am I doing wrong?


Hi,
You need to copy the code in source code mode.
image.png


Many thanks, Mishraj!!! :)


Leave a Reply