choicegroupanchorexclusive
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| choicegroupanchorexclusive [2022/09/28 20:42] – [choiceGroupAnchorExclusive - Anchor or make choices exclusive in a choice group] admin | choicegroupanchorexclusive [2023/09/24 16:47] (current) – [choiceGroupAnchorExclusive - Anchor or make choices exclusive in a choice group] admin | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| The choiceGroupAnchorExclusive function can be used to anchor choices in a randomized choice group and/or make choices exclusive in multi-select choice group. | The choiceGroupAnchorExclusive function can be used to anchor choices in a randomized choice group and/or make choices exclusive in multi-select choice group. | ||
| - | This function is available for a reasonable fee. Contact **[[https:// | + | This function is available for a reasonable fee. Contact **[[https:// |
| ===== Set-up Instructions ===== | ===== Set-up Instructions ===== | ||
| ==== Survey Header ==== | ==== Survey Header ==== | ||
| - | To make the function available to all questions in the survey, copy the function to the Survey Header inside a script tag: | ||
| Add the choiceGroupAnchorExclusive function to the survey header to make it available to any question in the survey. | Add the choiceGroupAnchorExclusive function to the survey header to make it available to any question in the survey. | ||
| < | < | ||
| Line 11: | Line 10: | ||
| </ | </ | ||
| Alternatively, | Alternatively, | ||
| + | ==== Choice Group Setup ==== | ||
| + | For **choiceGroupAnchorExclusive** to work, the choice group names **MUST NOT** be hidden in Qualtrics. | ||
| + | |||
| + | To hide choice group names on an individual basis, put the group name inside a span with the class '' | ||
| + | < | ||
| + | <span class=" | ||
| + | </ | ||
| + | If **ALL** choice groups are to be hidden and only ' | ||
| ==== Choice Setup ==== | ==== Choice Setup ==== | ||
| - | To anchor a choice within the choice group, put the choice text inside a span with the class anchor. For example: | + | To anchor a choice within the choice group, put the choice text inside a span with the class '' |
| < | < | ||
| <span class=" | <span class=" | ||
| </ | </ | ||
| - | To make a choice exclusive within a choice group, put the choice text inside a span with the class exclusive. For example: | + | To make a choice exclusive within a choice group, put the choice text inside a span with the class '' |
| < | < | ||
| <span class=" | <span class=" | ||
| Line 25: | Line 32: | ||
| </ | </ | ||
| If there are multiple anchored choices within a choice group, exclusive choices will be anchored below non-exclusive choices. | If there are multiple anchored choices within a choice group, exclusive choices will be anchored below non-exclusive choices. | ||
| + | ==== JavaScript Function Call ==== | ||
| + | Call the choicegroupAnchorExclusive function from the question' | ||
| + | < | ||
| + | Qualtrics.SurveyEngine.addOnload(function() { | ||
| + | choicegroupAnchorExclusive(this); | ||
| + | }); | ||
| + | </ | ||
| + | |||
| + | To override the default options, specify the desired options in the second function argument as an object. For example: | ||
| + | < | ||
| + | Qualtrics.SurveyEngine.addOnload(function() { | ||
| + | choicegroupAnchorExclusive(this, | ||
| + | }); | ||
| + | </ | ||
| + | See **[[choicegroupAnchorExclusive# | ||
| + | ===== Options ===== | ||
| + | ==== removeCgs ==== | ||
| + | **removeCgs** is a boolean that specifies if choice groups should be removed after choices are anchored. Setting **removeCgs** to true cancels all exclusive choice group functionality since choice groups are required for operation. Therefore, **removeCgs** should only be used if **only** anchor functionality if required. | ||
| + | |||
| + | Default: false | ||
| ====== Qualtrics Wiki ====== | ====== Qualtrics Wiki ====== | ||
| [[start|Qualtrics Wiki]] | [[start|Qualtrics Wiki]] | ||
choicegroupanchorexclusive.1664412160.txt.gz · Last modified: by admin
