How to add an 'exit survey' button at the end of each page that takes participants to end of survey? | XM Community
Solved

How to add an 'exit survey' button at the end of each page that takes participants to end of survey?

  • 25 January 2024
  • 6 replies
  • 319 views

Badge +1

I tried the Javascripts but they do not work now. Anyone knows how I can do this? 

Thanks!

icon

Best answer by JesperAndersen 25 January 2024, 09:58

View original

6 replies

Userlevel 3
Badge +11

I would see this done in one of two ways.

  1. Use the Table of Contents feature. This would allow the user to jump to the end on their own, but I’m not sure if that is what you want.
  2. Place a multiple choice question in each block, that has just one option, and call it “End Survey” or similar. Then either use the survey flow to check if the button has been pressed and skip the next blocks, or use the Skip Logic for any additional question. That would get you to the end of the survey.

The cases above would not requite any JavaScript, but would require that the click on the question button and then the next button. If you add the below JavaScript to the same button, then the Next button will be clicked automatically when you click the “End Survey” button:

Qualtrics.SurveyEngine.addOnload(function ()
{
    this.questionclick = function(event,element)
    {
        this.clickNextButton()
    }
});

Userlevel 7
Badge +22

Another approach would be just by adding a script in footer which will display a button and on click of button it will close the current session via an API.

Badge +1

Another approach would be just by adding a script in footer which will display a button and on click of button it will close the current session via an API.

Hi,
I am interested in doing exactly the same thing.

How would you implement your suggestion please?

Badge +1

Another approach would be just by adding a script in footer which will display a button and on click of button it will close the current session via an API.

I tried doing that, but Qualtrics did not like it. Did you use the html <> button?

Badge +1

I would see this done in one of two ways.

  1. Use the Table of Contents feature. This would allow the user to jump to the end on their own, but I’m not sure if that is what you want.
  2. Place a multiple choice question in each block, that has just one option, and call it “End Survey” or similar. Then either use the survey flow to check if the button has been pressed and skip the next blocks, or use the Skip Logic for any additional question. That would get you to the end of the survey.

The cases above would not requite any JavaScript, but would require that the click on the question button and then the next button. If you add the below JavaScript to the same button, then the Next button will be clicked automatically when you click the “End Survey” button:

Qualtrics.SurveyEngine.addOnload(function ()
{
    this.questionclick = function(event,element)
    {
        this.clickNextButton()
    }
});

Thank you! I ended up adding a question at the end of each block. If I wanted to add the end survey button, where would you paste the code? On the html <>?

Userlevel 3
Badge +11

Hi @Culturelab

I’m not 100% sure what you mean?

This code:

Qualtrics.SurveyEngine.addOnload(function ()
{
    this.questionclick = function(event,element)
    {
        this.clickNextButton()
    }
});

Would be added in the JavaScript section of the “End Survey” button. It would be activated when you click on the “End Survey” button, and the code would then activate the Next/Submit button, so you do not have to click the End Survey and then the Next button.

Leave a Reply