Make text responses mandatory
This commit is contained in:
parent
7a037e05ec
commit
497f3a8f68
|
|
@ -165,7 +165,19 @@ const nextStep = () => {
|
||||||
function hasStepValidInput(stepNumber: number) {
|
function hasStepValidInput(stepNumber: number) {
|
||||||
const question = questionData[stepNumber - 1];
|
const question = questionData[stepNumber - 1];
|
||||||
if (question) {
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue