Skip to content
Snippets Groups Projects
Commit bdb15546 authored by Henk's avatar Henk
Browse files

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

parent 524b04c2
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 #85823 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