Change fixed numerical labels on a multiple choice NPS question | XM Community
Skip to main content
Solved

Change fixed numerical labels on a multiple choice NPS question


Forum|alt.badge.img+1
Hey guys! Right now I have a multiple choice question option (NPS), that is locked for values from 0 to 10. I want to change those values to be displayed from -5 to 5. What would be the proper way to code this? Also, I have tried adding static, unclickable labels to the extremes of a multiple choice question, but was unsuccessful. Could you guys help? This is the question format which I want to change from 0 to 10 to -5 to 5: ! Thanks!

Best answer by Anonymous

Hello @GabrielRibeiro Just paste the following code in the js(onload) option of nps question jQuery("#"+this.questionId+"-0-label").html("-5"); jQuery("#"+this.questionId+"-1-label").html("-4"); jQuery("#"+this.questionId+"-2-label").html("-3"); jQuery("#"+this.questionId+"-3-label").html("-2"); jQuery("#"+this.questionId+"-4-label").html("-1"); jQuery("#"+this.questionId+"-5-label").html("0"); jQuery("#"+this.questionId+"-6-label").html("1"); jQuery("#"+this.questionId+"-7-label").html("2"); jQuery("#"+this.questionId+"-8-label").html("3"); jQuery("#"+this.questionId+"-9-label").html("4"); jQuery("#"+this.questionId+"-10-label").html("5");
View original

10 replies

sankeshkumar
QPN Level 2 ●●
Forum|alt.badge.img+1
  • QPN Level 2 ●●
  • 16 replies
  • August 14, 2018
HELLO @GabrielRibeiro got through the below given javascript code Qualtrics.SurveyEngine.addOnload(function() { document.getElementById('QID18-0-label').innerHTML = '-5'; document.getElementById('QID18-1-label').innerHTML = '-4'; document.getElementById('QID18-2-label').innerHTML = '-3'; document.getElementById('QID18-3-label').innerHTML = '-2'; document.getElementById('QID18-4-label').innerHTML = '-1'; document.getElementById('QID18-5-label').innerHTML = '0'; document.getElementById('QID18-6-label').innerHTML = '1'; document.getElementById('QID18-7-label').innerHTML = '2'; document.getElementById('QID18-8-label').innerHTML = '3'; document.getElementById('QID18-9-label').innerHTML = '4'; document.getElementById('QID18-10-label').innerHTML = '5'; }); Qualtrics.SurveyEngine.addOnReady(function() { /*Place your JavaScript here to run when the page is fully displayed*/ }); Qualtrics.SurveyEngine.addOnUnload(function() { /*Place your JavaScript here to run when the page is unloaded*/ }); have a look at the qsf file for its working

Forum|alt.badge.img+1
@sankeshkumar I tried inputting this code in the javascript option, chaing he QID to the proper number, but it didn't work. Are you using the NPS question type or some other one? Thanks!

  • 0 replies
  • Answer
  • August 14, 2018
Hello @GabrielRibeiro Just paste the following code in the js(onload) option of nps question jQuery("#"+this.questionId+"-0-label").html("-5"); jQuery("#"+this.questionId+"-1-label").html("-4"); jQuery("#"+this.questionId+"-2-label").html("-3"); jQuery("#"+this.questionId+"-3-label").html("-2"); jQuery("#"+this.questionId+"-4-label").html("-1"); jQuery("#"+this.questionId+"-5-label").html("0"); jQuery("#"+this.questionId+"-6-label").html("1"); jQuery("#"+this.questionId+"-7-label").html("2"); jQuery("#"+this.questionId+"-8-label").html("3"); jQuery("#"+this.questionId+"-9-label").html("4"); jQuery("#"+this.questionId+"-10-label").html("5");

sankeshkumar
QPN Level 2 ●●
Forum|alt.badge.img+1
  • QPN Level 2 ●●
  • 16 replies
  • August 14, 2018
hello @GabrielRibeiro kindly refer the QSF FILE ATTACHED HEREWITH

Forum|alt.badge.img+1
Shashi, should I paste this in between the / / for the Qualtrics.SurveyEngine.addOnload(function()? Because when I do it says invalid argument. Thanks for all the help and sorry for the dumb questions, I'm not a programmer!

  • 0 replies
  • August 14, 2018
> @GabrielRibeiro said: > Shashi, should I paste this in between the / / for the Qualtrics.SurveyEngine.addOnload(function()? > > Because when I do it says invalid argument. > > Thanks for all the help and sorry for the dumb questions, I'm not a programmer! !

Forum|alt.badge.img+1
Thanks Shashi and sankeshkumar, problem solved thanks to you!!!

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5932 replies
  • August 14, 2018
Here is a quick and easy way using an NPS question: ``` Qualtrics.SurveyEngine.addOnReady(function() { var start = -5; jQuery("#"+this.questionId+" td.LabelContainer > span > label > span").each(function(index) { this.innerHTML = start + index; }); }); ``` However, I don't think using an NPS question is the best way because the numbers in your response data will still be 0 through 10. You could use a single row matrix and make it look like an NPS question, then your numbers will be -5 to 5. I have a script that does this, but it does a lot of other things too, so I'm not going to post it here. Here is what it looks like though: !

Forum|alt.badge.img+2
  • 1 reply
  • November 26, 2018
@TomG I am trying to create a question similar to the NPS via a multiple choice question but it is not mobile friendly. I am trying to take your advice and try it as a single likert matrix. However, I cannot remove the lines from the matrix. Do you mind sharing your script or sharing how i can make a question that looks like the one you posted. thanks

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5932 replies
  • November 26, 2018
@PorscheW, This might help: https://www.qualtrics.com/community/discussion/comment/8799#Comment_8799 As for making it look just like the image I posted, I don't give that script away.

Leave a Reply