Skip to content

Commit 429f8ec

Browse files
committed
feat: add linear scale answer type and associated settings
Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
1 parent b6273be commit 429f8ec

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

lib/Constants.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class Constants {
7575
public const ANSWER_TYPE_DATETIME = 'datetime';
7676
public const ANSWER_TYPE_TIME = 'time';
7777
public const ANSWER_TYPE_FILE = 'file';
78+
public const ANSWER_TYPE_LINEARSCALE = 'linearscale';
7879

7980
// All AnswerTypes
8081
public const ANSWER_TYPES = [
@@ -87,13 +88,15 @@ class Constants {
8788
self::ANSWER_TYPE_DATETIME,
8889
self::ANSWER_TYPE_TIME,
8990
self::ANSWER_TYPE_FILE,
91+
self::ANSWER_TYPE_LINEARSCALE,
9092
];
9193

9294
// AnswerTypes, that need/have predefined Options
9395
public const ANSWER_TYPES_PREDEFINED = [
9496
self::ANSWER_TYPE_MULTIPLE,
9597
self::ANSWER_TYPE_MULTIPLEUNIQUE,
96-
self::ANSWER_TYPE_DROPDOWN
98+
self::ANSWER_TYPE_DROPDOWN,
99+
self::ANSWER_TYPE_LINEARSCALE
97100
];
98101

99102
// AnswerTypes for date/time questions
@@ -155,6 +158,13 @@ class Constants {
155158
'x-office/spreadsheet',
156159
];
157160

161+
public const EXTRA_SETTINGS_LINEARSCALE = [
162+
'optionsStart' => ['integer'],
163+
'optionsEnd' => ['integer'],
164+
'optionsLabelBest' => ['string'],
165+
'optionsLabelWorst' => ['string'],
166+
];
167+
158168
public const FILENAME_INVALID_CHARS = [
159169
"\n",
160170
'/',

lib/ResponseDefinitions.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@
2525
* allowedFileTypes?: list<string>,
2626
* maxAllowedFilesCount?: int,
2727
* maxFileSize?: int,
28+
* optionsEnd?: int,
29+
* optionsLabelBest?: string,
30+
* optionsLabelWorst?: string,
2831
* optionsLimitMax?: int,
2932
* optionsLimitMin?: int,
33+
* optionsStart?: int
3034
* shuffleOptions?: bool,
3135
* validationRegex?: string,
3236
* validationType?: string

0 commit comments

Comments
 (0)