Skip to content

Instantly share code, notes, and snippets.

View marketinview's full-sized avatar

Market In View marketinview

View GitHub Profile
@marketinview
marketinview / add2ndLabelColumnToMatrix.css
Last active October 23, 2022 16:54
Qualtrics: Two Column Matrix Labels. Use the following CSS to change Matrix row labels into two columns. The optional JavaScript can be used to label the columns. #qualtrics #css #js #jq #matrix #label #column
<style type="text/css">
.wrap {
width:300px;
margin:0 auto;
float:left;
}
.left_col {
float:left;
width:240px;
text-align:left;
@marketinview
marketinview / matrixVerticalLineBeforeLastColumn.js
Last active October 23, 2022 17:00
Qualtrics: Add Vertical Line Before Last Matrix Column. This script adds a vertical line to the left of the last column in a matrix question. It is useful for visually dividing an answer scale from "Not sure". #qualtrics #js #jq #matrix #na
Qualtrics.SurveyEngine.addOnload(function() {
var q = jQuery("#"+this.questionId);
var cl = q.find('td.ColumnLabels:first');
if(cl.length > 0) cl.attr('colspan', cl.attr('colspan') - 1);
if(q.find('div.desktop').length > 0) q.find('.last').css("border-left", "1px solid #BBBBBB");
});
@marketinview
marketinview / hideQuestionText.js
Last active October 23, 2022 17:03
Qualtrics: Hide Question Text. On occasion, it is useful to hide a question's text and just display the choices/answers. #qualtrics #js #jq #hide #questiontext
Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId+" .QuestionText:first").parent().hide();
});
@marketinview
marketinview / hideQuestionGoToNextPage.js
Last active October 23, 2022 17:05
Qualtrics: Hide Question and Go To Next Page. This script can be used if you want to randomize choices then carry them over in the same randomized order to subsequent questions. #qualtrics #js #jq #hide #next
Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId).hide();
jQuery("#Buttons").hide();
});
Qualtrics.SurveyEngine.addOnReady(function() {
jQuery('#NextButton').click();
});
@marketinview
marketinview / hidePreviousButton.js
Last active October 23, 2022 17:06
Qualtrics: Hide Previous Button. Sometimes a previous button will not work properly. In those cases it is better to hide the previous button using the following script. This script can be used in a question or in the header if you want it to apply to the entire survey. #qualtrics #js #jq #button #previous #hide
Qualtrics.SurveyEngine.addOnReady(function() {
jQuery('#PreviousButton').hide();
});
@marketinview
marketinview / changeNpsScale.js
Last active October 31, 2023 12:47
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 …
Qualtrics.SurveyEngine.addOnload(function() {
//Thomas Gibbons Consulting
//Change NPS question scale
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');