analytica-frontend-lib 1.1.9 → 1.1.11
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 +358 -189
- package/dist/VideoPlayer/index.js.map +1 -1
- package/dist/VideoPlayer/index.mjs +364 -190
- package/dist/VideoPlayer/index.mjs.map +1 -1
- package/dist/index.css +3 -3
- package/dist/index.css.map +1 -1
- package/dist/index.js +504 -288
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +510 -289
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +3 -3
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/dist/Quiz/index.d.mts
CHANGED
|
@@ -21,16 +21,15 @@ declare const QuizContent: react.ForwardRefExoticComponent<{
|
|
|
21
21
|
paddingBottom?: string;
|
|
22
22
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
23
23
|
interface QuizVariantInterface {
|
|
24
|
-
variant?: 'result' | 'default';
|
|
25
24
|
paddingBottom?: string;
|
|
26
25
|
}
|
|
27
|
-
declare const QuizAlternative: ({
|
|
28
|
-
declare const QuizMultipleChoice: ({
|
|
29
|
-
declare const QuizDissertative: ({
|
|
30
|
-
declare const QuizTrueOrFalse: ({
|
|
31
|
-
declare const QuizConnectDots: ({
|
|
32
|
-
declare const QuizFill: ({
|
|
33
|
-
declare const QuizImageQuestion: ({
|
|
26
|
+
declare const QuizAlternative: ({ paddingBottom }: QuizVariantInterface) => react_jsx_runtime.JSX.Element;
|
|
27
|
+
declare const QuizMultipleChoice: ({ paddingBottom }: QuizVariantInterface) => react_jsx_runtime.JSX.Element;
|
|
28
|
+
declare const QuizDissertative: ({ paddingBottom }: QuizVariantInterface) => react_jsx_runtime.JSX.Element;
|
|
29
|
+
declare const QuizTrueOrFalse: ({ paddingBottom }: QuizVariantInterface) => react_jsx_runtime.JSX.Element;
|
|
30
|
+
declare const QuizConnectDots: ({ paddingBottom }: QuizVariantInterface) => react_jsx_runtime.JSX.Element;
|
|
31
|
+
declare const QuizFill: ({ paddingBottom }: QuizVariantInterface) => react_jsx_runtime.JSX.Element;
|
|
32
|
+
declare const QuizImageQuestion: ({ paddingBottom }: QuizVariantInterface) => react_jsx_runtime.JSX.Element;
|
|
34
33
|
declare const QuizQuestionList: ({ filterType, onQuestionClick, }?: {
|
|
35
34
|
filterType?: string;
|
|
36
35
|
onQuestionClick?: () => void;
|
package/dist/Quiz/index.d.ts
CHANGED
|
@@ -21,16 +21,15 @@ declare const QuizContent: react.ForwardRefExoticComponent<{
|
|
|
21
21
|
paddingBottom?: string;
|
|
22
22
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
23
23
|
interface QuizVariantInterface {
|
|
24
|
-
variant?: 'result' | 'default';
|
|
25
24
|
paddingBottom?: string;
|
|
26
25
|
}
|
|
27
|
-
declare const QuizAlternative: ({
|
|
28
|
-
declare const QuizMultipleChoice: ({
|
|
29
|
-
declare const QuizDissertative: ({
|
|
30
|
-
declare const QuizTrueOrFalse: ({
|
|
31
|
-
declare const QuizConnectDots: ({
|
|
32
|
-
declare const QuizFill: ({
|
|
33
|
-
declare const QuizImageQuestion: ({
|
|
26
|
+
declare const QuizAlternative: ({ paddingBottom }: QuizVariantInterface) => react_jsx_runtime.JSX.Element;
|
|
27
|
+
declare const QuizMultipleChoice: ({ paddingBottom }: QuizVariantInterface) => react_jsx_runtime.JSX.Element;
|
|
28
|
+
declare const QuizDissertative: ({ paddingBottom }: QuizVariantInterface) => react_jsx_runtime.JSX.Element;
|
|
29
|
+
declare const QuizTrueOrFalse: ({ paddingBottom }: QuizVariantInterface) => react_jsx_runtime.JSX.Element;
|
|
30
|
+
declare const QuizConnectDots: ({ paddingBottom }: QuizVariantInterface) => react_jsx_runtime.JSX.Element;
|
|
31
|
+
declare const QuizFill: ({ paddingBottom }: QuizVariantInterface) => react_jsx_runtime.JSX.Element;
|
|
32
|
+
declare const QuizImageQuestion: ({ paddingBottom }: QuizVariantInterface) => react_jsx_runtime.JSX.Element;
|
|
34
33
|
declare const QuizQuestionList: ({ filterType, onQuestionClick, }?: {
|
|
35
34
|
filterType?: string;
|
|
36
35
|
onQuestionClick?: () => void;
|
package/dist/Quiz/index.js
CHANGED
|
@@ -995,6 +995,8 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
995
995
|
isFinished: false,
|
|
996
996
|
userId: "",
|
|
997
997
|
variant: "default",
|
|
998
|
+
questionsResult: null,
|
|
999
|
+
currentQuestionResult: null,
|
|
998
1000
|
// Setters
|
|
999
1001
|
setBySimulated: (simulado) => set({ bySimulated: simulado }),
|
|
1000
1002
|
setByActivity: (atividade) => set({ byActivity: atividade }),
|
|
@@ -1003,6 +1005,7 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
1003
1005
|
setUserAnswers: (userAnswers) => set({ userAnswers }),
|
|
1004
1006
|
getUserId: () => get().userId,
|
|
1005
1007
|
setVariant: (variant) => set({ variant }),
|
|
1008
|
+
setQuestionResult: (questionsResult) => set({ questionsResult }),
|
|
1006
1009
|
// Navigation
|
|
1007
1010
|
goToNextQuestion: () => {
|
|
1008
1011
|
const { currentQuestionIndex, getTotalQuestions } = get();
|
|
@@ -1055,9 +1058,9 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
1055
1058
|
questionId,
|
|
1056
1059
|
activityId,
|
|
1057
1060
|
userId,
|
|
1058
|
-
answer: question.
|
|
1059
|
-
optionId: question.
|
|
1060
|
-
questionType: question.
|
|
1061
|
+
answer: question.questionType === "DISSERTATIVA" /* DISSERTATIVA */ ? answerId : null,
|
|
1062
|
+
optionId: question.questionType === "DISSERTATIVA" /* DISSERTATIVA */ ? null : answerId,
|
|
1063
|
+
questionType: question.questionType,
|
|
1061
1064
|
answerStatus: "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */
|
|
1062
1065
|
};
|
|
1063
1066
|
let updatedUserAnswers;
|
|
@@ -1097,7 +1100,7 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
1097
1100
|
// selectMultipleAnswer is for non-dissertative questions
|
|
1098
1101
|
optionId: answerId,
|
|
1099
1102
|
// selectMultipleAnswer should only set optionId
|
|
1100
|
-
questionType: question.
|
|
1103
|
+
questionType: question.questionType,
|
|
1101
1104
|
answerStatus: "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */
|
|
1102
1105
|
})
|
|
1103
1106
|
);
|
|
@@ -1124,7 +1127,7 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
1124
1127
|
const question = activeQuiz.quiz.questions.find(
|
|
1125
1128
|
(q) => q.id === questionId
|
|
1126
1129
|
);
|
|
1127
|
-
if (!question || question.
|
|
1130
|
+
if (!question || question.questionType !== "DISSERTATIVA" /* DISSERTATIVA */) {
|
|
1128
1131
|
console.warn(
|
|
1129
1132
|
"selectDissertativeAnswer called for non-dissertative question"
|
|
1130
1133
|
);
|
|
@@ -1174,7 +1177,7 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
1174
1177
|
userId,
|
|
1175
1178
|
answer: null,
|
|
1176
1179
|
optionId: null,
|
|
1177
|
-
questionType: currentQuestion.
|
|
1180
|
+
questionType: currentQuestion.questionType,
|
|
1178
1181
|
answerStatus: "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */
|
|
1179
1182
|
};
|
|
1180
1183
|
let updatedUserAnswers;
|
|
@@ -1210,9 +1213,9 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
1210
1213
|
questionId,
|
|
1211
1214
|
activityId,
|
|
1212
1215
|
userId,
|
|
1213
|
-
answer: question.
|
|
1214
|
-
optionId: question.
|
|
1215
|
-
questionType: question.
|
|
1216
|
+
answer: question.questionType === "DISSERTATIVA" /* DISSERTATIVA */ ? answerId || null : null,
|
|
1217
|
+
optionId: question.questionType !== "DISSERTATIVA" /* DISSERTATIVA */ ? answerId || null : null,
|
|
1218
|
+
questionType: question.questionType,
|
|
1216
1219
|
answerStatus: "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */
|
|
1217
1220
|
};
|
|
1218
1221
|
if (existingAnswerIndex !== -1) {
|
|
@@ -1240,7 +1243,10 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
1240
1243
|
timeElapsed: 0,
|
|
1241
1244
|
isStarted: false,
|
|
1242
1245
|
isFinished: false,
|
|
1243
|
-
userId: ""
|
|
1246
|
+
userId: "",
|
|
1247
|
+
variant: "default",
|
|
1248
|
+
questionsResult: null,
|
|
1249
|
+
currentQuestionResult: null
|
|
1244
1250
|
});
|
|
1245
1251
|
},
|
|
1246
1252
|
// Timer
|
|
@@ -1442,6 +1448,31 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
1442
1448
|
(q) => q.id === questionId
|
|
1443
1449
|
);
|
|
1444
1450
|
return questionIndex + 1;
|
|
1451
|
+
},
|
|
1452
|
+
// Question Result
|
|
1453
|
+
getQuestionResultByQuestionId: (questionId) => {
|
|
1454
|
+
const { questionsResult } = get();
|
|
1455
|
+
return questionsResult?.answers.find(
|
|
1456
|
+
(answer) => answer.questionId === questionId
|
|
1457
|
+
) || null;
|
|
1458
|
+
},
|
|
1459
|
+
getQuestionResultStatistics: () => {
|
|
1460
|
+
const { questionsResult } = get();
|
|
1461
|
+
return questionsResult?.statistics || null;
|
|
1462
|
+
},
|
|
1463
|
+
getQuestionResult: () => {
|
|
1464
|
+
const { questionsResult } = get();
|
|
1465
|
+
return questionsResult;
|
|
1466
|
+
},
|
|
1467
|
+
setQuestionsResult: (questionsResult) => {
|
|
1468
|
+
set({ questionsResult });
|
|
1469
|
+
},
|
|
1470
|
+
setCurrentQuestionResult: (currentQuestionResult) => {
|
|
1471
|
+
set({ currentQuestionResult });
|
|
1472
|
+
},
|
|
1473
|
+
getCurrentQuestionResult: () => {
|
|
1474
|
+
const { currentQuestionResult } = get();
|
|
1475
|
+
return currentQuestionResult;
|
|
1445
1476
|
}
|
|
1446
1477
|
};
|
|
1447
1478
|
},
|
|
@@ -4522,18 +4553,21 @@ var Quiz = (0, import_react12.forwardRef)(({ children, className, variant = "def
|
|
|
4522
4553
|
});
|
|
4523
4554
|
var QuizHeaderResult = (0, import_react12.forwardRef)(
|
|
4524
4555
|
({ className, ...props }, ref) => {
|
|
4525
|
-
const {
|
|
4526
|
-
const usersAnswer = getAllCurrentAnswer();
|
|
4556
|
+
const { getQuestionResultByQuestionId, getCurrentQuestion } = useQuizStore();
|
|
4527
4557
|
const [isCorrect, setIsCorrect] = (0, import_react12.useState)(false);
|
|
4528
4558
|
(0, import_react12.useEffect)(() => {
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
).every(Boolean) : false
|
|
4534
|
-
);
|
|
4559
|
+
const cq = getCurrentQuestion();
|
|
4560
|
+
if (!cq) {
|
|
4561
|
+
setIsCorrect(false);
|
|
4562
|
+
return;
|
|
4535
4563
|
}
|
|
4536
|
-
|
|
4564
|
+
const qr = getQuestionResultByQuestionId(cq.id);
|
|
4565
|
+
setIsCorrect(qr?.answerStatus === "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */);
|
|
4566
|
+
}, [
|
|
4567
|
+
getCurrentQuestion,
|
|
4568
|
+
getQuestionResultByQuestionId,
|
|
4569
|
+
getCurrentQuestion()?.id
|
|
4570
|
+
]);
|
|
4537
4571
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
4538
4572
|
"div",
|
|
4539
4573
|
{
|
|
@@ -4616,7 +4650,7 @@ var QuizContainer = (0, import_react12.forwardRef)(({ children, className, ...pr
|
|
|
4616
4650
|
);
|
|
4617
4651
|
});
|
|
4618
4652
|
var QuizContent = (0, import_react12.forwardRef)(({ paddingBottom }) => {
|
|
4619
|
-
const { getCurrentQuestion
|
|
4653
|
+
const { getCurrentQuestion } = useQuizStore();
|
|
4620
4654
|
const currentQuestion = getCurrentQuestion();
|
|
4621
4655
|
const questionComponents = {
|
|
4622
4656
|
["ALTERNATIVA" /* ALTERNATIVA */]: QuizAlternative,
|
|
@@ -4627,26 +4661,35 @@ var QuizContent = (0, import_react12.forwardRef)(({ paddingBottom }) => {
|
|
|
4627
4661
|
["PREENCHER" /* PREENCHER */]: QuizFill,
|
|
4628
4662
|
["IMAGEM" /* IMAGEM */]: QuizImageQuestion
|
|
4629
4663
|
};
|
|
4630
|
-
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.
|
|
4631
|
-
return QuestionComponent ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(QuestionComponent, {
|
|
4664
|
+
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.questionType] : null;
|
|
4665
|
+
return QuestionComponent ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(QuestionComponent, { paddingBottom }) : null;
|
|
4632
4666
|
});
|
|
4633
|
-
var QuizAlternative = ({
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4667
|
+
var QuizAlternative = ({ paddingBottom }) => {
|
|
4668
|
+
const {
|
|
4669
|
+
getCurrentQuestion,
|
|
4670
|
+
selectAnswer,
|
|
4671
|
+
getQuestionResultByQuestionId,
|
|
4672
|
+
getCurrentAnswer,
|
|
4673
|
+
variant
|
|
4674
|
+
} = useQuizStore();
|
|
4638
4675
|
const currentQuestion = getCurrentQuestion();
|
|
4676
|
+
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
4677
|
+
currentQuestion?.id || ""
|
|
4678
|
+
);
|
|
4639
4679
|
const currentAnswer = getCurrentAnswer();
|
|
4640
4680
|
const alternatives = currentQuestion?.options?.map((option) => {
|
|
4641
4681
|
let status = "neutral" /* NEUTRAL */;
|
|
4642
4682
|
if (variant === "result") {
|
|
4643
|
-
const isCorrectOption = currentQuestion.
|
|
4644
|
-
|
|
4683
|
+
const isCorrectOption = currentQuestion.correctOptionIds?.includes(
|
|
4684
|
+
option.id
|
|
4645
4685
|
);
|
|
4646
|
-
|
|
4686
|
+
const isSelected = currentQuestionResult?.optionId === option.id;
|
|
4687
|
+
if (isCorrectOption) {
|
|
4647
4688
|
status = "correct" /* CORRECT */;
|
|
4648
|
-
} else if (
|
|
4689
|
+
} else if (isSelected && !isCorrectOption) {
|
|
4649
4690
|
status = "incorrect" /* INCORRECT */;
|
|
4691
|
+
} else {
|
|
4692
|
+
status = "neutral" /* NEUTRAL */;
|
|
4650
4693
|
}
|
|
4651
4694
|
}
|
|
4652
4695
|
return {
|
|
@@ -4666,8 +4709,8 @@ var QuizAlternative = ({
|
|
|
4666
4709
|
name: `question-${currentQuestion?.id || "1"}`,
|
|
4667
4710
|
layout: "compact",
|
|
4668
4711
|
alternatives,
|
|
4669
|
-
value: currentAnswer?.optionId || "",
|
|
4670
|
-
selectedValue: currentAnswer?.optionId || "",
|
|
4712
|
+
value: variant === "result" ? currentQuestionResult?.optionId || "" : currentAnswer?.optionId || "",
|
|
4713
|
+
selectedValue: variant === "result" ? currentQuestionResult?.optionId || "" : currentAnswer?.optionId || "",
|
|
4671
4714
|
onValueChange: (value) => {
|
|
4672
4715
|
if (currentQuestion) {
|
|
4673
4716
|
selectAnswer(currentQuestion.id, value);
|
|
@@ -4678,13 +4721,19 @@ var QuizAlternative = ({
|
|
|
4678
4721
|
) }) })
|
|
4679
4722
|
] });
|
|
4680
4723
|
};
|
|
4681
|
-
var QuizMultipleChoice = ({
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4724
|
+
var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
4725
|
+
const {
|
|
4726
|
+
getCurrentQuestion,
|
|
4727
|
+
selectMultipleAnswer,
|
|
4728
|
+
getAllCurrentAnswer,
|
|
4729
|
+
getQuestionResultByQuestionId,
|
|
4730
|
+
variant
|
|
4731
|
+
} = useQuizStore();
|
|
4686
4732
|
const currentQuestion = getCurrentQuestion();
|
|
4687
4733
|
const allCurrentAnswers = getAllCurrentAnswer();
|
|
4734
|
+
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
4735
|
+
currentQuestion?.id || ""
|
|
4736
|
+
);
|
|
4688
4737
|
const prevSelectedValuesRef = (0, import_react12.useRef)([]);
|
|
4689
4738
|
const prevQuestionIdRef = (0, import_react12.useRef)("");
|
|
4690
4739
|
const allCurrentAnswerIds = (0, import_react12.useMemo)(() => {
|
|
@@ -4706,8 +4755,16 @@ var QuizMultipleChoice = ({
|
|
|
4706
4755
|
prevSelectedValuesRef.current = selectedValues;
|
|
4707
4756
|
return selectedValues;
|
|
4708
4757
|
}
|
|
4758
|
+
if (variant == "result" && currentQuestionResult?.options.length && currentQuestionResult?.options.length > 0) {
|
|
4759
|
+
return currentQuestionResult?.options.map((op) => op.id) || [];
|
|
4760
|
+
}
|
|
4709
4761
|
return prevSelectedValuesRef.current;
|
|
4710
|
-
}, [
|
|
4762
|
+
}, [
|
|
4763
|
+
selectedValues,
|
|
4764
|
+
currentQuestion?.id,
|
|
4765
|
+
variant,
|
|
4766
|
+
currentQuestionResult?.optionId
|
|
4767
|
+
]);
|
|
4711
4768
|
const handleSelectedValues = (0, import_react12.useCallback)(
|
|
4712
4769
|
(values) => {
|
|
4713
4770
|
if (currentQuestion) {
|
|
@@ -4723,11 +4780,18 @@ var QuizMultipleChoice = ({
|
|
|
4723
4780
|
const choices = currentQuestion?.options?.map((option) => {
|
|
4724
4781
|
let status = "neutral" /* NEUTRAL */;
|
|
4725
4782
|
if (variant === "result") {
|
|
4726
|
-
const
|
|
4727
|
-
|
|
4783
|
+
const isCorrectOption = currentQuestion.correctOptionIds?.includes(
|
|
4784
|
+
option.id
|
|
4785
|
+
);
|
|
4786
|
+
const isSelected = currentQuestionResult?.options.find(
|
|
4787
|
+
(op) => op.id === option.id
|
|
4788
|
+
);
|
|
4789
|
+
if (isCorrectOption) {
|
|
4728
4790
|
status = "correct" /* CORRECT */;
|
|
4729
|
-
} else if (
|
|
4791
|
+
} else if (isSelected && !isCorrectOption) {
|
|
4730
4792
|
status = "incorrect" /* INCORRECT */;
|
|
4793
|
+
} else {
|
|
4794
|
+
status = "neutral" /* NEUTRAL */;
|
|
4731
4795
|
}
|
|
4732
4796
|
}
|
|
4733
4797
|
return {
|
|
@@ -4753,12 +4817,18 @@ var QuizMultipleChoice = ({
|
|
|
4753
4817
|
) }) })
|
|
4754
4818
|
] });
|
|
4755
4819
|
};
|
|
4756
|
-
var QuizDissertative = ({
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4820
|
+
var QuizDissertative = ({ paddingBottom }) => {
|
|
4821
|
+
const {
|
|
4822
|
+
getCurrentQuestion,
|
|
4823
|
+
getCurrentAnswer,
|
|
4824
|
+
selectDissertativeAnswer,
|
|
4825
|
+
getQuestionResultByQuestionId,
|
|
4826
|
+
variant
|
|
4827
|
+
} = useQuizStore();
|
|
4761
4828
|
const currentQuestion = getCurrentQuestion();
|
|
4829
|
+
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
4830
|
+
currentQuestion?.id || ""
|
|
4831
|
+
);
|
|
4762
4832
|
const currentAnswer = getCurrentAnswer();
|
|
4763
4833
|
const textareaRef = (0, import_react12.useRef)(null);
|
|
4764
4834
|
const handleAnswerChange = (value) => {
|
|
@@ -4782,6 +4852,7 @@ var QuizDissertative = ({
|
|
|
4782
4852
|
if (!currentQuestion) {
|
|
4783
4853
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-text-600 text-md", children: "Nenhuma quest\xE3o dispon\xEDvel" }) });
|
|
4784
4854
|
}
|
|
4855
|
+
const localAnswer = (variant == "result" ? currentQuestionResult?.answer : currentAnswer?.answer) || "";
|
|
4785
4856
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
4786
4857
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(QuizSubTitle, { subTitle: "Resposta" }),
|
|
4787
4858
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(QuizContainer, { className: cn(variant != "result" && paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "space-y-4 max-h-[600px] overflow-y-auto", children: variant === "default" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
@@ -4789,22 +4860,20 @@ var QuizDissertative = ({
|
|
|
4789
4860
|
{
|
|
4790
4861
|
ref: textareaRef,
|
|
4791
4862
|
placeholder: "Escreva sua resposta",
|
|
4792
|
-
value:
|
|
4863
|
+
value: localAnswer,
|
|
4793
4864
|
onChange: (e) => handleAnswerChange(e.target.value),
|
|
4794
4865
|
rows: 4,
|
|
4795
4866
|
className: "min-h-[120px] max-h-[400px] resize-none overflow-y-auto"
|
|
4796
4867
|
}
|
|
4797
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-text-600 text-md whitespace-pre-wrap", children:
|
|
4798
|
-
variant === "result" &&
|
|
4868
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: localAnswer || "Nenhuma resposta fornecida" }) }) }) }),
|
|
4869
|
+
variant === "result" && currentQuestionResult?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
4799
4870
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(QuizSubTitle, { subTitle: "Observa\xE7\xE3o do professor" }),
|
|
4800
4871
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("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." }) })
|
|
4801
4872
|
] })
|
|
4802
4873
|
] });
|
|
4803
4874
|
};
|
|
4804
|
-
var QuizTrueOrFalse = ({
|
|
4805
|
-
variant =
|
|
4806
|
-
paddingBottom
|
|
4807
|
-
}) => {
|
|
4875
|
+
var QuizTrueOrFalse = ({ paddingBottom }) => {
|
|
4876
|
+
const { variant } = useQuizStore();
|
|
4808
4877
|
const options = [
|
|
4809
4878
|
{
|
|
4810
4879
|
label: "25 metros",
|
|
@@ -4864,10 +4933,8 @@ var QuizTrueOrFalse = ({
|
|
|
4864
4933
|
}) }) })
|
|
4865
4934
|
] });
|
|
4866
4935
|
};
|
|
4867
|
-
var QuizConnectDots = ({
|
|
4868
|
-
variant =
|
|
4869
|
-
paddingBottom
|
|
4870
|
-
}) => {
|
|
4936
|
+
var QuizConnectDots = ({ paddingBottom }) => {
|
|
4937
|
+
const { variant } = useQuizStore();
|
|
4871
4938
|
const dotsOptions = [
|
|
4872
4939
|
{ label: "Ra\xE7\xE3o" },
|
|
4873
4940
|
{ label: "Rato" },
|
|
@@ -4993,10 +5060,8 @@ var QuizConnectDots = ({
|
|
|
4993
5060
|
}) }) })
|
|
4994
5061
|
] });
|
|
4995
5062
|
};
|
|
4996
|
-
var QuizFill = ({
|
|
4997
|
-
variant =
|
|
4998
|
-
paddingBottom = "pb-[80px]"
|
|
4999
|
-
}) => {
|
|
5063
|
+
var QuizFill = ({ paddingBottom = "pb-[80px]" }) => {
|
|
5064
|
+
const { variant } = useQuizStore();
|
|
5000
5065
|
const options = [
|
|
5001
5066
|
"ci\xEAncia",
|
|
5002
5067
|
"disciplina",
|
|
@@ -5165,10 +5230,8 @@ var QuizFill = ({
|
|
|
5165
5230
|
] })
|
|
5166
5231
|
] });
|
|
5167
5232
|
};
|
|
5168
|
-
var QuizImageQuestion = ({
|
|
5169
|
-
variant =
|
|
5170
|
-
paddingBottom
|
|
5171
|
-
}) => {
|
|
5233
|
+
var QuizImageQuestion = ({ paddingBottom }) => {
|
|
5234
|
+
const { variant } = useQuizStore();
|
|
5172
5235
|
const correctPositionRelative = { x: 0.48, y: 0.45 };
|
|
5173
5236
|
const calculateCorrectRadiusRelative = () => {
|
|
5174
5237
|
const circleWidthRelative = 0.15;
|
|
@@ -5386,7 +5449,6 @@ var QuizFooter = (0, import_react12.forwardRef)(
|
|
|
5386
5449
|
}, ref) => {
|
|
5387
5450
|
const {
|
|
5388
5451
|
currentQuestionIndex,
|
|
5389
|
-
getUserAnswers,
|
|
5390
5452
|
getTotalQuestions,
|
|
5391
5453
|
goToNextQuestion,
|
|
5392
5454
|
goToPreviousQuestion,
|
|
@@ -5396,7 +5458,7 @@ var QuizFooter = (0, import_react12.forwardRef)(
|
|
|
5396
5458
|
getCurrentQuestion,
|
|
5397
5459
|
getQuestionStatusFromUserAnswers,
|
|
5398
5460
|
variant,
|
|
5399
|
-
|
|
5461
|
+
getQuestionResultStatistics
|
|
5400
5462
|
} = useQuizStore();
|
|
5401
5463
|
const totalQuestions = getTotalQuestions();
|
|
5402
5464
|
const isFirstQuestion = currentQuestionIndex === 0;
|
|
@@ -5410,7 +5472,6 @@ var QuizFooter = (0, import_react12.forwardRef)(
|
|
|
5410
5472
|
const [modalResolutionOpen, setModalResolutionOpen] = (0, import_react12.useState)(false);
|
|
5411
5473
|
const [filterType, setFilterType] = (0, import_react12.useState)("all");
|
|
5412
5474
|
const unansweredQuestions = getUnansweredQuestionsFromUserAnswers();
|
|
5413
|
-
const userAnswers = getUserAnswers();
|
|
5414
5475
|
const allQuestions = getTotalQuestions();
|
|
5415
5476
|
const handleFinishQuiz = async () => {
|
|
5416
5477
|
if (unansweredQuestions.length > 0) {
|
|
@@ -5570,21 +5631,9 @@ var QuizFooter = (0, import_react12.forwardRef)(
|
|
|
5570
5631
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { className: "text-text-500 font-sm", children: [
|
|
5571
5632
|
"Voc\xEA acertou",
|
|
5572
5633
|
" ",
|
|
5573
|
-
(
|
|
5574
|
-
|
|
5575
|
-
if (!activeQuiz) return 0;
|
|
5576
|
-
return userAnswers.filter((answer) => {
|
|
5577
|
-
const question = activeQuiz.quiz.questions.find(
|
|
5578
|
-
(q) => q.id === answer.questionId
|
|
5579
|
-
);
|
|
5580
|
-
const isCorrectOption = question?.options.find(
|
|
5581
|
-
(op) => op.isCorrect
|
|
5582
|
-
);
|
|
5583
|
-
return question && answer.optionId === isCorrectOption?.id;
|
|
5584
|
-
}).length;
|
|
5585
|
-
})(),
|
|
5634
|
+
getQuestionResultStatistics()?.correctAnswers ?? "--",
|
|
5635
|
+
" de",
|
|
5586
5636
|
" ",
|
|
5587
|
-
"de ",
|
|
5588
5637
|
allQuestions,
|
|
5589
5638
|
" quest\xF5es."
|
|
5590
5639
|
] })
|
|
@@ -5641,7 +5690,7 @@ var QuizFooter = (0, import_react12.forwardRef)(
|
|
|
5641
5690
|
onClose: () => setModalResolutionOpen(false),
|
|
5642
5691
|
title: "Resolu\xE7\xE3o",
|
|
5643
5692
|
size: "lg",
|
|
5644
|
-
children: currentQuestion?.
|
|
5693
|
+
children: currentQuestion?.solutionExplanation
|
|
5645
5694
|
}
|
|
5646
5695
|
)
|
|
5647
5696
|
] });
|
|
@@ -5657,7 +5706,7 @@ var QuizResultHeaderTitle = (0, import_react12.forwardRef)(({ className, ...prop
|
|
|
5657
5706
|
...props,
|
|
5658
5707
|
children: [
|
|
5659
5708
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: "Resultado" }),
|
|
5660
|
-
bySimulated && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Badge_default, { variant: "solid", action: "info", children: bySimulated.
|
|
5709
|
+
bySimulated && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Badge_default, { variant: "solid", action: "info", children: bySimulated.type })
|
|
5661
5710
|
]
|
|
5662
5711
|
}
|
|
5663
5712
|
);
|
|
@@ -5681,13 +5730,11 @@ var QuizResultPerformance = (0, import_react12.forwardRef)(
|
|
|
5681
5730
|
getTotalQuestions,
|
|
5682
5731
|
timeElapsed,
|
|
5683
5732
|
formatTime,
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
byQuestionary,
|
|
5687
|
-
getUserAnswerByQuestionId
|
|
5733
|
+
getQuestionResultStatistics,
|
|
5734
|
+
getQuestionResult
|
|
5688
5735
|
} = useQuizStore();
|
|
5689
5736
|
const totalQuestions = getTotalQuestions();
|
|
5690
|
-
const
|
|
5737
|
+
const questionResult = getQuestionResult();
|
|
5691
5738
|
let correctAnswers = 0;
|
|
5692
5739
|
let correctEasyAnswers = 0;
|
|
5693
5740
|
let correctMediumAnswers = 0;
|
|
@@ -5695,24 +5742,23 @@ var QuizResultPerformance = (0, import_react12.forwardRef)(
|
|
|
5695
5742
|
let totalEasyQuestions = 0;
|
|
5696
5743
|
let totalMediumQuestions = 0;
|
|
5697
5744
|
let totalDifficultQuestions = 0;
|
|
5698
|
-
if (
|
|
5699
|
-
|
|
5700
|
-
const
|
|
5701
|
-
const isCorrect = userAnswerItem?.answerStatus == "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */;
|
|
5745
|
+
if (questionResult) {
|
|
5746
|
+
questionResult.answers.forEach((answer) => {
|
|
5747
|
+
const isCorrect = answer.answerStatus == "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */;
|
|
5702
5748
|
if (isCorrect) {
|
|
5703
5749
|
correctAnswers++;
|
|
5704
5750
|
}
|
|
5705
|
-
if (
|
|
5751
|
+
if (answer.difficultyLevel === "FACIL" /* FACIL */) {
|
|
5706
5752
|
totalEasyQuestions++;
|
|
5707
5753
|
if (isCorrect) {
|
|
5708
5754
|
correctEasyAnswers++;
|
|
5709
5755
|
}
|
|
5710
|
-
} else if (
|
|
5756
|
+
} else if (answer.difficultyLevel === "MEDIO" /* MEDIO */) {
|
|
5711
5757
|
totalMediumQuestions++;
|
|
5712
5758
|
if (isCorrect) {
|
|
5713
5759
|
correctMediumAnswers++;
|
|
5714
5760
|
}
|
|
5715
|
-
} else if (
|
|
5761
|
+
} else if (answer.difficultyLevel === "DIFICIL" /* DIFICIL */) {
|
|
5716
5762
|
totalDifficultQuestions++;
|
|
5717
5763
|
if (isCorrect) {
|
|
5718
5764
|
correctDifficultAnswers++;
|
|
@@ -5745,8 +5791,9 @@ var QuizResultPerformance = (0, import_react12.forwardRef)(
|
|
|
5745
5791
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-2xs font-medium text-text-800", children: formatTime(timeElapsed) })
|
|
5746
5792
|
] }),
|
|
5747
5793
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "text-2xl font-medium text-text-800 leading-7", children: [
|
|
5748
|
-
correctAnswers,
|
|
5749
|
-
" de
|
|
5794
|
+
getQuestionResultStatistics()?.correctAnswers ?? "--",
|
|
5795
|
+
" de",
|
|
5796
|
+
" ",
|
|
5750
5797
|
totalQuestions
|
|
5751
5798
|
] }),
|
|
5752
5799
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "text-2xs font-medium text-text-600 mt-1", children: "Corretas" })
|