frontAnswerer/lib/components/ViewPublicationPage/tools/checkEmptyData.ts

22 lines
1012 B
TypeScript
Raw Normal View History

import { QuizQuestionResult } from "@model/questionTypes/result";
export const isResultQuestionEmpty = (resultQuestion: QuizQuestionResult) => {
2024-05-31 16:41:18 +00:00
if (
(resultQuestion.title.length > 0 && resultQuestion.title !== " ") ||
(resultQuestion.description.length > 0 && resultQuestion.description !== " ") ||
2024-06-19 19:46:10 +00:00
(resultQuestion.content.back !== null &&
resultQuestion.content.back.length > 0 &&
resultQuestion.content.back !== " ") ||
2024-06-19 19:58:56 +00:00
(resultQuestion.content.originalBack &&
resultQuestion.content.originalBack.length > 0 &&
resultQuestion.content.originalBack !== " ") ||
2024-05-31 16:41:18 +00:00
(resultQuestion.content.innerName.length > 0 && resultQuestion.content.innerName !== " ") ||
(resultQuestion.content.text.length > 0 && resultQuestion.content.text !== " ") ||
(resultQuestion.content.video.length > 0 && resultQuestion.content.video !== " ") ||
(resultQuestion.content.hint.text.length > 0 && resultQuestion.content.hint.text !== " ")
)
return false;
2024-05-31 16:41:18 +00:00
return true;
};