Last active
May 31, 2024 11:56
-
-
Save marketinview/c941fc59b7ddaef8ba3b to your computer and use it in GitHub Desktop.
Qualtrics: Change NPS Scale. This script changes the scale of an NPS question from 0-10 to a smaller scale. 1-10 is most common, but any scale can be specified. For numbered horizontal scales, the NPS question type is preferable to a horizontal multiple choice because it remains horizontal on small screen mobile devices. #qualtrics #js #jq #nps …
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qualtrics.SurveyEngine.addOnload(function() { | |
//Thomas Gibbons Consulting | |
//Change NPS question scale (not simple layout) | |
var scaleStart = 1; //Change - 0 or more and no greater than end | |
var scaleEnd = 10; //Change - 10 or less and no less than start | |
//No changes below | |
var width = 100/(scaleEnd - scaleStart + 1) + "%"; | |
var q = jQuery("#"+this.questionId); | |
var cc = q.find('td.ControlContainer'); | |
q.find('td.LabelContainer').each(function(index) { | |
if(index<scaleStart || index>scaleEnd) { | |
this.hide(); | |
cc[index].hide(); | |
} | |
else { | |
this.setAttribute('width', width); | |
cc[index].style.width = width; | |
} | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qualtrics.SurveyEngine.addOnload(function() { | |
//Thomas Gibbons Consulting | |
//Change NPS question scale (simple layout) | |
var scaleStart=1, scaleEnd=10; //Change as needed | |
//No changes below | |
var q=jQuery(this.getQuestionContainer()); | |
q.find(".choice").each(function(i) { if(i<scaleStart || i>scaleEnd) jQuery(this).hide(); }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instructions: