Have an idea?

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

Not Applicable (per variable) with the single value slider

Hi all ... I'm on the latest version (9.6.0).

I'm having problems getting this to work.  I'm trying to use the two questions from the library together - Sliders: Single value and Not Applicable: per variable.

Got 3 rows in my slider question (0 to 100) and need a D/K option per row.  But the D/K bit doesn't show up on preview.  

I have updated the code to take into account the updated JQuery - $(window).on('load', function(){

Not sure what to put in row 10 in this instance (constantSumOrRanking: [])

Can anyone help me out please?
asked Jul 18, 2018 by Marion Silver (5,240 points)

2 Answers

+1 vote
 
Best answer
Jay is correct.  Some previewing in the software is intended to preview a single question, so it will not always show interactions that span multiple questions such as Not Applicable.  The checkboxes should show up in Test Survey.

Although Not Applicable: Per Variable supports all standard grid and semantic diff questions, it may require modifications to work with a custom grid like Sliders.  The first change we'll need to make is to set all rows in the grid question to not require a response.

Next, locate the function "updateNotApplicableVariable" in Not Applicable's footer.  Replace that function with this:

function updateNotApplicableVariable(baseQuestion, naQuestion, name, bln) {
    var regex = new RegExp('^' + naQuestion + '_([0-9]+)$');
    var match = name.match(regex);
    if (match) {
        var item = Number(match[1]);
        var input = $('#' + baseQuestion + '_r' + item + '_c1');
        var slider = $(input).siblings('.slider');
        if (bln) {
            $(input).val('');
            $(slider).slider('value', 0);
            $(slider).find('.sliderHandle').text('');
            $(slider).slider('disable');
        }
        else {
            $(slider).slider('enable');
        }
    }
}
answered Jul 18, 2018 by Zachary Platinum Sawtooth Software, Inc. (202,850 points)
selected Jul 19, 2018 by Marion
Thanks a heap to you both - it works.  BUT the N/A option doesn't line up with the boxes.  It left justifies to the rows.  I'll try adding a basic scale (0, 25, 75, 100) to see if that fixes it.  Sure I saw a post on that somewhere.
Sorry, I don't follow.  What's the problem?
0 votes
Marion,

Did you try to view what you set up by testing the page locally versus just the preview?  I've found that is necessary for some of the scripting to work and show up.
answered Jul 18, 2018 by Jay Rutherford Gold (49,130 points)
...