From 497f3a8f6852d309e9d156b15ce114b311241711 Mon Sep 17 00:00:00 2001 From: Daniel Egger Date: Tue, 26 Sep 2023 13:50:35 +0200 Subject: [PATCH] Make text responses mandatory --- .../learningContentPage/feedback/FeedbackBlock.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlock.vue b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlock.vue index 96e35d57..b8d3ba88 100644 --- a/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlock.vue +++ b/client/src/pages/learningPath/learningContentPage/feedback/FeedbackBlock.vue @@ -165,7 +165,19 @@ const nextStep = () => { function hasStepValidInput(stepNumber: number) { const question = questionData[stepNumber - 1]; if (question) { - return feedbackData[question.modelKey] !== null; + if ( + [ + "instructor_open_feedback", + "course_negative_feedback", + "course_positive_feedback", + ].includes(question.modelKey) + ) { + // text response questions need to have a "truthy" value (not "" or null) + return feedbackData[question.modelKey]; + } else { + // other responses need to have data, can be `0` or `false` + return feedbackData[question.modelKey] !== null; + } } return true; }