Question Slider

More
1 month 3 weeks 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.

Please Log in to join the conversation.

LimeSurvey Partners
More
1 month 3 weeks 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.
Official LimeSurvey Partner - partnersurveys.com

Please Log in to join the conversation.

More
1 month 3 weeks 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:

Please Log in to join the conversation.

More
1 month 3 weeks ago #201668 by Joffm
Replied by Joffm on topic Question Slider
Hi,
I used the script
<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
Attachments:
The following user(s) said Thank You: DenisChenu, tpartner

Please Log in to join the conversation.

More
1 month 2 weeks 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.
Official LimeSurvey Partner - partnersurveys.com

Please Log in to join the conversation.

More
1 month 2 weeks 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

Please Log in to join the conversation.

More
1 month 2 weeks 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

Please Log in to join the conversation.

More
1 month 2 weeks 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.
Attachments:

Please Log in to join the conversation.

More
1 month 2 weeks 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.
Official LimeSurvey Partner - partnersurveys.com

Please Log in to join the conversation.

More
1 month 2 weeks 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.

Please Log in to join the conversation.

More
1 month 2 weeks 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
Attachments:

Please Log in to join the conversation.

More
1 month 2 weeks 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.

Please Log in to join the conversation.

More
1 month 1 week ago #202076 by Mon2016
Replied by Mon2016 on topic Question Slider
Thank you all,

And one last question,

How can I do so that everything is centered and that it is not so far to the left.
I am using version 2.50+ Build 160414

since for business reasons I have not yet been able to update to the 3x version.





it seems that the script shared by Joffm in this version does not run

As you will see I am not an expert in CSS or Jv if someone has a script that works in this version, I will be eternally grateful


I very much appreciate patience with myself

Hugs
Attachments:

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now