diff --git a/src/pages/ViewPublicationPage/ResultForm.tsx b/src/pages/ViewPublicationPage/ResultForm.tsx index c601bd9..1f4b153 100644 --- a/src/pages/ViewPublicationPage/ResultForm.tsx +++ b/src/pages/ViewPublicationPage/ResultForm.tsx @@ -152,41 +152,45 @@ export const ResultForm = ({ resultQuestion }: ResultFormProps) => { - - {settings.cfg.resultInfo.showResultForm === "before" && ( - - )} - {settings.cfg.resultInfo.showResultForm === "after" && - resultQuestion.content.redirect && ( + + {settings.cfg.resultInfo.showResultForm === "before" && ( )} - + {settings.cfg.resultInfo.showResultForm === "after" && + resultQuestion.content.redirect && ( + + )} + ); diff --git a/src/utils/hooks/useQuestionFlowControl.ts b/src/utils/hooks/useQuestionFlowControl.ts index c896b7f..0f80843 100644 --- a/src/utils/hooks/useQuestionFlowControl.ts +++ b/src/utils/hooks/useQuestionFlowControl.ts @@ -97,36 +97,45 @@ export function useQuestionFlowControl() { const getNextQuestion = () => { let next + console.log(11111111111) //Искать можно двумя логиками. Основной и балловой if (Boolean(settings.cfg.score)) { //Балловая + console.log(222222222) //Ищем линейно if (linearQuestionIndex !== null) { + console.log(33333333333) next = questions[linearQuestionIndex + 1] - if (next.type === "result") next = findResultPointsLogic() + console.log(4444444) + console.log("перед ифом", next) + if (next?.type === "result" || next == undefined) next = findResultPointsLogic() + console.log(5555555555) } } else { + console.log(6666666) //Основная if (linearQuestionIndex !== null) { + console.log(777777777) //Ищем линейно next = questions[linearQuestionIndex + 1] ?? questions.find(question => question.type === "result" && question.content.rule.parentId === "line" ) } else { + console.log(88888888888888) //Ищем ветвлением next = questions.find(q => q.id === calculateNextQuestionId || q.content.id === calculateNextQuestionId); } } - if (!next) throw new Error("Не найден следующий вопрос") console.log("next", next) + if (!next) throw new Error("Не найден следующий вопрос") return next } const nextQuestion = getNextQuestion()