analytica-frontend-lib 1.1.97 → 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.
- package/dist/Quiz/index.js +11 -1
- package/dist/Quiz/index.js.map +1 -1
- package/dist/Quiz/index.mjs +11 -1
- package/dist/Quiz/index.mjs.map +1 -1
- package/dist/Quiz/useQuizStore/index.d.mts +1 -0
- package/dist/Quiz/useQuizStore/index.d.ts +1 -0
- package/dist/Quiz/useQuizStore/index.js +9 -0
- package/dist/Quiz/useQuizStore/index.js.map +1 -1
- package/dist/Quiz/useQuizStore/index.mjs +9 -0
- package/dist/Quiz/useQuizStore/index.mjs.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/Quiz/index.mjs
CHANGED
|
@@ -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;
|
|
@@ -5901,7 +5912,6 @@ var QuizFooter = forwardRef11(
|
|
|
5901
5912
|
size: "medium",
|
|
5902
5913
|
variant: "solid",
|
|
5903
5914
|
action: "primary",
|
|
5904
|
-
disabled: !currentAnswer && !isCurrentQuestionSkipped,
|
|
5905
5915
|
onClick: handleFinishQuiz,
|
|
5906
5916
|
children: "Finalizar"
|
|
5907
5917
|
}
|