Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Display a constructed list even if only one response chosen

Hi there

I am having a problem when using a constructed list based on answers to multiple questions. I am finding that the question is skipped (response automatically selected) when there is only one response chosen. This is very problematic as the respondent needs to be able to see this selection, even if there is only one. Is there a way that I can still display the list even with one response?
asked Feb 20, 2017 by Christine Hanley (370 points)
Actually thinking this could be achieved by showing the respondent the option which has been automatically selection. Is there a script for showing a question response as text?
Try this:

[% ListLabel(PredefinedList, SelectQ) %]


Where "PredefinedList" and "SelectQ" are the parent list and question name, of course.
Thanks Zachary.  Do I copy this into Custom JavaScript Verification? I've done so as follows [% ListLabel(Q16Chosen, Q16) %]
You can put this code anywhere.  It just displays the selected response to the question.
Whoops, I initially included the constructed list name rather than the parent list name but now that I've fixed that it's working perfectly. Thanks!

1 Answer

+1 vote
One way to get around Lighthouse skipping questions like these is to include a dummy list item in the constructed list, then hide it from showing up with JavaScript.  I gave my dummy list item this code:

<div class="hiddenListOption"/>


Then gave my select question this code to hide the dummy radio button:

<script>
$(document).ready(function(){
    $('.hiddenListOption').closest('.response_row').hide();
})
</script>


I can modify the code for other question types than selects if needed.
answered Feb 20, 2017 by Zachary Platinum Sawtooth Software, Inc. (91,500 points)
3 methods come to mind that would force the question to be displayed ...

1/ Using JavaScript to cloak a dummy code, as Zachary has indicated.  I've used this in the past. Probably the best solution too.
2/ If you had made that code a "Respondent specify", that would force the question to be displayed.
3/ If you created a parent list and used [%ListLabel(QList,Ques)%] as code 1, that would also force it to be displayed. Constructed lists evaluating to one code will make the question skip but not a parent list with one code.
That third option is really clever.  Never knew that was possible.
...