Have an idea?

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

How repeat the scale in a sementical differential

Hi,

I have created a Semantic Differential question, but I have 10 items and need to repeat the scale at the bottom or all 3/4 items. Please help me.

Thank you
asked May 6, 2016 by Virginie

1 Answer

+1 vote
To repeat the scale at the bottom you can use this code in your footer:

<script type="text/javascript">
$(document).ready(function(){
    $('#SemDiffQ_4_row').after('<tr class="alt_color2 repeated_scale"></tr>');
    $('.repeated_scale').html($('#SemDiffQ_div .column_header_row').html());
})
</script>


You'll need to replace "SemDiffQ" with the question name and replace the "4" in the code with the number of sliders in your question.  If the number of sliders is odd, you'll want to replace "alt_color2" with "alt_color1."

If you want to repeat the scale for each slider, something like this should do the trick:

<script type="text/javascript">
$(document).ready(function(){
    var numberOfSliders = 4;
    
    for (var tr = numberOfSliders + 1; tr >= 2; tr--) {
        $('#SemDiffQ_div > .question_body > table > tbody > tr:nth-child(' + tr + ')').after('<tr class="repeated_scale"></tr>');
    }
    $('.repeated_scale').html($('#SemDiffQ_div .column_header_row').html());

    for (var tr = 1; tr <= numberOfSliders * 2 + 1; tr++) {
        var altColor = (tr % 2 == 0) ? 'alt_color2' : 'alt_color1';
        $('#SemDiffQ_div > .question_body > table > tbody > tr:nth-child(' + tr + ')')
            .removeClass('alt_color1 alt_color2')
            .addClass(altColor);
    }
})
</script>


Again, you'll need to replace "SemDiffQ" with your question name and replace the "4" in line 3 with the number of sliders in the question.
answered May 6, 2016 by Zachary Platinum Sawtooth Software, Inc. (81,800 points)
...