The mcCgAccordion function expands and collapses choice groups in a multiple choice question. It automatically adjusts behavior for single and multi-select choice groups.
Here is a quick video demonstration:
Features include:
This function is available for a reasonable fee. Contact TomG on the Qualtrics Community to learn more.
Add the mcCgAccordion function to the survey header to make it available to any question in the survey. Go to Look & Feel → General → Header edit →
and paste the provided mcCgAccordion function JS:
<script>/*Paste mcCgAccordion function JS here*/</script>
Alternatively, paste the mcCgAccordion function JS into a question's JS outside the existing Qualtrics functions to make it available to questions on the page.
The requirements for the multiple choice question are:
Create choice groups and assign choices to the groups. Do NOT hide the choice group titles. Set other choice group options as needed.
Add JS to call the mcCgAccordion function to apply it to the multiple choice question as follows:
Qualtrics.SurveyEngine.addOnload(function() {
mcCgAccordion(this);
});
To override the default options, specify the desired options is the second function argument as an object. For example:
Qualtrics.SurveyEngine.addOnload(function() {
mcCgAccordion(this,{start:"expand"});
});
collapseText is a string that specifies the text display to the right of the choice group label when a choice group is expanded.
Default: '^'
expandText is a string that specifies the text displayed to the right of the choice group label when a choice group is collapsed.
Default: '˅'
start is a string that specifies the start mode of the choice groups. There are three valid values:
Default: 'auto'