diff --git a/README.md b/README.md index 28d7ab55e..f41e7c603 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,7 @@ The JSON should follow the structure: "min": Integer, // numeric only "max": Integer, // numeric only "step": Integer, // numeric only + "width": Integer, // text and numeric only "answer_options": { // checkbox and radio only "0": String, "1": String diff --git a/app/models/form/question.rb b/app/models/form/question.rb index e71e2f6d9..8c6aba962 100644 --- a/app/models/form/question.rb +++ b/app/models/form/question.rb @@ -1,6 +1,6 @@ class Form::Question attr_accessor :id, :header, :hint_text, :description, :questions, - :type, :min, :max, :step, :fields_to_add, :result_field, + :type, :min, :max, :step, :width, :fields_to_add, :result_field, :conditional_for, :readonly, :answer_options, :page, :check_answer_label def initialize(id, hsh, page) @@ -12,6 +12,7 @@ class Form::Question @min = hsh["min"] @max = hsh["max"] @step = hsh["step"] + @width = hsh["width"] @fields_to_add = hsh["fields-to-add"] @result_field = hsh["result-field"] @readonly = hsh["readonly"] diff --git a/config/forms/schema/2021_2022.json b/config/forms/schema/2021_2022.json index cd8f13530..d91600c4d 100644 --- a/config/forms/schema/2021_2022.json +++ b/config/forms/schema/2021_2022.json @@ -27,9 +27,9 @@ "properties": { "label": { "description": "", - "type": "string" + "type": "string" }, - "subsections": { + "subsections": { "type": "object", "patternProperties": { "[a-z_]+": { @@ -41,7 +41,7 @@ "description": "", "type": "string" }, - "pages": { + "pages": { "type": "object", "patternProperties": { "[a-z_]+": { @@ -80,6 +80,10 @@ "description": "", "type": "string" }, + "width": { + "description": "", + "type": "integer" + }, "answer_options": { "description": "", "type": "object" @@ -95,18 +99,18 @@ }, "minProperties": 1 } - } + } } }, "minProperties": 1 } - } + } } - }, + }, "minProperties": 2 } }, "minProperties": 1 } } -} \ No newline at end of file +}