analytica-frontend-lib 1.1.8 → 1.1.10
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.d.mts +7 -8
- package/dist/Quiz/index.d.ts +7 -8
- package/dist/Quiz/index.js +146 -99
- package/dist/Quiz/index.js.map +1 -1
- package/dist/Quiz/index.mjs +146 -99
- package/dist/Quiz/index.mjs.map +1 -1
- package/dist/Quiz/useQuizStore/index.d.mts +70 -16
- package/dist/Quiz/useQuizStore/index.d.ts +70 -16
- package/dist/Quiz/useQuizStore/index.js +45 -12
- package/dist/Quiz/useQuizStore/index.js.map +1 -1
- package/dist/Quiz/useQuizStore/index.mjs +45 -12
- package/dist/Quiz/useQuizStore/index.mjs.map +1 -1
- package/dist/VideoPlayer/index.js +11 -6
- package/dist/VideoPlayer/index.js.map +1 -1
- package/dist/VideoPlayer/index.mjs +11 -6
- package/dist/VideoPlayer/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +159 -105
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +158 -105
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/Quiz/index.mjs
CHANGED
|
@@ -978,6 +978,8 @@ var useQuizStore = create2()(
|
|
|
978
978
|
isFinished: false,
|
|
979
979
|
userId: "",
|
|
980
980
|
variant: "default",
|
|
981
|
+
questionsResult: null,
|
|
982
|
+
currentQuestionResult: null,
|
|
981
983
|
// Setters
|
|
982
984
|
setBySimulated: (simulado) => set({ bySimulated: simulado }),
|
|
983
985
|
setByActivity: (atividade) => set({ byActivity: atividade }),
|
|
@@ -986,6 +988,7 @@ var useQuizStore = create2()(
|
|
|
986
988
|
setUserAnswers: (userAnswers) => set({ userAnswers }),
|
|
987
989
|
getUserId: () => get().userId,
|
|
988
990
|
setVariant: (variant) => set({ variant }),
|
|
991
|
+
setQuestionResult: (questionsResult) => set({ questionsResult }),
|
|
989
992
|
// Navigation
|
|
990
993
|
goToNextQuestion: () => {
|
|
991
994
|
const { currentQuestionIndex, getTotalQuestions } = get();
|
|
@@ -1038,9 +1041,9 @@ var useQuizStore = create2()(
|
|
|
1038
1041
|
questionId,
|
|
1039
1042
|
activityId,
|
|
1040
1043
|
userId,
|
|
1041
|
-
answer: question.
|
|
1042
|
-
optionId: question.
|
|
1043
|
-
questionType: question.
|
|
1044
|
+
answer: question.questionType === "DISSERTATIVA" /* DISSERTATIVA */ ? answerId : null,
|
|
1045
|
+
optionId: question.questionType === "DISSERTATIVA" /* DISSERTATIVA */ ? null : answerId,
|
|
1046
|
+
questionType: question.questionType,
|
|
1044
1047
|
answerStatus: "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */
|
|
1045
1048
|
};
|
|
1046
1049
|
let updatedUserAnswers;
|
|
@@ -1080,7 +1083,7 @@ var useQuizStore = create2()(
|
|
|
1080
1083
|
// selectMultipleAnswer is for non-dissertative questions
|
|
1081
1084
|
optionId: answerId,
|
|
1082
1085
|
// selectMultipleAnswer should only set optionId
|
|
1083
|
-
questionType: question.
|
|
1086
|
+
questionType: question.questionType,
|
|
1084
1087
|
answerStatus: "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */
|
|
1085
1088
|
})
|
|
1086
1089
|
);
|
|
@@ -1107,7 +1110,7 @@ var useQuizStore = create2()(
|
|
|
1107
1110
|
const question = activeQuiz.quiz.questions.find(
|
|
1108
1111
|
(q) => q.id === questionId
|
|
1109
1112
|
);
|
|
1110
|
-
if (!question || question.
|
|
1113
|
+
if (!question || question.questionType !== "DISSERTATIVA" /* DISSERTATIVA */) {
|
|
1111
1114
|
console.warn(
|
|
1112
1115
|
"selectDissertativeAnswer called for non-dissertative question"
|
|
1113
1116
|
);
|
|
@@ -1157,7 +1160,7 @@ var useQuizStore = create2()(
|
|
|
1157
1160
|
userId,
|
|
1158
1161
|
answer: null,
|
|
1159
1162
|
optionId: null,
|
|
1160
|
-
questionType: currentQuestion.
|
|
1163
|
+
questionType: currentQuestion.questionType,
|
|
1161
1164
|
answerStatus: "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */
|
|
1162
1165
|
};
|
|
1163
1166
|
let updatedUserAnswers;
|
|
@@ -1193,9 +1196,9 @@ var useQuizStore = create2()(
|
|
|
1193
1196
|
questionId,
|
|
1194
1197
|
activityId,
|
|
1195
1198
|
userId,
|
|
1196
|
-
answer: question.
|
|
1197
|
-
optionId: question.
|
|
1198
|
-
questionType: question.
|
|
1199
|
+
answer: question.questionType === "DISSERTATIVA" /* DISSERTATIVA */ ? answerId || null : null,
|
|
1200
|
+
optionId: question.questionType !== "DISSERTATIVA" /* DISSERTATIVA */ ? answerId || null : null,
|
|
1201
|
+
questionType: question.questionType,
|
|
1199
1202
|
answerStatus: "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */
|
|
1200
1203
|
};
|
|
1201
1204
|
if (existingAnswerIndex !== -1) {
|
|
@@ -1223,7 +1226,10 @@ var useQuizStore = create2()(
|
|
|
1223
1226
|
timeElapsed: 0,
|
|
1224
1227
|
isStarted: false,
|
|
1225
1228
|
isFinished: false,
|
|
1226
|
-
userId: ""
|
|
1229
|
+
userId: "",
|
|
1230
|
+
variant: "default",
|
|
1231
|
+
questionsResult: null,
|
|
1232
|
+
currentQuestionResult: null
|
|
1227
1233
|
});
|
|
1228
1234
|
},
|
|
1229
1235
|
// Timer
|
|
@@ -1425,6 +1431,31 @@ var useQuizStore = create2()(
|
|
|
1425
1431
|
(q) => q.id === questionId
|
|
1426
1432
|
);
|
|
1427
1433
|
return questionIndex + 1;
|
|
1434
|
+
},
|
|
1435
|
+
// Question Result
|
|
1436
|
+
getQuestionResultByQuestionId: (questionId) => {
|
|
1437
|
+
const { questionsResult } = get();
|
|
1438
|
+
return questionsResult?.answers.find(
|
|
1439
|
+
(answer) => answer.questionId === questionId
|
|
1440
|
+
) || null;
|
|
1441
|
+
},
|
|
1442
|
+
getQuestionResultStatistics: () => {
|
|
1443
|
+
const { questionsResult } = get();
|
|
1444
|
+
return questionsResult?.statistics || null;
|
|
1445
|
+
},
|
|
1446
|
+
getQuestionResult: () => {
|
|
1447
|
+
const { questionsResult } = get();
|
|
1448
|
+
return questionsResult;
|
|
1449
|
+
},
|
|
1450
|
+
setQuestionsResult: (questionsResult) => {
|
|
1451
|
+
set({ questionsResult });
|
|
1452
|
+
},
|
|
1453
|
+
setCurrentQuestionResult: (currentQuestionResult) => {
|
|
1454
|
+
set({ currentQuestionResult });
|
|
1455
|
+
},
|
|
1456
|
+
getCurrentQuestionResult: () => {
|
|
1457
|
+
const { currentQuestionResult } = get();
|
|
1458
|
+
return currentQuestionResult;
|
|
1428
1459
|
}
|
|
1429
1460
|
};
|
|
1430
1461
|
},
|
|
@@ -4548,18 +4579,21 @@ var Quiz = forwardRef10(({ children, className, variant = "default", ...props },
|
|
|
4548
4579
|
});
|
|
4549
4580
|
var QuizHeaderResult = forwardRef10(
|
|
4550
4581
|
({ className, ...props }, ref) => {
|
|
4551
|
-
const {
|
|
4552
|
-
const usersAnswer = getAllCurrentAnswer();
|
|
4582
|
+
const { getQuestionResultByQuestionId, getCurrentQuestion } = useQuizStore();
|
|
4553
4583
|
const [isCorrect, setIsCorrect] = useState7(false);
|
|
4554
4584
|
useEffect7(() => {
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
).every(Boolean) : false
|
|
4560
|
-
);
|
|
4585
|
+
const cq = getCurrentQuestion();
|
|
4586
|
+
if (!cq) {
|
|
4587
|
+
setIsCorrect(false);
|
|
4588
|
+
return;
|
|
4561
4589
|
}
|
|
4562
|
-
|
|
4590
|
+
const qr = getQuestionResultByQuestionId(cq.id);
|
|
4591
|
+
setIsCorrect(qr?.answerStatus === "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */);
|
|
4592
|
+
}, [
|
|
4593
|
+
getCurrentQuestion,
|
|
4594
|
+
getQuestionResultByQuestionId,
|
|
4595
|
+
getCurrentQuestion()?.id
|
|
4596
|
+
]);
|
|
4563
4597
|
return /* @__PURE__ */ jsxs14(
|
|
4564
4598
|
"div",
|
|
4565
4599
|
{
|
|
@@ -4642,7 +4676,7 @@ var QuizContainer = forwardRef10(({ children, className, ...props }, ref) => {
|
|
|
4642
4676
|
);
|
|
4643
4677
|
});
|
|
4644
4678
|
var QuizContent = forwardRef10(({ paddingBottom }) => {
|
|
4645
|
-
const { getCurrentQuestion
|
|
4679
|
+
const { getCurrentQuestion } = useQuizStore();
|
|
4646
4680
|
const currentQuestion = getCurrentQuestion();
|
|
4647
4681
|
const questionComponents = {
|
|
4648
4682
|
["ALTERNATIVA" /* ALTERNATIVA */]: QuizAlternative,
|
|
@@ -4653,26 +4687,35 @@ var QuizContent = forwardRef10(({ paddingBottom }) => {
|
|
|
4653
4687
|
["PREENCHER" /* PREENCHER */]: QuizFill,
|
|
4654
4688
|
["IMAGEM" /* IMAGEM */]: QuizImageQuestion
|
|
4655
4689
|
};
|
|
4656
|
-
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.
|
|
4657
|
-
return QuestionComponent ? /* @__PURE__ */ jsx17(QuestionComponent, {
|
|
4690
|
+
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.questionType] : null;
|
|
4691
|
+
return QuestionComponent ? /* @__PURE__ */ jsx17(QuestionComponent, { paddingBottom }) : null;
|
|
4658
4692
|
});
|
|
4659
|
-
var QuizAlternative = ({
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4693
|
+
var QuizAlternative = ({ paddingBottom }) => {
|
|
4694
|
+
const {
|
|
4695
|
+
getCurrentQuestion,
|
|
4696
|
+
selectAnswer,
|
|
4697
|
+
getQuestionResultByQuestionId,
|
|
4698
|
+
getCurrentAnswer,
|
|
4699
|
+
variant
|
|
4700
|
+
} = useQuizStore();
|
|
4664
4701
|
const currentQuestion = getCurrentQuestion();
|
|
4702
|
+
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
4703
|
+
currentQuestion?.id || ""
|
|
4704
|
+
);
|
|
4665
4705
|
const currentAnswer = getCurrentAnswer();
|
|
4666
4706
|
const alternatives = currentQuestion?.options?.map((option) => {
|
|
4667
4707
|
let status = "neutral" /* NEUTRAL */;
|
|
4668
4708
|
if (variant === "result") {
|
|
4669
|
-
const isCorrectOption = currentQuestion.
|
|
4670
|
-
|
|
4709
|
+
const isCorrectOption = currentQuestion.correctOptionIds?.includes(
|
|
4710
|
+
option.id
|
|
4671
4711
|
);
|
|
4672
|
-
|
|
4712
|
+
const isSelected = currentQuestionResult?.optionId === option.id;
|
|
4713
|
+
if (isCorrectOption) {
|
|
4673
4714
|
status = "correct" /* CORRECT */;
|
|
4674
|
-
} else if (
|
|
4715
|
+
} else if (isSelected && !isCorrectOption) {
|
|
4675
4716
|
status = "incorrect" /* INCORRECT */;
|
|
4717
|
+
} else {
|
|
4718
|
+
status = "neutral" /* NEUTRAL */;
|
|
4676
4719
|
}
|
|
4677
4720
|
}
|
|
4678
4721
|
return {
|
|
@@ -4692,8 +4735,8 @@ var QuizAlternative = ({
|
|
|
4692
4735
|
name: `question-${currentQuestion?.id || "1"}`,
|
|
4693
4736
|
layout: "compact",
|
|
4694
4737
|
alternatives,
|
|
4695
|
-
value: currentAnswer?.optionId || "",
|
|
4696
|
-
selectedValue: currentAnswer?.optionId || "",
|
|
4738
|
+
value: variant === "result" ? currentQuestionResult?.optionId || "" : currentAnswer?.optionId || "",
|
|
4739
|
+
selectedValue: variant === "result" ? currentQuestionResult?.optionId || "" : currentAnswer?.optionId || "",
|
|
4697
4740
|
onValueChange: (value) => {
|
|
4698
4741
|
if (currentQuestion) {
|
|
4699
4742
|
selectAnswer(currentQuestion.id, value);
|
|
@@ -4704,13 +4747,19 @@ var QuizAlternative = ({
|
|
|
4704
4747
|
) }) })
|
|
4705
4748
|
] });
|
|
4706
4749
|
};
|
|
4707
|
-
var QuizMultipleChoice = ({
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4750
|
+
var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
4751
|
+
const {
|
|
4752
|
+
getCurrentQuestion,
|
|
4753
|
+
selectMultipleAnswer,
|
|
4754
|
+
getAllCurrentAnswer,
|
|
4755
|
+
getQuestionResultByQuestionId,
|
|
4756
|
+
variant
|
|
4757
|
+
} = useQuizStore();
|
|
4712
4758
|
const currentQuestion = getCurrentQuestion();
|
|
4713
4759
|
const allCurrentAnswers = getAllCurrentAnswer();
|
|
4760
|
+
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
4761
|
+
currentQuestion?.id || ""
|
|
4762
|
+
);
|
|
4714
4763
|
const prevSelectedValuesRef = useRef5([]);
|
|
4715
4764
|
const prevQuestionIdRef = useRef5("");
|
|
4716
4765
|
const allCurrentAnswerIds = useMemo(() => {
|
|
@@ -4732,8 +4781,16 @@ var QuizMultipleChoice = ({
|
|
|
4732
4781
|
prevSelectedValuesRef.current = selectedValues;
|
|
4733
4782
|
return selectedValues;
|
|
4734
4783
|
}
|
|
4784
|
+
if (variant == "result" && currentQuestionResult?.options.length && currentQuestionResult?.options.length > 0) {
|
|
4785
|
+
return currentQuestionResult?.options.map((op) => op.id) || [];
|
|
4786
|
+
}
|
|
4735
4787
|
return prevSelectedValuesRef.current;
|
|
4736
|
-
}, [
|
|
4788
|
+
}, [
|
|
4789
|
+
selectedValues,
|
|
4790
|
+
currentQuestion?.id,
|
|
4791
|
+
variant,
|
|
4792
|
+
currentQuestionResult?.optionId
|
|
4793
|
+
]);
|
|
4737
4794
|
const handleSelectedValues = useCallback(
|
|
4738
4795
|
(values) => {
|
|
4739
4796
|
if (currentQuestion) {
|
|
@@ -4749,11 +4806,18 @@ var QuizMultipleChoice = ({
|
|
|
4749
4806
|
const choices = currentQuestion?.options?.map((option) => {
|
|
4750
4807
|
let status = "neutral" /* NEUTRAL */;
|
|
4751
4808
|
if (variant === "result") {
|
|
4752
|
-
const
|
|
4753
|
-
|
|
4809
|
+
const isCorrectOption = currentQuestion.correctOptionIds?.includes(
|
|
4810
|
+
option.id
|
|
4811
|
+
);
|
|
4812
|
+
const isSelected = currentQuestionResult?.options.find(
|
|
4813
|
+
(op) => op.id === option.id
|
|
4814
|
+
);
|
|
4815
|
+
if (isCorrectOption) {
|
|
4754
4816
|
status = "correct" /* CORRECT */;
|
|
4755
|
-
} else if (
|
|
4817
|
+
} else if (isSelected && !isCorrectOption) {
|
|
4756
4818
|
status = "incorrect" /* INCORRECT */;
|
|
4819
|
+
} else {
|
|
4820
|
+
status = "neutral" /* NEUTRAL */;
|
|
4757
4821
|
}
|
|
4758
4822
|
}
|
|
4759
4823
|
return {
|
|
@@ -4779,12 +4843,18 @@ var QuizMultipleChoice = ({
|
|
|
4779
4843
|
) }) })
|
|
4780
4844
|
] });
|
|
4781
4845
|
};
|
|
4782
|
-
var QuizDissertative = ({
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4846
|
+
var QuizDissertative = ({ paddingBottom }) => {
|
|
4847
|
+
const {
|
|
4848
|
+
getCurrentQuestion,
|
|
4849
|
+
getCurrentAnswer,
|
|
4850
|
+
selectDissertativeAnswer,
|
|
4851
|
+
getQuestionResultByQuestionId,
|
|
4852
|
+
variant
|
|
4853
|
+
} = useQuizStore();
|
|
4787
4854
|
const currentQuestion = getCurrentQuestion();
|
|
4855
|
+
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
4856
|
+
currentQuestion?.id || ""
|
|
4857
|
+
);
|
|
4788
4858
|
const currentAnswer = getCurrentAnswer();
|
|
4789
4859
|
const textareaRef = useRef5(null);
|
|
4790
4860
|
const handleAnswerChange = (value) => {
|
|
@@ -4808,6 +4878,7 @@ var QuizDissertative = ({
|
|
|
4808
4878
|
if (!currentQuestion) {
|
|
4809
4879
|
return /* @__PURE__ */ jsx17("div", { className: "space-y-4", children: /* @__PURE__ */ jsx17("p", { className: "text-text-600 text-md", children: "Nenhuma quest\xE3o dispon\xEDvel" }) });
|
|
4810
4880
|
}
|
|
4881
|
+
const localAnswer = (variant == "result" ? currentQuestionResult?.answer : currentAnswer?.answer) || "";
|
|
4811
4882
|
return /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
4812
4883
|
/* @__PURE__ */ jsx17(QuizSubTitle, { subTitle: "Resposta" }),
|
|
4813
4884
|
/* @__PURE__ */ jsx17(QuizContainer, { className: cn(variant != "result" && paddingBottom), children: /* @__PURE__ */ jsx17("div", { className: "space-y-4 max-h-[600px] overflow-y-auto", children: variant === "default" ? /* @__PURE__ */ jsx17("div", { className: "space-y-4", children: /* @__PURE__ */ jsx17(
|
|
@@ -4815,22 +4886,20 @@ var QuizDissertative = ({
|
|
|
4815
4886
|
{
|
|
4816
4887
|
ref: textareaRef,
|
|
4817
4888
|
placeholder: "Escreva sua resposta",
|
|
4818
|
-
value:
|
|
4889
|
+
value: localAnswer,
|
|
4819
4890
|
onChange: (e) => handleAnswerChange(e.target.value),
|
|
4820
4891
|
rows: 4,
|
|
4821
4892
|
className: "min-h-[120px] max-h-[400px] resize-none overflow-y-auto"
|
|
4822
4893
|
}
|
|
4823
|
-
) }) : /* @__PURE__ */ jsx17("div", { className: "space-y-4", children: /* @__PURE__ */ jsx17("p", { className: "text-text-600 text-md whitespace-pre-wrap", children:
|
|
4824
|
-
variant === "result" &&
|
|
4894
|
+
) }) : /* @__PURE__ */ jsx17("div", { className: "space-y-4", children: /* @__PURE__ */ jsx17("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: localAnswer || "Nenhuma resposta fornecida" }) }) }) }),
|
|
4895
|
+
variant === "result" && currentQuestionResult?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ jsxs14(Fragment6, { children: [
|
|
4825
4896
|
/* @__PURE__ */ jsx17(QuizSubTitle, { subTitle: "Observa\xE7\xE3o do professor" }),
|
|
4826
4897
|
/* @__PURE__ */ jsx17(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx17("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Integer euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Nullam ac urna eu felis dapibus condimentum sit amet a augue. Sed non neque elit. Sed ut imperdiet nisi. Proin condimentum fermentum nunc. Etiam pharetra, erat sed fermentum feugiat, velit mauris egestas quam, ut aliquam massa nisl quis neque. Suspendisse in orci enim. Mauris euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Integer euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Nullam ac urna eu felis dapibus condimentum sit amet a augue. Sed non neque elit. Sed ut imperdiet nisi. Proin condimentum fermentum nunc. Etiam pharetra, erat sed fermentum feugiat, velit mauris egestas quam, ut aliquam massa nisl quis neque. Suspendisse in orci enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Integer euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Nullam ac urna eu felis dapibus condimentum sit amet a augue. Sed non neque elit. Sed ut imperdiet nisi. Proin condimentum fermentum nunc. Etiam pharetra, erat sed fermentum feugiat, velit mauris egestas quam, ut aliquam massa nisl quis neque. Suspendisse in orci enim." }) })
|
|
4827
4898
|
] })
|
|
4828
4899
|
] });
|
|
4829
4900
|
};
|
|
4830
|
-
var QuizTrueOrFalse = ({
|
|
4831
|
-
variant =
|
|
4832
|
-
paddingBottom
|
|
4833
|
-
}) => {
|
|
4901
|
+
var QuizTrueOrFalse = ({ paddingBottom }) => {
|
|
4902
|
+
const { variant } = useQuizStore();
|
|
4834
4903
|
const options = [
|
|
4835
4904
|
{
|
|
4836
4905
|
label: "25 metros",
|
|
@@ -4890,10 +4959,8 @@ var QuizTrueOrFalse = ({
|
|
|
4890
4959
|
}) }) })
|
|
4891
4960
|
] });
|
|
4892
4961
|
};
|
|
4893
|
-
var QuizConnectDots = ({
|
|
4894
|
-
variant =
|
|
4895
|
-
paddingBottom
|
|
4896
|
-
}) => {
|
|
4962
|
+
var QuizConnectDots = ({ paddingBottom }) => {
|
|
4963
|
+
const { variant } = useQuizStore();
|
|
4897
4964
|
const dotsOptions = [
|
|
4898
4965
|
{ label: "Ra\xE7\xE3o" },
|
|
4899
4966
|
{ label: "Rato" },
|
|
@@ -5019,10 +5086,8 @@ var QuizConnectDots = ({
|
|
|
5019
5086
|
}) }) })
|
|
5020
5087
|
] });
|
|
5021
5088
|
};
|
|
5022
|
-
var QuizFill = ({
|
|
5023
|
-
variant =
|
|
5024
|
-
paddingBottom = "pb-[80px]"
|
|
5025
|
-
}) => {
|
|
5089
|
+
var QuizFill = ({ paddingBottom = "pb-[80px]" }) => {
|
|
5090
|
+
const { variant } = useQuizStore();
|
|
5026
5091
|
const options = [
|
|
5027
5092
|
"ci\xEAncia",
|
|
5028
5093
|
"disciplina",
|
|
@@ -5191,10 +5256,8 @@ var QuizFill = ({
|
|
|
5191
5256
|
] })
|
|
5192
5257
|
] });
|
|
5193
5258
|
};
|
|
5194
|
-
var QuizImageQuestion = ({
|
|
5195
|
-
variant =
|
|
5196
|
-
paddingBottom
|
|
5197
|
-
}) => {
|
|
5259
|
+
var QuizImageQuestion = ({ paddingBottom }) => {
|
|
5260
|
+
const { variant } = useQuizStore();
|
|
5198
5261
|
const correctPositionRelative = { x: 0.48, y: 0.45 };
|
|
5199
5262
|
const calculateCorrectRadiusRelative = () => {
|
|
5200
5263
|
const circleWidthRelative = 0.15;
|
|
@@ -5412,7 +5475,6 @@ var QuizFooter = forwardRef10(
|
|
|
5412
5475
|
}, ref) => {
|
|
5413
5476
|
const {
|
|
5414
5477
|
currentQuestionIndex,
|
|
5415
|
-
getUserAnswers,
|
|
5416
5478
|
getTotalQuestions,
|
|
5417
5479
|
goToNextQuestion,
|
|
5418
5480
|
goToPreviousQuestion,
|
|
@@ -5422,7 +5484,7 @@ var QuizFooter = forwardRef10(
|
|
|
5422
5484
|
getCurrentQuestion,
|
|
5423
5485
|
getQuestionStatusFromUserAnswers,
|
|
5424
5486
|
variant,
|
|
5425
|
-
|
|
5487
|
+
getQuestionResultStatistics
|
|
5426
5488
|
} = useQuizStore();
|
|
5427
5489
|
const totalQuestions = getTotalQuestions();
|
|
5428
5490
|
const isFirstQuestion = currentQuestionIndex === 0;
|
|
@@ -5436,7 +5498,6 @@ var QuizFooter = forwardRef10(
|
|
|
5436
5498
|
const [modalResolutionOpen, setModalResolutionOpen] = useState7(false);
|
|
5437
5499
|
const [filterType, setFilterType] = useState7("all");
|
|
5438
5500
|
const unansweredQuestions = getUnansweredQuestionsFromUserAnswers();
|
|
5439
|
-
const userAnswers = getUserAnswers();
|
|
5440
5501
|
const allQuestions = getTotalQuestions();
|
|
5441
5502
|
const handleFinishQuiz = async () => {
|
|
5442
5503
|
if (unansweredQuestions.length > 0) {
|
|
@@ -5596,21 +5657,9 @@ var QuizFooter = forwardRef10(
|
|
|
5596
5657
|
/* @__PURE__ */ jsxs14("p", { className: "text-text-500 font-sm", children: [
|
|
5597
5658
|
"Voc\xEA acertou",
|
|
5598
5659
|
" ",
|
|
5599
|
-
(
|
|
5600
|
-
|
|
5601
|
-
if (!activeQuiz) return 0;
|
|
5602
|
-
return userAnswers.filter((answer) => {
|
|
5603
|
-
const question = activeQuiz.quiz.questions.find(
|
|
5604
|
-
(q) => q.id === answer.questionId
|
|
5605
|
-
);
|
|
5606
|
-
const isCorrectOption = question?.options.find(
|
|
5607
|
-
(op) => op.isCorrect
|
|
5608
|
-
);
|
|
5609
|
-
return question && answer.optionId === isCorrectOption?.id;
|
|
5610
|
-
}).length;
|
|
5611
|
-
})(),
|
|
5660
|
+
getQuestionResultStatistics()?.correctAnswers ?? "--",
|
|
5661
|
+
" de",
|
|
5612
5662
|
" ",
|
|
5613
|
-
"de ",
|
|
5614
5663
|
allQuestions,
|
|
5615
5664
|
" quest\xF5es."
|
|
5616
5665
|
] })
|
|
@@ -5667,7 +5716,7 @@ var QuizFooter = forwardRef10(
|
|
|
5667
5716
|
onClose: () => setModalResolutionOpen(false),
|
|
5668
5717
|
title: "Resolu\xE7\xE3o",
|
|
5669
5718
|
size: "lg",
|
|
5670
|
-
children: currentQuestion?.
|
|
5719
|
+
children: currentQuestion?.solutionExplanation
|
|
5671
5720
|
}
|
|
5672
5721
|
)
|
|
5673
5722
|
] });
|
|
@@ -5683,7 +5732,7 @@ var QuizResultHeaderTitle = forwardRef10(({ className, ...props }, ref) => {
|
|
|
5683
5732
|
...props,
|
|
5684
5733
|
children: [
|
|
5685
5734
|
/* @__PURE__ */ jsx17("p", { className: "text-text-950 font-bold text-2xl", children: "Resultado" }),
|
|
5686
|
-
bySimulated && /* @__PURE__ */ jsx17(Badge_default, { variant: "solid", action: "info", children: bySimulated.
|
|
5735
|
+
bySimulated && /* @__PURE__ */ jsx17(Badge_default, { variant: "solid", action: "info", children: bySimulated.type })
|
|
5687
5736
|
]
|
|
5688
5737
|
}
|
|
5689
5738
|
);
|
|
@@ -5707,13 +5756,11 @@ var QuizResultPerformance = forwardRef10(
|
|
|
5707
5756
|
getTotalQuestions,
|
|
5708
5757
|
timeElapsed,
|
|
5709
5758
|
formatTime,
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
byQuestionary,
|
|
5713
|
-
getUserAnswerByQuestionId
|
|
5759
|
+
getQuestionResultStatistics,
|
|
5760
|
+
getQuestionResult
|
|
5714
5761
|
} = useQuizStore();
|
|
5715
5762
|
const totalQuestions = getTotalQuestions();
|
|
5716
|
-
const
|
|
5763
|
+
const questionResult = getQuestionResult();
|
|
5717
5764
|
let correctAnswers = 0;
|
|
5718
5765
|
let correctEasyAnswers = 0;
|
|
5719
5766
|
let correctMediumAnswers = 0;
|
|
@@ -5721,24 +5768,23 @@ var QuizResultPerformance = forwardRef10(
|
|
|
5721
5768
|
let totalEasyQuestions = 0;
|
|
5722
5769
|
let totalMediumQuestions = 0;
|
|
5723
5770
|
let totalDifficultQuestions = 0;
|
|
5724
|
-
if (
|
|
5725
|
-
|
|
5726
|
-
const
|
|
5727
|
-
const isCorrect = userAnswerItem?.answerStatus == "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */;
|
|
5771
|
+
if (questionResult) {
|
|
5772
|
+
questionResult.answers.forEach((answer) => {
|
|
5773
|
+
const isCorrect = answer.answerStatus == "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */;
|
|
5728
5774
|
if (isCorrect) {
|
|
5729
5775
|
correctAnswers++;
|
|
5730
5776
|
}
|
|
5731
|
-
if (
|
|
5777
|
+
if (answer.difficultyLevel === "FACIL" /* FACIL */) {
|
|
5732
5778
|
totalEasyQuestions++;
|
|
5733
5779
|
if (isCorrect) {
|
|
5734
5780
|
correctEasyAnswers++;
|
|
5735
5781
|
}
|
|
5736
|
-
} else if (
|
|
5782
|
+
} else if (answer.difficultyLevel === "MEDIO" /* MEDIO */) {
|
|
5737
5783
|
totalMediumQuestions++;
|
|
5738
5784
|
if (isCorrect) {
|
|
5739
5785
|
correctMediumAnswers++;
|
|
5740
5786
|
}
|
|
5741
|
-
} else if (
|
|
5787
|
+
} else if (answer.difficultyLevel === "DIFICIL" /* DIFICIL */) {
|
|
5742
5788
|
totalDifficultQuestions++;
|
|
5743
5789
|
if (isCorrect) {
|
|
5744
5790
|
correctDifficultAnswers++;
|
|
@@ -5771,8 +5817,9 @@ var QuizResultPerformance = forwardRef10(
|
|
|
5771
5817
|
/* @__PURE__ */ jsx17("span", { className: "text-2xs font-medium text-text-800", children: formatTime(timeElapsed) })
|
|
5772
5818
|
] }),
|
|
5773
5819
|
/* @__PURE__ */ jsxs14("div", { className: "text-2xl font-medium text-text-800 leading-7", children: [
|
|
5774
|
-
correctAnswers,
|
|
5775
|
-
" de
|
|
5820
|
+
getQuestionResultStatistics()?.correctAnswers ?? "--",
|
|
5821
|
+
" de",
|
|
5822
|
+
" ",
|
|
5776
5823
|
totalQuestions
|
|
5777
5824
|
] }),
|
|
5778
5825
|
/* @__PURE__ */ jsx17("div", { className: "text-2xs font-medium text-text-600 mt-1", children: "Corretas" })
|