Skip to content
Snippets Groups Projects
Commit 34c21945 authored by Henk van der Veen's avatar Henk van der Veen
Browse files

Merge branch 'hh_slider_attrs' into 'main'

add minimum, maximum and step to integer and float questions, to make sliders possible

See merge request !18
parents 524b04c2 bdb15546
No related branches found
No related tags found
1 merge request!18add minimum, maximum and step to integer and float questions, to make sliders possible
Pipeline #91499 passed
......@@ -5,6 +5,15 @@ module Quby
module Entities
module Questions
class FloatQuestion < Question
def as_json(options = {})
super.merge(
minimum: minimum,
maximum: maximum,
step: 0.01, # fixed in v1.
# defaultPosition: default_position # Needs discussion, can be number or string "hidden"
)
end
def size
@size || 30
end
......
......@@ -5,6 +5,15 @@ module Quby
module Entities
module Questions
class IntegerQuestion < Question
def as_json(options = {})
super.merge(
minimum: minimum,
maximum: maximum,
step: 1, # fixed in v1.
# defaultPosition: default_position # Needs discussion, can be number or string "hidden"
)
end
def size
@size || 30
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment