Create quota based on scale variable | XM Community
Skip to main content

Hello. I am a newbie to Qualtrics.

I am making a survey with an experimental and a control condition. One of my measurements are political views, using a slider from 0 (left-leaning) to 100 (right-leaning). The slider also has a not applicable option.

My question: Can I create a quota based off that variable? I would like a roughly similar distribution of political views in experimental and control group; so say have one group of <= 50 (left to centre) and >= 50 (centre to right), and distribute those equally over the treatments. I figured out how to do that by adding a branch, but the problem is the ‘not applicable’ option because I cannot select it as condition.

I would like to have the <= 50 OR not applicable; as well as >= 50 OR not applicable option. But I do not know how to implement that. Removing the ‘not applicable’ option is unfortunately not an option.

to make it simple create embedded data for all three possibilities and use those embedded data in quotas.


Hey ​@red-leaf21 ,
I did some research on your request, and found out that Qualtrics doesnt provide any way to use ‘N/A’ option in any logic or any quota. So we will have to create an embedded data which captures N/A value upon its selection.
Use the below JS code in your slider question.

Qualtrics.SurveyEngine.addOnPageSubmit(function() 
{
// Select all checkboxes with the class 'q-checkbox'
var checkboxes = document.querySelectorAll('.q-checkbox');
var isChecked = false;

// Loop through each checkbox to check if any are checked
checkboxes.forEach(function(cb) {
if (cb.classList.contains('q-checked')) {
isChecked = true; // At least one checkbox is checked
}
});

// Set the embedded data based on the checkbox state
if (isChecked) {
Qualtrics.SurveyEngine.setEmbeddedData("N/A", "yes");
} else {
Qualtrics.SurveyEngine.setEmbeddedData("N/A", "no");
}
});
  • This code helps track whether N/A checkboxe is selected when the user submits the page.
  • It updates the embedded data (N/A) to either "yes" or "no" based on whether it is selected or not.

 

NOTE: Make sure you have defined an embdded data “NA” in your survey flow.

END!


Leave a Reply


OSZAR »