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
Branches
Tags
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 ...@@ -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