The formatLikertMatrix function formats a likert matrix question by formatting the columns by percentage and enabling better control of repeat headers. It also optionally supports adding a divider line before the last column, adding mobile labels, and hiding selected cells.
Functionality includes:
This function is available for a reasonable fee. Contact TomG on the Qualtrics Community to learn more.
Add the formatLikertMatrix function to the survey header to make it available to any question in the survey. Go to Look & Feel → General → Header edit →
and paste the provided formatLikertMatrix function JS:
<script>/*Paste formatLikertMatrix function JS here*/</script>
Alternatively, paste the formatLikertMatrix function JS into a question's JS outside the existing Qualtrics functions to make it available to questions on the page.
Set the following single choice Likert Matrix options:
Add JS to call the formatLikertMatrix function to apply it to the Likert Matrix question as follows:
Qualtrics.SurveyEngine.addOnload(function() {
formatLikertMatrix(this);
});
To override the default options, specify the desired options in the second function argument as an object. For example:
Qualtrics.SurveyEngine.addOnload(function() {
formatLikertMatrix(this,{labelWidthPercent:30,lastNA:true});
});
To specify text to be shown only in mobile accordion mode, place it inside a hidden span with the class mfInstr. For example:
1<span class="mfInstr" style="display:none;"> - Extremely Dissatisfied</span>
allRepeatEvery specifies how often to show repeated headers when Repeat Headers 'All' is checked.
Default: 1
hideCells is an object that specifies the cells to be hidden. Format for specifying cells is:
scalePt:[choiceNum1,choiceNum2,…]
Example:
hideCells: {2:[1,4,7],6:[3,5]}
labelWidthPercent specifies the width of the label column as a percentage of question width. The remaining width is divided evenly among the other columns.
Default: 35
lastNA set to true to add a divider before the last column and adjust scale labels.
Default: false
midHeaderAlign specifies the vertical alignment of repeated middle labels. Possible values are top, middle, and bottom.
Default: "middle"
minHeaderRepeatBot: specifies the minimum number of rows before showing repeated headers on bottom when 'Bottom' or 'Both' is turned on.
Default: 0
minHeaderRepeatMid specifies the minimum number of rows before showing repeated headers in the middle when 'Middle' or 'Both' is turned on.
Default: 0
NAdividerStyle specifies the CSS style of the lastNA divider.
Default: "1px solid #BBBBBB"