Need to show an updating average of sliders | XM Community
Skip to main content
Question

Need to show an updating average of sliders


I'm trying to code a survey. I have a set of 6 sliders that I would like to present to my survey participants to have them select a value from 1-10. I am aware I can do this using either individual slider questions or the constant sum with the slider option.
However, what I am having difficultly with is I would like to present an updating average on the screen with the sliders (average rounded to the nearest integer)
For example:
If the sliders were set to the following:
Slider 1: 5
Slider 2: 4
Slider 3: 7
Slider 4: 6
Slider 5: 8
Slider 6: 4

Then it would show:
The current average is: 6

And this average would update as the user updated the sliders. If sliders aren't possible than I would use text entry boxes instead of the sliders, but sliders are preferred.

Thanks for your help!

2 replies

rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • 1449 replies
  • October 6, 2020

Use JS Mutation Observer to get the current slider value, and calculate and show the average result accordingly.


  • Author
  • 1 reply
  • October 7, 2020

Do you have an example of a Mutation Observer code section?


Leave a Reply