Have an idea?

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

Code to move the “none” option first in dce

I was wondering how I can move the “none” option to be the the first option in a dce choice task instead of the last option
asked Nov 11, 2019 by anonymous
What version of SSI Web / Lighthouse Studio are you running?
I’m using lighthouse studio version 9.7.2

1 Answer

0 votes
Please set the none option to appear as the last concept then add this script to your CBC:

<script>
$(document).ready(function(){
    $('#[% QuestionName() %]_div .cbc_concept.concept_1').before($('#[% QuestionName() %]_div .cbc_concept.none_concept'));
})

function SSI_SetBestConcept(question, conceptIndex) {
    var conceptClass;
    if (conceptIndex) {
        conceptClass = '.concept_' + conceptIndex;
    }
    else {
        conceptClass = '.concept_' + $('#[% QuestionName() %]_div .cbc_concept').length;
    }

    var concept = question.find(conceptClass);
    if (concept.length) {
        SSI_ClearBestConcept(question);
        if (concept.is('.worst')) {
            SSI_ClearWorstConcept(question);
        }
        concept.addClass('best');
        SSI_SetBestResponseDot(question, conceptIndex);
    }
}
</script>


Test thoroughly.  Some changes may be necessary if using a best-worst or constant sum CBC.
answered Nov 12, 2019 by Zachary Platinum Sawtooth Software, Inc. (216,575 points)
Is there a way to add to this to make the none option like slightly shaded?
You want the background color of the none concept to be a light gray?
Yes light grey would work
Please try adding this CSS to your exercise:

<style>
.none_concept {
    background-color: lightgray;
}
</style>


"lightgray" can be replaced with any other CSS color name, or a hex code like "#EEEEEE".
...