User Tools

Site Tools


addrequirements

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
addrequirements [2024/02/25 11:58] – created adminaddrequirements [2024/02/25 12:32] (current) – [CSS] admin
Line 1: Line 1:
-====== addRequirements - Automatically formatDeselect radio buttons on any question type that contains radio buttons  ====== +====== addRequirements - Automatically format force response, request response, or optional questions  ====== 
-The uncheckRadios function deselects radio buttons in question types that use them: multiple choicenpsmatrix, side-by-side, and rank orderRadio buttons can be deselected on click or on-demand (i.e., immediately).+The addRequirements adds CSS classes to questions to specify if they are force responserequest responseor optionalThe classes can be used to format or add text to the questionsThe 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!
  
-Functionality includes: +Since constant sum questions don't have force response option, they are considered to be forced if 'Must Total' is greater than zero
-  * Works on any question type with radio buttons +
-  * On click functionality to deselect selected radio button by clicking on it +
-  * On demand functionality to deselect one or more radio buttons immediately +
-  * Can be applied globally, by page, by question, or on specific radio buttons or groups of radio buttons (e.g., one column of a side-by-side)+
  
-Here is a quick video demonstration:\\ +The addRequirements function is **__not__** compatible with Simple layout.
-{{ ::uncheckRadios.mp4?650 |uncheckRadios Demonstration}}+
  
 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. 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 ===== ===== Set-up Instructions =====
 ==== Survey Header ==== ==== Survey Header ====
-Add the uncheckRadios function to the survey header to make it available to any question in the survey  Go to Look & Feel -> General -> Header edit -> {{::icon_source.jpg?20|}} and paste the provided uncheckRadios function JS:+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:
 <code> <code>
-<script>/*Paste uncheckRadios function JS here*/</script>+<script>/*Paste addRequirements function JS here*/</script>
 </code> </code>
-Alternatively, paste the uncheckRadios function JS into a question's JS outside the existing Qualtrics functions to make it available to questions on the page. 
 ==== JavaScript Function Call ==== ==== JavaScript Function Call ====
-The uncheckRadios function can be invoked a number of ways depending on the usage scenario. To call the function with default options use:+Call the addRequirements function from the survey header or footer:
 <code> <code>
 +<script>
 Qualtrics.SurveyEngine.addOnload(function() { Qualtrics.SurveyEngine.addOnload(function() {
- uncheckRadios();+ addRequirements();
 }); });
 +</script>
 </code> </code>
-To override the default optionsspecify the desired options as an object. For example:+===== 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:
 <code> <code>
-Qualtrics.SurveyEngine.addOnload(function() { +/*Force response - asterisk before question text*/ 
-        var radios = jQuery("#"+this.questionId+" [type=radio]"); +.force .QuestionText::before content:"}; 
- uncheckRadios({radios:radios,onclick:true})//only this question on click +/*Optional response - optional label after question text*/ 
-});+.optional .QuestionText::after { 
 +  content:"(Optional)"
 +  display:"block"; 
 +  font-style:"italic"
 +}
 </code> </code>
-=== Global === 
-To be able to globally deselect radio buttons (i.e., throughout the entire survey) by clicking on them, call the uncheckRadios function from the survey header or footer with the onclick option set to true: 
-<code> 
-<script> 
-Qualtrics.SurveyEngine.addOnload(function() { 
- uncheckRadios({onclick:true}); 
-}); 
-</script> 
-</code> 
-===== Options ===== 
-==== radios ==== 
-**radios** specifies the radio buttons to deselect either immediately or on click. **radios** can be a jQuery object, element, or selector. 
- 
-Default: %%"[type=radio]"%% (selector for all radio buttons on page) 
-==== onclick ==== 
-**onclick** specifies if radio buttons should be deselected on click (true) or immediately (false). 
- 
-Default: false 
 ====== Qualtrics Wiki ====== ====== Qualtrics Wiki ======
 [[start|Qualtrics Wiki]] [[start|Qualtrics Wiki]]
addrequirements.1708880333.txt.gz · Last modified: by admin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki