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.
package/dist/index.js CHANGED
@@ -10747,6 +10747,15 @@ var useQuizStore = (0, import_zustand10.create)()(
10747
10747
  });
10748
10748
  }
10749
10749
  },
10750
+ skipCurrentQuestionIfUnanswered: () => {
10751
+ const { getCurrentQuestion, getCurrentAnswer, skipQuestion } = get();
10752
+ const currentQuestion = getCurrentQuestion();
10753
+ const currentAnswer = getCurrentAnswer();
10754
+ if (!currentQuestion) return;
10755
+ if (!currentAnswer || currentAnswer.optionId === null && currentAnswer.answer === null) {
10756
+ skipQuestion();
10757
+ }
10758
+ },
10750
10759
  addUserAnswer: (questionId, answerId) => {
10751
10760
  const { quiz, userAnswers } = get();
10752
10761
  if (!quiz) return;
@@ -12188,6 +12197,7 @@ var QuizFooter = (0, import_react37.forwardRef)(
12188
12197
  getUnansweredQuestionsFromUserAnswers,
12189
12198
  getCurrentAnswer,
12190
12199
  skipQuestion,
12200
+ skipCurrentQuestionIfUnanswered,
12191
12201
  getCurrentQuestion,
12192
12202
  getQuestionStatusFromUserAnswers,
12193
12203
  variant,
@@ -12212,6 +12222,7 @@ var QuizFooter = (0, import_react37.forwardRef)(
12212
12222
  const quizType = quiz?.type || "SIMULADO" /* SIMULADO */;
12213
12223
  const quizTypeLabel = getTypeLabel(quizType);
12214
12224
  const handleFinishQuiz = async () => {
12225
+ skipCurrentQuestionIfUnanswered();
12215
12226
  if (unansweredQuestions.length > 0) {
12216
12227
  openModal("alertDialog");
12217
12228
  return;