Welcome to the LimeSurvey Community Forum

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

Additional anchor/points on the slider

  • khoiboo
  • khoiboo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #209121 by khoiboo
Hi everyone,

Is it possible to add some extra anchor/points along the slider, apart from the left/min and right/max ends of the slider?

For example, the question is "Do you agree with this". Traditionally, a Likert scale would have 5 points:
1 - I strongly disagree
2 - I slightly disagree
3 - Neutral
4 - I slightly agree
5 - I strongly agree

Now if I use Slider, I can display only points 1 and 5 at the left and right end of the slider, respectively. I would like to display also points 2,3 and 4 along the scale, equally spaced from each other. It would be much more helpful for the users to know where their button is located in relation to the points.

THank you very much for your help.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #209122 by holch
Replied by holch on topic Additional anchor/points on the slider
So at the end of the day you want basically a likert scale and not a slider, just saying...

There is honestly no point to use a slider in this case. It is more hassle to answer, especially on mobile devices, and there is no real additional value of using a slider here.

So I would recommend to go with a likert scale.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • khoiboo
  • khoiboo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #209129 by khoiboo
Replied by khoiboo on topic Additional anchor/points on the slider
Hi Denis,

Yes, you are right when saying that. However, the output of the slider can be consider as interval variable at least and at most ratio variable, among the 4 types of variables (Nominal, ordinal, interval and ratio).

www.graphpad.com/support/faq/what-is-the...s-why-should-i-care/

In contrast, the Likert scale gives only ordinal variable. The interval and ratio variable are very useful and meaningful in statistical tests, such as correlation and regression.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago - 3 years 4 months ago #209132 by holch
Replied by holch on topic Additional anchor/points on the slider

However, the output of the slider can be consider as interval variable at least and at most ratio variable


If you look at your own link, when you apply this scale as you are trying to, your slider wouldn't count as interval/ratio anymore, but would be more a ordinal scale:

Examples of ordinal variables include:
socio economic status (“low income”,”middle income”,”high income”), education level (“high school”,”BS”,”MS”,”PhD”), income level (“less than 50K”, “50K-100K”, “over 100K”), satisfaction rating (“extremely dislike”, “dislike”, “neutral”, “like”, “extremely like”).


In my opinion, as soon as you apply your scale, especially including the text, not just the numbers, it is a ordinal scale.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Last edit: 3 years 4 months ago by holch.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago - 3 years 4 months ago #209136 by Joffm
Replied by Joffm on topic Additional anchor/points on the slider
Hi,

In contrast, the Likert scale gives only ordinal variable. The interval and ratio variable are very useful and meaningful in statistical tests, such as correlation and regression.

It's up to you to define the scale level. You have to adjust it in your statistc tool, like SPSS.

In my opinion, as soon as you apply your scale, especially including the text, not just the numbers, it is a ordinal scale.

Correct, but very frequently we use tests that require interval scale on these questions as well.

But you ca do this


Either with tooltips or without.
Just adapt the script
Code:
<script type="text/javascript" charset="utf-8">
 
  $(document).on('ready pjax:scriptcomplete',function(){
 
    // Identify this question
    var thisQuestion = $('#question{QID}');
 
    // Define the text strings
    var tipTexts = {
      1:  'strongly disagree',
      2:  'slightly disagree',
      3:  'neutral',
      4:  'slightly agree',
      5:  'strongly agree'
    };
 
    $('input:text', thisQuestion).on('slideEnabled',function(){ 
      var thisItem = $(this).closest('li');
 
      // Insert custom tooltip
      $('.tooltip-inner', thisItem).addClass('tooltip-inner-1 hidden');
      $('.tooltip', thisItem).append('<div class="tooltip-inner tooltip-inner-2">'+tipTexts[$(this).val()]+'</div>');
 
      // Listener on slider
      $(this).on('slide slideStop', function(event) {
        // Handle dynamic tooltip text
        $('.tooltip-inner-2', thisItem).text(tipTexts[$(this).val()]);
      });
    });
    });
</script>
Code:
 <script type="text/javascript" charset="utf-8">
  $(document).on('ready pjax:scriptcomplete',function(){
 
    var ticksArray = [
      [1, 'strongly disagree'],
      [2, 'slightly disagree'],
      [3, 'neutral'],
      [4, 'slightly agree'],
      [5, 'strongly agree'],
    ];
 
    insertSliderTicks('{QID}', ticksArray);
    });
 
  /* Insert Slider Tick Marks */
  function insertSliderTicks(qID, ticksArray) {
    var thisQuestion = $('#question'+qID);
 
    $(thisQuestion).addClass('with-inserted-ticks');
 
    $('input:text', thisQuestion).on('slideEnabled',function(){ 
      var thisSlider = $(this);
      var thisItem = $(thisSlider).closest('li');
      var thisMin = $('.slider-handle:eq(0)', thisItem).attr('aria-valuemin');
      var thisMax = $('.slider-handle:eq(0)', thisItem).attr('aria-valuemax');
      var thisRange = thisMax - thisMin;
      $.each(ticksArray, function(i, val) {
        var tickRelativePosition = val[0] - thisMin;
        var tickPercent = (tickRelativePosition/thisRange)*100;
 
        // Insert tick marks
        $('.slider-handle:eq(0)', thisItem).before('<div class="inserted-tick left-'+tickPercent+'" style="left: '+tickPercent+'%">\
                          <div class="tick-text">'+val[1]+'</div>\
                        </div>');
      });  
    });
  }
</script>
Code:
<style type="text/css">/* Slider Tick Marks */
 
  @media only screen and (min-width: 768px) {
 
    .with-inserted-ticks .slider-container {
      padding-right: 50px;
      padding-left: 50px;
    }
  }
 
  .with-inserted-ticks .slider-item {
    margin-bottom: 50px;
  }
 
  .with-inserted-ticks .slider-container .help-block {
    margin: 25px 0 0 -20px;
    width: 40px;
    text-align: center;
  }
 
  .with-inserted-ticks .slider-container .help-block.pull-right {
    margin: 25px -20px 0 0;
  }
 
  .inserted-tick {
    position: absolute;
    top: 20%;
    height: 20px;
    width: 5px;
    margin-top: -5px;
    margin-left: -1px;
    background-color: #DDDDDD; 
    background-color: green; 
  }
 
  .inserted-tick.left-0,
  .inserted-tick.left-100 {
    background-color: transparent;
    background-color: green; 
  }
 
  .inserted-tick .tick-text {
    position: absolute;
    top: 150%;
    width: 100px;
    margin-left: -50px;
    color: #000000;
    text-align: center; 
  }
 
  @media only screen and (max-width: 768px) {
 
    .inserted-tick.left-0 .tick-text {
      margin-left: 0px;
      text-align: left; 
    }
 
    .inserted-tick.left-100 .tick-text {
      margin-left: -100px;
      text-align: right; 
    }
  }
</style>

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 4 months ago by Joffm.
The following user(s) said Thank You: khoiboo
The topic has been locked.
  • khoiboo
  • khoiboo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #209254 by khoiboo
Replied by khoiboo on topic Additional anchor/points on the slider
It works like a charm. Thank you so much :)
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose