MacArthur Scale of Subjective Social Status on Qualtrics
Hi I would like to use the MacArthur Scale of Subjective Social Status on a Qualtrics Survey. This requires at the minimum a vertical scale, preferably with a scale ladder graphic. Does anyone have any experience developing/designing this? Or any advice to improve my efforts, equally welcome! So far I've blended knowledge from across the developers corner and not been super successful. But I am close... I think. First: Choose Question Type: Constant Sum , 1 statement, vertical format.
Qualtrics.SurveyEngine.addOnload(function() { var vSlider = document.getElementById('uiSlider'); noUiSlider.create(vSlider, { start: 50, step: 1, direction: 'rtl', orientation: 'vertical', range: { min: 0, max: 100 }, format: wNumb({ decimals: 0 }), // Show a scale with the slider pips: { mode: 'positions', values: i0,10,20,30,40,50,60,70, 80,90,100], stepped: true, } });
var inputNumber = document.getElementById('QR~'+this.questionId+'~1'); vSlider.noUiSlider.on('update', function (values, handle) { inputNumber.value = valuesUhandle]; }); inputNumber.addEventListener('change', function () { vSlider.noUiSlider.set(;null, this.value]); }); inputNumber.setAttribute('readonly',true) });
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*/
});
Fourth: UpdatedHTML View Imagine that this ladder scale pictures how society is set up.
At the top of the scale are the people who are best off – they have the most money, the highest amount of schooling, ant the jobs that bring the most respect.
At the bottom are people who are the worst off – they have the least money, little or no education, no job or jobs that no one wants or respects.
Now think about your family.
Please tell us where you think your family would be on this scale.
The best off you can imagine
The worst off you can imagine
Page 1 / 1
The html entities
(" < >)
in your Look & Feel Header shouldn't be there.
Thanks for the advice Tom. I can't spot " < > but I did remove " > < from the latter end of the Look and Feel Header code and it did not work.
I've tried to change the Look and Feel code several time using different formats
Thanks TomG between your help and some off line help I've got it working. For anyone else who might like this here's the completed and working bits. First: Choose Question Type: Constant Sum , 1 statement, vertical format.
Second: Updated Look and feel> General
Third: Update JavaScript
Qualtrics.SurveyEngine.addOnload(function() { var vSlider = document.getElementById('uiSlider'); noUiSlider.create(vSlider, { start: 5, step: 1, direction: 'rtl', orientation: 'vertical', range: { min: 0, max: 10 }, format: wNumb({ decimals: 0 }), // Show a scale with the slider pips: { mode: 'steps', stepped: true, density: 10, } });
var inputNumber = document.getElementById('QR~'+this.questionId+'~1'); vSlider.noUiSlider.on('update', function (values, handle) { inputNumber.value = valuesphandle]; }); inputNumber.addEventListener('change', function () { vSlider.noUiSlider.set(>null, this.value]); }); inputNumber.setAttribute('readonly',true)
});
Fourth: Update HTML
Imagine that this ladder scale pictures how society is set up.
At the top of the ladder are the people who are best off – they have the most money, the highest amount of schooling, ant the jobs that bring the most respect.
At the bottom are people who are the worst off – they have the least money, little or no education, no job or jobs that no one wants or respects.
Now think about your family. Please tell us where you think your family would be on this scale.
The people who are the best off
The people who are the worst off
Please note to include the image of a ladder you'll need to update with your own image by removing/updating src="https://greenwichuniversity.eu.qualtrics.com/CP/Graphic.php?IM=IM_0B75hb7o1XWCgh7"
Also you won't see it as functioning in the builder viewer, you'll need to preview the question. But it should be working, it was for me! Hope someone find this useful
I am also trying to create a MacArthur Subjective Status item, and this post was immensely helpful. However, we have found that a number of our participants experience trouble using the slider, or being a bit confused by it (for context, these are children and adolescents). I am wondering if you or anyone else have some thoughts or advice on replacing the slider with vertically listed radio buttons (same 10 responses as the slider) within the java script you provided?
So it should be vertical. Check the first step - Choose Question Type: Constant Sum , 1 statement,vertical format. See cropped screen grab below:
Hi there. I am a total newbie and don't understand how to insert the text and code you've provided. I can add in the HTML, but of course, the slider isn't there with it. Does anyone have time to help me understand how follow the steps correctly?
Tom_1842 Thanks! Worked for me! I just needed the import step to understand how to do it.
Tom_1842 Hi Tom--Sorry to be back, but I wonder if you might have any suggestions for me. I can get the survey to work when I initially import it. But when I add the questions to my existing survey, the slider stops showing up. Can you think of what I might be doing wrong?
Hi LMeerts , for the Slider to work, all the steps mentioned by VFF must be in place, including the Slider question format, the JavaScript hidden in the Header, the Question JavaScript, and the Question HTML. Copying the question into a different survey won't bring over the JavaScript hidden in the Header, so it is likely you still need to add that bit to your survey to get it to work. In the survey that you imported where it was working, head over to the Look & Feel -> General and copy the code in the Header field over to the Header field in your survey.
Thank you everyone, I am using this and its really helpful. However I ran into a problem. I want to have two different questions and the problem is that the second question doesn't show the scale where as the first does. When I preview the question itself, the scale shows but when I preview the whole survey, the second question doesn't show a scale.
Hi fatimaq , if both of your questions are on the same page, I think what is happening is that your 2nd question is trying to reference the id/slider of the first question and is running into errors. If you update the JavaScript and HTML of each question so that they are referencing unique things, you should be able to include multiple sliders on a page. So in the HTML, the "id" of the 1st question becomes "uiSlider1" and in the question's JavaScript, vSlider becomes vSlider1 and inputNumber becomes inputNumber1. For the 2nd question, the "id" in the HTML becomes "uiSlider2" and in the question's JavaScript, vSlider becomes vSlider2 and inputNumber becomes inputNumber2. Working for me in the attached QSF. MacArthur_Scale_of_Subjective_Social_Science_x2.qsf
Tom_1842 one more, since you are so good at it! The silder and the scale are off by 1 for me. So when the slider is at 0, its actually a position below the 0 on the scale. Is there a way so that the slider is at the exact position as of the scale?
fatimaq I see what you mean. Try adding the below CSS to the Style section of the survey's Look & Feel: .noUi-base { top: -35px !important; }
Hi Tom, thanks for putting this together. I’m keen to use the file you provided, however the file can’t be downloaded any longer. Any chance you could re-upload it if you still have a copy? Thanks for your time!
@PygmieBonobo@christophermaf
I am attaching an updated QSF that has been updated in the following ways:
Created a new 10 rung ladder image and uploaded it to Imgur. The png file is also included in the attached zip file. This ladder will align with the vertical slider to more easily identify which rung of the ladder the respondent views themself in.
Updated the slider range to 1-10 instead of 0-10.
Made it so that rating displays with the same formatting as the "Total" does in Constant Sum (Gray background, red font) and hid the Total row.
Centered the vertical slider and ladder in the middle of the page
More on the MacArthur Scale of Subjective Social Status can be found here. More on noUiSlider can be found here.
Thanks to everyone who has contributed to this thread. The default setting on the ladder is 5. but I don’t want participants to just click the next button each trial (and not interact with the ladder). I have been trying unsuccessfully to disable the next button until the participant has moved the ladder. The first example of my JavaScript seems to manage the disabling of the next button, but then I lose the recorded response on the slider. The second example of my Javascript has the slider working but the next button not disabling. I need to find a way to integrate them. Any help would be amazing!
###########Next button working, slider not working:
Qualtrics.SurveyEngine.addOnload(function() {
// Functions to disable/enable Next button
function disableNextButton() {
var nextButton = jQuery('#NextButton');
nextButton.prop('disabled', true);
}
function enableNextButton() {
var nextButton = jQuery('#NextButton');
nextButton.prop('disabled', false);
}
// Your existing slider initialization code
var vSlider1 = document.getElementById('uiSlider1');
noUiSlider.create(vSlider1, {
start: 5,
step: 1,
direction: 'rtl',
orientation: 'vertical',
range: {
min: 0,
max: 10
},
format: wNumb({
decimals: 0
}),
pips: {
mode: 'steps',
stepped: true,
density: 10,
}
});
var inputNumber1 = document.getElementById('QR~' + this.questionId + '~1');
vSlider1.noUiSlider.on('change', function (values, handle) {
// Enable the Next button when the slider is changed
enableNextButton();
});
inputNumber1.addEventListener('change', function () {
@socog2888199 Try adding the below to the question’s JavaScript. It disabled the Next Button until the noUi slider is clicked:
this.disableNextButton(); var that = this; jQuery(".noUi-base").on("click", function() { that.enableNextButton(); });
@socog2888199 The below is working better for me. It enables whenever the noUi slider is interacted with:
this.disableNextButton(); var that = this; jQuery(".noUi-base, .noUi-touch-area, .noUi-handle").on("touchstart mousedown", function() { that.enableNextButton(); });
This was solved with a slider above, but you may find a different solution useful, using a heatmap. I’ll upload a qsf file here with a heatmap version of the question. It renders the screenshot below, and participants just click on the ladder to indicate their position. No javascript required. Hope someone finds it helpful!