Slider: Unanswered questions given a score of '0' in dataset with having default choices active | XM Community

Slider: Unanswered questions given a score of '0' in dataset with having default choices active

  • 4 February 2023
  • 2 replies
  • 36 views

Badge

Hello Qualtrics community, 
I have created a questionnaire with statements and and slider from 0 to 100. I have chosen 'default choices'. The slider automatically starts at 0, because I want to avoid the respondent always having to touch the slider to give an answer or touch it to indicate a 0. However, now it also registers a missing as a 0. So if the participants do not tick anything Qualtrics registers a 0. I would like to know how I can keep the 'default choices' but that not sliding the slider is registered as a missing instead of a 0. I am going to analyze everything in SPSS.
It would help me immensely to complete my master. 
Thanks! 


2 replies

Userlevel 4
Badge +12

Hey Hannah14

How about we create a followup question that only appear if I select "not applicable". In followup question we can ask respondent that "äre you sure you do not want to use slider?". if respondent selects "yes" in this question then you can identify in data whether "0" came because of slider or "not applicable" button.

I know it's a weird way out but i just came in my mind :P

Userlevel 5
Badge +19

Hi Hannah14 ,
You can use the following method to avoid registering a 0 for the slider if the respondent doesn't touch it:

  1. Create Embedded data variables, one for each slider on the page. For example, if you have 3 sliders, create variables named "Slider1", "Slider2", and "Slider3" and set all those variable as "missing".

  2. Add the following JavaScript code to the Qualtrics JS API:

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/

});

Qualtrics.SurveyEngine.addOnReady(function()
{// Select all elements with the tag "tbody" and store them in the "tbody" variable
let tbody = document.querySelectorAll('tbody');

// Loop through each element in the "tbody" variable
for (let i = 0; i < tbody.length; i++) {
 // Store the current slider in the "slider" variable
 let slider = tbody[i];

 // Define the "changeHandler" function that will be executed when the "mouseup" event is triggered on the slider
 let changeHandler = function() {
  // Set the value of the embedded data with the name "Slider1", "Slider2", etc. to "0", using the current iteration number "i"
  Qualtrics.SurveyEngine.setEmbeddedData('Slider' + (i + 1), "0");


  // Remove the "mouseup" event listener from the slider after it has been triggered
  slider.removeEventListener("mouseup", changeHandler);
 };

 // Add the "mouseup" event listener to the slider and set the "changeHandler" function as the callback
 slider.addEventListener("mouseup", changeHandler);
}


});

Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/

});


And later you can check in SPSS sheet whether Slider1 variable has "0" or "missing" value and based on that you can determine whether Slider was moved or not.
Hope it resolves your query😊!!

Leave a Reply