analytica-frontend-lib 1.1.98 → 1.1.99

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.
@@ -1197,6 +1197,15 @@ var useQuizStore = (0, import_zustand2.create)()(
1197
1197
  });
1198
1198
  }
1199
1199
  },
1200
+ skipCurrentQuestionIfUnanswered: () => {
1201
+ const { getCurrentQuestion, getCurrentAnswer, skipQuestion } = get();
1202
+ const currentQuestion = getCurrentQuestion();
1203
+ const currentAnswer = getCurrentAnswer();
1204
+ if (!currentQuestion) return;
1205
+ if (!currentAnswer || currentAnswer.optionId === null && currentAnswer.answer === null) {
1206
+ skipQuestion();
1207
+ }
1208
+ },
1200
1209
  addUserAnswer: (questionId, answerId) => {
1201
1210
  const { quiz, userAnswers } = get();
1202
1211
  if (!quiz) return;
@@ -5746,6 +5755,7 @@ var QuizFooter = (0, import_react14.forwardRef)(
5746
5755
  getUnansweredQuestionsFromUserAnswers,
5747
5756
  getCurrentAnswer,
5748
5757
  skipQuestion,
5758
+ skipCurrentQuestionIfUnanswered,
5749
5759
  getCurrentQuestion,
5750
5760
  getQuestionStatusFromUserAnswers,
5751
5761
  variant,
@@ -5770,6 +5780,7 @@ var QuizFooter = (0, import_react14.forwardRef)(
5770
5780
  const quizType = quiz?.type || "SIMULADO" /* SIMULADO */;
5771
5781
  const quizTypeLabel = getTypeLabel(quizType);
5772
5782
  const handleFinishQuiz = async () => {
5783
+ skipCurrentQuestionIfUnanswered();
5773
5784
  if (unansweredQuestions.length > 0) {
5774
5785
  openModal("alertDialog");
5775
5786
  return;