Make text responses mandatory

This commit is contained in:
Daniel Egger 2023-09-26 13:50:35 +02:00
parent 7a037e05ec
commit 497f3a8f68
1 changed files with 13 additions and 1 deletions

View File

@ -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;
}