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
Branches
Tags
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 ...@@ -5,6 +5,15 @@ module Quby
module Entities module Entities
module Questions module Questions
class FloatQuestion < Question 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 def size
@size || 30 @size || 30
end end
......
...@@ -5,6 +5,15 @@ module Quby ...@@ -5,6 +5,15 @@ module Quby
module Entities module Entities
module Questions module Questions
class IntegerQuestion < Question 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 def size
@size || 30 @size || 30
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment