Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Adding NA option in slider questions

More
1 year 4 months ago #260397 by jan.philipp.thomeczek
Got it and it works! Thanks!

Please Log in to join the conversation.

More
1 year 3 months ago #264696 by jan.philipp.thomeczek
Still works quite well so far! Just one question, I noticed that there is a big gap between the skip box and the end of the survey (i.e., users have to scroll down a bit until they see the next button). Can I minimise this space somehow?

Please Log in to join the conversation.

More
1 year 3 months ago #264719 by tpartner
Explore the HTML elements and styles with your browser developer tools (F12) to see what is introducing the space.

Or, activate a sample survey and give a link here so we can see.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
1 year 3 months ago #264723 by jan.philipp.thomeczek
Thanks, here is the test: meinungsforschung-uni-potsdam2.limesurve...98?newtest=Y&lang=de
Both the NA box as well as the +/- control buttons come with some space.

Please Log in to join the conversation.

More
1 year 3 months ago #264724 by Joffm
There seems to be something wrong in your design.

I see this
 
instead of this
 

So you should send your lss, too.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 year 3 months ago #264898 by jan.philipp.thomeczek
OK this is very weird, see the attached screenshot. How can it look so differently, that shouldn't happen right?! Worries me a bit.

Anyway, I also attached the LSS. Thanks for having a look!

Please Log in to join the conversation.

More
1 year 3 months ago #264903 by tpartner
It looks to me like there is a JavaScript error but I'm away from a PC so can't test.

Check the console (F12) for errors.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
1 year 3 months ago #264904 by jan.philipp.thomeczek
I only see an error (with a triangle) regarding colour, but I think that stems from the template... but I'm really not an expert on Java, need to do a course on that...

Please Log in to join the conversation.

More
1 year 3 months ago #264906 by Joffm
Hi,
I do not see any script in your lss.

I talk about this one that was already shown at the beginning of this thread.
Code:
<script type="text/javascript" data-author="Tony Partner">
    
    $(document).on('ready pjax:scriptcomplete',function(){
 
        // Identify this question
        var thisQuestion = $('#question{QID}');
        var filterQuestion = $(thisQuestion).nextAll('.multiple-opt:eq(0)');
 
        // Hide the filter question
        $(filterQuestion).hide();
 
        // Move the checkbox rows
        $('li.answer-item.numeric-item', thisQuestion).each(function(i) {
               $(this).after($('li.answer-item:eq(0)', filterQuestion));
        });
 
        // Some clean-up styles
        $('li.numeric-item', thisQuestion).css({
            'margin-bottom': 0,
            'min-height': 0
        })
        $('li.checkbox-item *', thisQuestion).removeClass('col-auto');
        $('li.checkbox-item', thisQuestion).removeClass('mb-1').css({
            'margin-bottom': '20px',
            'text-align': 'center'
        })
 
    });
</script>

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 year 3 months ago #264912 by jan.philipp.thomeczek
Yes! Sorry, you're right. I must have lost it when creating the test survey. So it's added now and at least that seems to fix the gap between the +/- button and the skip button. Just the space after the skip button remaining.

Please Log in to join the conversation.

More
1 year 3 months ago #264914 by Joffm

Just the space after the skip button remaining

Which space?
 

Evenb here you can minimize spaces by changing the paddings.
Investigate with the webdevelopment tool to find the affected classes ("contgrol-slider-buttons" and "ls-answers")
 

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 year 2 months ago #265352 by jan.philipp.thomeczek
Thank you, all worked fine!
I have a slight issue with the question type, maybe there's a way to fix that. I'm using the response to that question to calculate a score, which works generally fine. If you click the skip button right away, it's recorded as NA - and count(qid) does work. However, there is one specific scenario where it doesn't: If you first click something on the slider, then skip and then proceed, there is (correctly) no answer recorded, but LS treats this as a non-NA question. Thus, count(qid) gets messed up. Can anyone think of a problem how to fix that? Hope my problem is clear?

Please Log in to join the conversation.

More
1 year 2 months ago #265354 by Joffm
Well,
you want to calculate a score?
How do you want to do it?
Obviously it is something like a mean- what else do you need a count for?

As these two scanarios are treated differently (easy to understand. In the first case the slider is untouched and doesn't have a value, in the second the slider was touches, has a value, but then is disabled by the array filter of a different question), you have to consider a different way to "count".

As the question is mandatory, you could say in the equation of your score:
{count(that.Q1.question)-countif("Y",that.Q1a)}
with Q1 - slider question
Q1a - checkbox question

Better you send the lss export with explanation of your score calculation

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose