====== 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 **[[https://community.qualtrics.com/inbox/conversation?with=373|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 -> {{::icon_source.jpg?20|}} and paste the provided addRequirements function JS:
==== JavaScript Function Call ====
Call the addRequirements function from the survey header or footer:
===== 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";
}
====== Qualtrics Wiki ======
[[start|Qualtrics Wiki]]