Skip to content

Commit a921f2a

Browse files
timedin-demickenordin
authored andcommitted
fix: selectors for linear scale
Signed-off-by: TimedIn <git@timedin.net>
1 parent 5ec342e commit a921f2a

2 files changed

Lines changed: 26 additions & 12 deletions

File tree

docs/DataStructure.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -301,18 +301,18 @@ Subquestions (questions belonging to a conditional question's branch) have addit
301301

302302
Supported trigger types for conditional questions:
303303

304-
| Trigger Type | Condition Type | Description |
305-
| ----------------- | ------------------------------------------------------------------------------ | --------------------------------------------------- |
306-
| `multiple_unique` | `option_selected` | Radio buttons - single option selection |
307-
| `dropdown` | `option_selected` | Dropdown - single option selection |
308-
| `multiple` | `options_combination` | Checkboxes - all specified options must be selected |
309-
| `short` | `string_equals`, `string_contains`, `regex` | Short text with string/regex matching |
310-
| `long` | `string_contains`, `regex` | Long text with string/regex matching |
311-
| `linearscale` | `value_equals`, `value_not_equals`, `value_range`, `value_min`, `value_max` \* | Linear scale with value matching |
312-
| `date` | `date_range` | Date with date range matching (YYYY-MM-DD) |
313-
| `time` | `time_range` | Time with time range matching (HH:mm) |
314-
| `color` | `value_equals` | Color with exact value matching |
315-
| `file` | `file_uploaded` | File with upload status matching |
304+
| Trigger Type | Condition Type | Description |
305+
| ----------------- | ---------------------------------------------------------------------------------------------- | --------------------------------------------- |
306+
| `multiple_unique` | `option_selected`, `option_not_selected` | Radio buttons - single option selection |
307+
| `dropdown` | `option_selected`, `option_not_selected` | Dropdown - single option selection |
308+
| `multiple` | `option_selected`, `option_not_selected`, `options_combination` | Checkbox - option or combination matching |
309+
| `short` | `string_equals`, `string_not_equals`, `string_contains`, `string_not_contains`, `regex` | Short text - string or regex matching |
310+
| `long` | `string_contains`, `string_not_contains`, `regex` | Long text - string or regex matching |
311+
| `linearscale` | `value_equals`, `value_not_equals`, `value_range`, `value_min`, `value_max` | Linear scale - numeric value matching |
312+
| `date` | `date_equals`, `date_before`, `date_after`, `date_range` | Date - exact or range matching (`YYYY-MM-DD`) |
313+
| `time` | `time_equals`, `time_before`, `time_after`, `time_range` | Time - exact or range matching (`HH:mm`) |
314+
| `color` | `value_equals` | Color - exact value matching |
315+
| `file` | `file_uploaded`, `file_not_uploaded`, `filename_contains`, `filename_equals`, `filename_regex` | File - upload status or filename matching |
316316

317317
### Branch Object
318318

lib/Service/SubmissionService.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,12 +902,26 @@ private function evaluateBranchConditions(string $triggerType, array $triggerAns
902902
if ($numValue == (float)($condition['value'] ?? 0)) {
903903
return true;
904904
}
905+
} elseif ($type === 'value_not_equals') {
906+
if ($numValue != (float)($condition['value'] ?? 0)) {
907+
return true;
908+
}
905909
} elseif ($type === 'value_range') {
906910
$min = $condition['min'] ?? -PHP_FLOAT_MAX;
907911
$max = $condition['max'] ?? PHP_FLOAT_MAX;
908912
if ($numValue >= $min && $numValue <= $max) {
909913
return true;
910914
}
915+
} elseif ($type === 'value_min') {
916+
$min = $condition['min'] ?? -PHP_FLOAT_MAX;
917+
if ($numValue >= $min) {
918+
return true;
919+
}
920+
} elseif ($type === 'value_max') {
921+
$max = $condition['max'] ?? PHP_FLOAT_MAX;
922+
if ($numValue <= $max) {
923+
return true;
924+
}
911925
}
912926
}
913927
return false;

0 commit comments

Comments
 (0)