- Posts: 7
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Multiple numerical input /w automatic slider movement
- schmittg91
- Topic Author
- Offline
- New Member
Less
More
4 years 8 months ago #187093
by schmittg91
Multiple numerical input /w automatic slider movement was created by schmittg91
Hello LS community,
I'm evaluating several survey tools for my master thesis and there is one unusual requirement. After searching the forum for a while, I decided to post this.
Participants are asked to predict NFL games. For each game they need to forecast the likelihood that the home or away team wins (multiple numeric input values between 0-100%). Obviously, the sum of the home and away team winning chances have to be 100% in total.
I figured out how to set the initial slider value to 50% and equals sum value helps to make sure the outcome predictions sum up to 100.
Here is where I struggle:
When a participant drags the slider for the home team away from its initial value of 50%, the away team slider should adjust itself accordingly (so that the sum is always 100%).
I really appreciate your help!
Thanks,
Gregor
I'm evaluating several survey tools for my master thesis and there is one unusual requirement. After searching the forum for a while, I decided to post this.
Participants are asked to predict NFL games. For each game they need to forecast the likelihood that the home or away team wins (multiple numeric input values between 0-100%). Obviously, the sum of the home and away team winning chances have to be 100% in total.
I figured out how to set the initial slider value to 50% and equals sum value helps to make sure the outcome predictions sum up to 100.
Here is where I struggle:
When a participant drags the slider for the home team away from its initial value of 50%, the away team slider should adjust itself accordingly (so that the sum is always 100%).
I really appreciate your help!
Thanks,
Gregor
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3965
4 years 8 months ago - 4 years 8 months ago #187096
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Multiple numerical input /w automatic slider movement
Hm,
and why do you use two separate sliders?
In my opinion it is sufficient to use one.
You can use a bit more css to have the segments of the slider in different colors.
Joffm
and why do you use two separate sliders?
In my opinion it is sufficient to use one.
You can use a bit more css to have the segments of the slider in different colors.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
Last edit: 4 years 8 months ago by Joffm.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10098
- Thank you received: 3589
4 years 8 months ago #187098
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Multiple numerical input /w automatic slider movement
Here is a custom question theme that demonstrates how to programmatically move sliders -
github.com/tpartner/LimeSurvey-Pricing-Sliders-3.x
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11637
- Thank you received: 2737
4 years 8 months ago #187099
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Multiple numerical input /w automatic slider movement
I agree with Joffm, why make it complicated, if you can simplify. At the end of the day the simplest solution in your case is to use one slider with the two teams as extremes, then per definition the chances of one team are reduced when the chances of the other team are increased.
However, you'll have to move away from the 100% thingy, but you can always recalculate this value later, if you really need to have those values.
However, you'll have to move away from the 100% thingy, but you can always recalculate this value later, if you really need to have those values.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- schmittg91
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 1
4 years 8 months ago #187123
by schmittg91
Replied by schmittg91 on topic Multiple numerical input /w automatic slider movement
Thank you for the pointer. However, I do lack the skills to adapt the solution to my needs.
The topic has been locked.
- schmittg91
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 1
4 years 8 months ago #187124
by schmittg91
Replied by schmittg91 on topic Multiple numerical input /w automatic slider movement
Thank you, Joffm. I'm doing some testing to see if I can make it work with one slider.
Is there a resource (like a cheatsheet) where I can look up all the CSS codes/ placeholder fields related to sliders?
Is there a resource (like a cheatsheet) where I can look up all the CSS codes/ placeholder fields related to sliders?
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3965
4 years 8 months ago #187126
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Multiple numerical input /w automatic slider movement
Hi,
here you will find something
www.limesurvey.org/forum/design-issues/1...alize-sliders-design
I used additionally
And of course you may use a webdevelopment tool which is included in each modern browser.
Here you find the involved css classes:
e.g.
Best regards
Joffm
here you will find something
www.limesurvey.org/forum/design-issues/1...alize-sliders-design
I used additionally
Code:
.slider.slider-horizontal .slider-track { height: 20px; margin-top: 5px; } .slider-handle { height: 40px; }
And of course you may use a webdevelopment tool which is included in each modern browser.
Here you find the involved css classes:
e.g.
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- schmittg91
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 1
4 years 8 months ago - 4 years 8 months ago #187156
by schmittg91
Replied by schmittg91 on topic Multiple numerical input /w automatic slider movement
Thanks again, Joffm! I'll be looking more into css templates and how to adapt this for my needs.
How did you get the winning probabilities in the help text of the question? Was that by using placeholders?
How did you get the winning probabilities in the help text of the question? Was that by using placeholders?
Last edit: 4 years 8 months ago by schmittg91.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3965
4 years 8 months ago #187160
by Joffm
Plain:
Probability: Team A:{100-Q1_SQ001.NAOK}%, Team B: {Q1_SQ001.NAOK}%
With some css_
Probability: <span style="color:#d35400;">Team A:{100-Q1_SQ001.NAOK}%</span>, <span style="color:#1abc9c;">Team B: {Q1_SQ001.NAOK}%</span>
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Multiple numerical input /w automatic slider movement
Yes, the normal thing:How did you get the winning probabilities in the help text of the question? Was that by using placeholders?
Plain:
Probability: Team A:{100-Q1_SQ001.NAOK}%, Team B: {Q1_SQ001.NAOK}%
With some css_
Probability: <span style="color:#d35400;">Team A:{100-Q1_SQ001.NAOK}%</span>, <span style="color:#1abc9c;">Team B: {Q1_SQ001.NAOK}%</span>
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- schmittg91
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 1
4 years 8 months ago #187178
by schmittg91
That helped a lot, thanks.
Is there a resource where I can loop up all the placeholder codes like NAOK or do I just have to know them? I could find any references in the manual.
Replied by schmittg91 on topic Multiple numerical input /w automatic slider movement
Joffm wrote:
Yes, the normal thing:How did you get the winning probabilities in the help text of the question? Was that by using placeholders?
Plain:
Probability: Team A:{100-Q1_SQ001.NAOK}%, Team B: {Q1_SQ001.NAOK}%
With some css_
Probability: <span style="color:#d35400;">Team A:{100-Q1_SQ001.NAOK}%</span>, <span style="color:#1abc9c;">Team B: {Q1_SQ001.NAOK}%</span>
Joffm
That helped a lot, thanks.
Is there a resource where I can loop up all the placeholder codes like NAOK or do I just have to know them? I could find any references in the manual.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12881
- Thank you received: 3965
4 years 8 months ago #187181
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Multiple numerical input /w automatic slider movement
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.