analytica-frontend-lib 1.1.98 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1170,6 +1170,15 @@ var useQuizStore = create2()(
1170
1170
  });
1171
1171
  }
1172
1172
  },
1173
+ skipCurrentQuestionIfUnanswered: () => {
1174
+ const { getCurrentQuestion, getCurrentAnswer, skipQuestion } = get();
1175
+ const currentQuestion = getCurrentQuestion();
1176
+ const currentAnswer = getCurrentAnswer();
1177
+ if (!currentQuestion) return;
1178
+ if (!currentAnswer || currentAnswer.optionId === null && currentAnswer.answer === null) {
1179
+ skipQuestion();
1180
+ }
1181
+ },
1173
1182
  addUserAnswer: (questionId, answerId) => {
1174
1183
  const { quiz, userAnswers } = get();
1175
1184
  if (!quiz) return;
@@ -5771,6 +5780,7 @@ var QuizFooter = forwardRef11(
5771
5780
  getUnansweredQuestionsFromUserAnswers,
5772
5781
  getCurrentAnswer,
5773
5782
  skipQuestion,
5783
+ skipCurrentQuestionIfUnanswered,
5774
5784
  getCurrentQuestion,
5775
5785
  getQuestionStatusFromUserAnswers,
5776
5786
  variant,
@@ -5795,6 +5805,7 @@ var QuizFooter = forwardRef11(
5795
5805
  const quizType = quiz?.type || "SIMULADO" /* SIMULADO */;
5796
5806
  const quizTypeLabel = getTypeLabel(quizType);
5797
5807
  const handleFinishQuiz = async () => {
5808
+ skipCurrentQuestionIfUnanswered();
5798
5809
  if (unansweredQuestions.length > 0) {
5799
5810
  openModal("alertDialog");
5800
5811
  return;