Table of Contents
addRequirements - Automatically format force response, request response, or optional questions
The addRequirements adds CSS classes to questions to specify if they are force response, request response, or optional. The classes can be used to format or add text to the questions. The classes are automatically added to all answerable questions in the survey - just add the function call to the survey header and some custom CSS and you're done!
Since constant sum questions don't have a force response option, they are considered to be forced if 'Must Total' is greater than zero.
The addRequirements function is not compatible with Simple layout.
This function is available for a reasonable fee. Contact TomG on the Qualtrics Community to learn more.
Set-up Instructions
Survey Header
Add the addRequirements function to the survey header. Go to Look & Feel → General → Header edit → and paste the provided addRequirements function JS:
<script>/*Paste addRequirements function JS here*/</script>
JavaScript Function Call
Call the addRequirements function from the survey header or footer:
<script> Qualtrics.SurveyEngine.addOnload(function() { addRequirements(); }); </script>
Turn off/on
By default, addRequirements applies to all answerable questions in a survey. To turn addRequirements off for a block or blocks of questions, set the embedded data field 'addRequirementsOff' to 1 in the survey flow. Set it to 0 to turn it back on.
CSS
Use the CSS classes force, request, and optional to format or add text to questions as needed. For example:
/*Force response - asterisk before question text*/ .force .QuestionText::before { content:"* " }; /*Optional response - optional label after question text*/ .optional .QuestionText::after { content:"(Optional)"; display:"block"; font-style:"italic"; }