2
0

feat(results): 🛂 Limit incomplete submissions

This commit is contained in:
Baptiste Arnaud
2022-02-12 12:54:16 +01:00
parent 3a7b9a0c63
commit ec470b578c
11 changed files with 93 additions and 32 deletions

View File

@ -92,10 +92,10 @@ export const ChatBlock = ({
const isSingleChoiceStep =
isChoiceInput(currentStep) && !currentStep.options.isMultipleChoice
if (isSingleChoiceStep) {
onBlockEnd(
currentStep.items.find((i) => i.content === answerContent)
?.outgoingEdgeId
)
const nextEdgeId = currentStep.items.find(
(i) => i.content === answerContent
)?.outgoingEdgeId
if (nextEdgeId) return onBlockEnd(nextEdgeId)
}
if (currentStep?.outgoingEdgeId || displayedSteps.length === steps.length)

View File

@ -5,5 +5,5 @@ export type Answer = Omit<AnswerFromPrisma, 'resultId' | 'createdAt'>
export type Stats = {
totalViews: number
totalStarts: number
completionRate: number
totalCompleted: number
}