Check out the LimeSurvey source code on GitHub!

Slider Scale

More
6 years 1 month ago #55286 by Mike1985
Hi.

In my slider I have two "options" at either end of the scale. On the left of the scale I have 'vegetables' and on the right I 'meat' (example). The scale runs from -100 (that's 'vegetables') to 100 (that's 'meat') and the starting position of the 'slider' is 0 (in the middle).

When I start moving the slider toward vegetables, the number above the slider has a minus "-" sign in front of it. Is there a way to get rid of this - either in a Javascript file somewhere, a line in the quanda.php or do I maybe just need to design the question differently???

Please please please help : )

Please Log in to join the conversation.

More
6 years 1 month ago #55289 by Mazi
I think you should just design the question differently. The slider always shows the current value and if it is negative, a "-" is added.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
6 years 1 month ago - 6 years 1 month ago #55310 by tpartner
You could force display of the absolute value by modifying scripts/jquerylime-slider.js,

Change lines 53 and 61 from:
$('#slider-callout-'+basename).css('left', $(ui.handle).css('left')).text(slider_prefix + thevalue + slider_suffix);

To:
$('#slider-callout-'+basename).css('left', $(ui.handle).css('left')).text(slider_prefix + Math.abs(thevalue) + slider_suffix);

Note that this would affect all surveys and be prone to being overwritten when updating.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 6 years 1 month ago by tpartner.

Please Log in to join the conversation.

More
6 years 4 weeks ago #55379 by Mike1985
Thank you. I'll give it a go. This won't affect the number that's passed to the database though will it? I'd just want it to change on the web page..

Mike

Please Log in to join the conversation.

More
6 years 4 weeks ago #55388 by Mazi
When using such a Javascript workaround the code simply removes some HTML elements when displaying the page. This does not affect how data is stored at the DB.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
6 years 3 weeks ago #55730 by Mike1985
Thanks guys. Really appreciate your help.

I am currently trying to get financial approval to donate to you guys but in the meantime maybe I could provide you with some code or something? My colleague has developed a survey redirection page so that when someone enters their unique staff number, they are directed to the survey we want them to fill in...

Also, we have just bought Fusion Charts and are incorporating it in to LimeSurvey. Perhaps we could document that and let you have any code that bridges the two applications...

Mike

Please Log in to join the conversation.

More
6 years 3 weeks ago #55868 by Mazi

Mike1985 wrote: Thanks guys. Really appreciate your help.

I am currently trying to get financial approval to donate to you guys but in the meantime maybe I could provide you with some code or something? My colleague has developed a survey redirection page so that when someone enters their unique staff number, they are directed to the survey we want them to fill in...

Also, we have just bought Fusion Charts and are incorporating it in to LimeSurvey. Perhaps we could document that and let you have any code that bridges the two applications...

Mike

Both sounds promising...

1. Can you explain the redirect in more detail?

2. We won't be able to add the Fusion Charts if this addon has to be bought but a nice documentation on how to inegrate this would be nice to be put at the workaround section.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form