Welcome to the LimeSurvey Community Forum

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

Question Slider

  • Mon2016
  • Mon2016's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 10 months ago #201664 by Mon2016
Question Slider was created by Mon2016
Hello everyone,

I am in a dilemma, I am trying to ask a slider question, now my problem is that I want to change the text of the ends for images on a 5 point scale.

I found this in the forum que Tony hizo favor de realizar.

<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: 'One',
2: 'Two',
3: 'Three',
4: 'Four',
5: 'Five',

};

$('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(bvcbcvbcv)]);
});
});
});
</script>


it runs correctly, but I cannot change these texts for images.

Does anyone have any solution for this?

Additionally, I would like to know if the offset bar can be made larger than 12.

I appreciate your answer too much.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #201666 by tpartner
Replied by tpartner on topic Question Slider
Can you attach a small sample survey (.lss file) containing only one question?

What do you mean by "offset bar"? Can you provide a screenshot?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Mon2016
  • Mon2016's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 10 months ago #201667 by Mon2016
Replied by Mon2016 on topic Question Slider
Hi Tpartner,

An apology if I did not know how to explain very well,

I mean the slider type question as an attachment in the screenshot,



Now, I managed to put the images at both ends, but I would like to know if it is possible that instead of the numbers I can put some phrases like:

- Very good
- Something good
- Neither good nor bad
- Something wrong
- Very bad

And that the bar to unfold a little wider so that you do not miss a phrase and there is no specific answer.

Thanks for your kind reply
Attachments:
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #201668 by Joffm
Replied by Joffm on topic Question Slider
Hi,
I used 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:  'Very good',
      2:  'Somewhat good',
      3:  'Neither good nor bad',
      4:  'Somewhat bad',
      5:  'Bad'
    };
 
    $('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>

I do not know why you entered this line
$('.tooltip-inner-2', thisItem).text(tipTexts[$(this).val(bvcbcvbcv)]);


And with these settings


I get this


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu, tpartner
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #201708 by tpartner
Replied by tpartner on topic Question Slider
Again with the boats! :)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Mon2016
  • Mon2016's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 10 months ago #201720 by Mon2016
Replied by Mon2016 on topic Question Slider
This really works,

But now I have a problem, inserting the script no longer allows me to use these images at each end,

How can I put the images?

I really regret the simple question.

Thanks again
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #201727 by Joffm
Replied by Joffm on topic Question Slider
How did you insert your images?
You usually the images are the subquestions separated by the pipe-symbol.
!<img src="image1.png">!<img src="image2.png">
Read the manual about question type "multiple numerical input".

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Mon2016
  • Mon2016's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 10 months ago #201752 by Mon2016
Replied by Mon2016 on topic Question Slider
Hi Joffm

That's right, put the image inside the sub-question, however it appears to me like this,

It shows me both texts.



I'm probably doing something wrong, but I don't know what the error is.

Thanks again for your time.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #201754 by tpartner
Replied by tpartner on topic Question Slider

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #201777 by DenisChenu
Replied by DenisChenu on topic Question Slider
For production : better to use LimeSurvey 3.X version

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • Mon2016
  • Mon2016's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 9 months ago #201966 by Mon2016
Replied by Mon2016 on topic Question Slider
Thank you all for your comments,

Now they have changed the way I present some Slider questions,

I want to know if it is possible to ask matrix questions with this type of slider.

What I'm looking for is something like this:





Is there a way to do it?

The form shown by the multiple numerical entry question is not very friendly for the interviewee.

As always I appreciate your help too much.

Hugs
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 9 months ago #201971 by DenisChenu
Replied by DenisChenu on topic Question Slider

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose