diff --git a/lib/Service/FormsService.php b/lib/Service/FormsService.php index d0e93f5b8..f4a0445e7 100644 --- a/lib/Service/FormsService.php +++ b/lib/Service/FormsService.php @@ -130,6 +130,11 @@ public function getQuestions(int $formId): array { } } + // Set `isRequired` if minimum options limit is set + if ($question['type'] === Constants::ANSWER_TYPE_MULTIPLE && $question['extraSettings']['optionsLimitMin'] > 0) { + $question['isRequired'] = true; + } + $questionList[] = $question; } } catch (DoesNotExistException $e) { diff --git a/src/components/Questions/Question.vue b/src/components/Questions/Question.vue index 4fe673ec0..8b40cbe7d 100644 --- a/src/components/Questions/Question.vue +++ b/src/components/Questions/Question.vue @@ -147,6 +147,9 @@ v-html="computedDescription" /> + + {{ infoMessage }} + {{ errorMessage }} @@ -270,6 +273,11 @@ export default { type: String, default: null, }, + + infoMessage: { + type: String, + default: null, + }, }, emits: [ @@ -329,9 +337,17 @@ export default { return !!this.errorMessage }, + hasInfo() { + return !!this.infoMessage + }, + errorId() { return `q${this.index}_error` }, + + infoId() { + return `q${this.index}_info` + }, }, // Ensure description is sized correctly on initial render diff --git a/src/components/Questions/QuestionMultiple.vue b/src/components/Questions/QuestionMultiple.vue index 50e6741f5..d7f61fdeb 100644 --- a/src/components/Questions/QuestionMultiple.vue +++ b/src/components/Questions/QuestionMultiple.vue @@ -11,6 +11,7 @@ :contentValid="contentValid" :shiftDragHandle="shiftDragHandle" :errorMessage="errorMessage" + :infoMessage="infoMessage" v-on="commonListeners">