analytica-frontend-lib 1.1.9 → 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.js +157 -105
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +157 -105
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6915,11 +6915,11 @@ var VideoPlayer = ({
|
|
|
6915
6915
|
setShowSpeedMenu(!showSpeedMenu);
|
|
6916
6916
|
}, [showSpeedMenu]);
|
|
6917
6917
|
const toggleCaptions = useCallback(() => {
|
|
6918
|
-
if (!trackRef.current?.track) return;
|
|
6918
|
+
if (!trackRef.current?.track || !subtitles) return;
|
|
6919
6919
|
const newShowCaptions = !showCaptions;
|
|
6920
6920
|
setShowCaptions(newShowCaptions);
|
|
6921
|
-
trackRef.current.track.mode = newShowCaptions ? "showing" : "hidden";
|
|
6922
|
-
}, [showCaptions]);
|
|
6921
|
+
trackRef.current.track.mode = newShowCaptions && subtitles ? "showing" : "hidden";
|
|
6922
|
+
}, [showCaptions, subtitles]);
|
|
6923
6923
|
const handleTimeUpdate = useCallback(() => {
|
|
6924
6924
|
if (videoRef.current) {
|
|
6925
6925
|
const current = videoRef.current.currentTime;
|
|
@@ -6948,6 +6948,11 @@ var VideoPlayer = ({
|
|
|
6948
6948
|
setDuration(videoRef.current.duration);
|
|
6949
6949
|
}
|
|
6950
6950
|
}, []);
|
|
6951
|
+
useEffect11(() => {
|
|
6952
|
+
if (trackRef.current?.track) {
|
|
6953
|
+
trackRef.current.track.mode = showCaptions && subtitles ? "showing" : "hidden";
|
|
6954
|
+
}
|
|
6955
|
+
}, [subtitles, showCaptions]);
|
|
6951
6956
|
useEffect11(() => {
|
|
6952
6957
|
const handleVisibilityChange = () => {
|
|
6953
6958
|
if (document.hidden && isPlaying && videoRef.current) {
|
|
@@ -7053,9 +7058,9 @@ var VideoPlayer = ({
|
|
|
7053
7058
|
{
|
|
7054
7059
|
ref: trackRef,
|
|
7055
7060
|
kind: "captions",
|
|
7056
|
-
src: subtitles || "data:text/vtt;charset=utf-8,WEBVTT
|
|
7057
|
-
srcLang: "
|
|
7058
|
-
label: subtitles ? "
|
|
7061
|
+
src: subtitles || "data:text/vtt;charset=utf-8,WEBVTT",
|
|
7062
|
+
srcLang: "pt-br",
|
|
7063
|
+
label: subtitles ? "Legendas em Portugu\xEAs" : "Sem legendas dispon\xEDveis",
|
|
7059
7064
|
default: false
|
|
7060
7065
|
}
|
|
7061
7066
|
)
|
|
@@ -7699,6 +7704,8 @@ var useQuizStore = create7()(
|
|
|
7699
7704
|
isFinished: false,
|
|
7700
7705
|
userId: "",
|
|
7701
7706
|
variant: "default",
|
|
7707
|
+
questionsResult: null,
|
|
7708
|
+
currentQuestionResult: null,
|
|
7702
7709
|
// Setters
|
|
7703
7710
|
setBySimulated: (simulado) => set({ bySimulated: simulado }),
|
|
7704
7711
|
setByActivity: (atividade) => set({ byActivity: atividade }),
|
|
@@ -7707,6 +7714,7 @@ var useQuizStore = create7()(
|
|
|
7707
7714
|
setUserAnswers: (userAnswers) => set({ userAnswers }),
|
|
7708
7715
|
getUserId: () => get().userId,
|
|
7709
7716
|
setVariant: (variant) => set({ variant }),
|
|
7717
|
+
setQuestionResult: (questionsResult) => set({ questionsResult }),
|
|
7710
7718
|
// Navigation
|
|
7711
7719
|
goToNextQuestion: () => {
|
|
7712
7720
|
const { currentQuestionIndex, getTotalQuestions } = get();
|
|
@@ -7759,9 +7767,9 @@ var useQuizStore = create7()(
|
|
|
7759
7767
|
questionId,
|
|
7760
7768
|
activityId,
|
|
7761
7769
|
userId,
|
|
7762
|
-
answer: question.
|
|
7763
|
-
optionId: question.
|
|
7764
|
-
questionType: question.
|
|
7770
|
+
answer: question.questionType === "DISSERTATIVA" /* DISSERTATIVA */ ? answerId : null,
|
|
7771
|
+
optionId: question.questionType === "DISSERTATIVA" /* DISSERTATIVA */ ? null : answerId,
|
|
7772
|
+
questionType: question.questionType,
|
|
7765
7773
|
answerStatus: "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */
|
|
7766
7774
|
};
|
|
7767
7775
|
let updatedUserAnswers;
|
|
@@ -7801,7 +7809,7 @@ var useQuizStore = create7()(
|
|
|
7801
7809
|
// selectMultipleAnswer is for non-dissertative questions
|
|
7802
7810
|
optionId: answerId,
|
|
7803
7811
|
// selectMultipleAnswer should only set optionId
|
|
7804
|
-
questionType: question.
|
|
7812
|
+
questionType: question.questionType,
|
|
7805
7813
|
answerStatus: "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */
|
|
7806
7814
|
})
|
|
7807
7815
|
);
|
|
@@ -7828,7 +7836,7 @@ var useQuizStore = create7()(
|
|
|
7828
7836
|
const question = activeQuiz.quiz.questions.find(
|
|
7829
7837
|
(q) => q.id === questionId
|
|
7830
7838
|
);
|
|
7831
|
-
if (!question || question.
|
|
7839
|
+
if (!question || question.questionType !== "DISSERTATIVA" /* DISSERTATIVA */) {
|
|
7832
7840
|
console.warn(
|
|
7833
7841
|
"selectDissertativeAnswer called for non-dissertative question"
|
|
7834
7842
|
);
|
|
@@ -7878,7 +7886,7 @@ var useQuizStore = create7()(
|
|
|
7878
7886
|
userId,
|
|
7879
7887
|
answer: null,
|
|
7880
7888
|
optionId: null,
|
|
7881
|
-
questionType: currentQuestion.
|
|
7889
|
+
questionType: currentQuestion.questionType,
|
|
7882
7890
|
answerStatus: "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */
|
|
7883
7891
|
};
|
|
7884
7892
|
let updatedUserAnswers;
|
|
@@ -7914,9 +7922,9 @@ var useQuizStore = create7()(
|
|
|
7914
7922
|
questionId,
|
|
7915
7923
|
activityId,
|
|
7916
7924
|
userId,
|
|
7917
|
-
answer: question.
|
|
7918
|
-
optionId: question.
|
|
7919
|
-
questionType: question.
|
|
7925
|
+
answer: question.questionType === "DISSERTATIVA" /* DISSERTATIVA */ ? answerId || null : null,
|
|
7926
|
+
optionId: question.questionType !== "DISSERTATIVA" /* DISSERTATIVA */ ? answerId || null : null,
|
|
7927
|
+
questionType: question.questionType,
|
|
7920
7928
|
answerStatus: "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */
|
|
7921
7929
|
};
|
|
7922
7930
|
if (existingAnswerIndex !== -1) {
|
|
@@ -7944,7 +7952,10 @@ var useQuizStore = create7()(
|
|
|
7944
7952
|
timeElapsed: 0,
|
|
7945
7953
|
isStarted: false,
|
|
7946
7954
|
isFinished: false,
|
|
7947
|
-
userId: ""
|
|
7955
|
+
userId: "",
|
|
7956
|
+
variant: "default",
|
|
7957
|
+
questionsResult: null,
|
|
7958
|
+
currentQuestionResult: null
|
|
7948
7959
|
});
|
|
7949
7960
|
},
|
|
7950
7961
|
// Timer
|
|
@@ -8146,6 +8157,31 @@ var useQuizStore = create7()(
|
|
|
8146
8157
|
(q) => q.id === questionId
|
|
8147
8158
|
);
|
|
8148
8159
|
return questionIndex + 1;
|
|
8160
|
+
},
|
|
8161
|
+
// Question Result
|
|
8162
|
+
getQuestionResultByQuestionId: (questionId) => {
|
|
8163
|
+
const { questionsResult } = get();
|
|
8164
|
+
return questionsResult?.answers.find(
|
|
8165
|
+
(answer) => answer.questionId === questionId
|
|
8166
|
+
) || null;
|
|
8167
|
+
},
|
|
8168
|
+
getQuestionResultStatistics: () => {
|
|
8169
|
+
const { questionsResult } = get();
|
|
8170
|
+
return questionsResult?.statistics || null;
|
|
8171
|
+
},
|
|
8172
|
+
getQuestionResult: () => {
|
|
8173
|
+
const { questionsResult } = get();
|
|
8174
|
+
return questionsResult;
|
|
8175
|
+
},
|
|
8176
|
+
setQuestionsResult: (questionsResult) => {
|
|
8177
|
+
set({ questionsResult });
|
|
8178
|
+
},
|
|
8179
|
+
setCurrentQuestionResult: (currentQuestionResult) => {
|
|
8180
|
+
set({ currentQuestionResult });
|
|
8181
|
+
},
|
|
8182
|
+
getCurrentQuestionResult: () => {
|
|
8183
|
+
const { currentQuestionResult } = get();
|
|
8184
|
+
return currentQuestionResult;
|
|
8149
8185
|
}
|
|
8150
8186
|
};
|
|
8151
8187
|
},
|
|
@@ -8201,18 +8237,21 @@ var Quiz = forwardRef19(({ children, className, variant = "default", ...props },
|
|
|
8201
8237
|
});
|
|
8202
8238
|
var QuizHeaderResult = forwardRef19(
|
|
8203
8239
|
({ className, ...props }, ref) => {
|
|
8204
|
-
const {
|
|
8205
|
-
const usersAnswer = getAllCurrentAnswer();
|
|
8240
|
+
const { getQuestionResultByQuestionId, getCurrentQuestion } = useQuizStore();
|
|
8206
8241
|
const [isCorrect, setIsCorrect] = useState16(false);
|
|
8207
8242
|
useEffect14(() => {
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8212
|
-
).every(Boolean) : false
|
|
8213
|
-
);
|
|
8243
|
+
const cq = getCurrentQuestion();
|
|
8244
|
+
if (!cq) {
|
|
8245
|
+
setIsCorrect(false);
|
|
8246
|
+
return;
|
|
8214
8247
|
}
|
|
8215
|
-
|
|
8248
|
+
const qr = getQuestionResultByQuestionId(cq.id);
|
|
8249
|
+
setIsCorrect(qr?.answerStatus === "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */);
|
|
8250
|
+
}, [
|
|
8251
|
+
getCurrentQuestion,
|
|
8252
|
+
getQuestionResultByQuestionId,
|
|
8253
|
+
getCurrentQuestion()?.id
|
|
8254
|
+
]);
|
|
8216
8255
|
return /* @__PURE__ */ jsxs32(
|
|
8217
8256
|
"div",
|
|
8218
8257
|
{
|
|
@@ -8295,7 +8334,7 @@ var QuizContainer = forwardRef19(({ children, className, ...props }, ref) => {
|
|
|
8295
8334
|
);
|
|
8296
8335
|
});
|
|
8297
8336
|
var QuizContent = forwardRef19(({ paddingBottom }) => {
|
|
8298
|
-
const { getCurrentQuestion
|
|
8337
|
+
const { getCurrentQuestion } = useQuizStore();
|
|
8299
8338
|
const currentQuestion = getCurrentQuestion();
|
|
8300
8339
|
const questionComponents = {
|
|
8301
8340
|
["ALTERNATIVA" /* ALTERNATIVA */]: QuizAlternative,
|
|
@@ -8306,26 +8345,35 @@ var QuizContent = forwardRef19(({ paddingBottom }) => {
|
|
|
8306
8345
|
["PREENCHER" /* PREENCHER */]: QuizFill,
|
|
8307
8346
|
["IMAGEM" /* IMAGEM */]: QuizImageQuestion
|
|
8308
8347
|
};
|
|
8309
|
-
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.
|
|
8310
|
-
return QuestionComponent ? /* @__PURE__ */ jsx39(QuestionComponent, {
|
|
8348
|
+
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.questionType] : null;
|
|
8349
|
+
return QuestionComponent ? /* @__PURE__ */ jsx39(QuestionComponent, { paddingBottom }) : null;
|
|
8311
8350
|
});
|
|
8312
|
-
var QuizAlternative = ({
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
|
|
8351
|
+
var QuizAlternative = ({ paddingBottom }) => {
|
|
8352
|
+
const {
|
|
8353
|
+
getCurrentQuestion,
|
|
8354
|
+
selectAnswer,
|
|
8355
|
+
getQuestionResultByQuestionId,
|
|
8356
|
+
getCurrentAnswer,
|
|
8357
|
+
variant
|
|
8358
|
+
} = useQuizStore();
|
|
8317
8359
|
const currentQuestion = getCurrentQuestion();
|
|
8360
|
+
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
8361
|
+
currentQuestion?.id || ""
|
|
8362
|
+
);
|
|
8318
8363
|
const currentAnswer = getCurrentAnswer();
|
|
8319
8364
|
const alternatives = currentQuestion?.options?.map((option) => {
|
|
8320
8365
|
let status = "neutral" /* NEUTRAL */;
|
|
8321
8366
|
if (variant === "result") {
|
|
8322
|
-
const isCorrectOption = currentQuestion.
|
|
8323
|
-
|
|
8367
|
+
const isCorrectOption = currentQuestion.correctOptionIds?.includes(
|
|
8368
|
+
option.id
|
|
8324
8369
|
);
|
|
8325
|
-
|
|
8370
|
+
const isSelected = currentQuestionResult?.optionId === option.id;
|
|
8371
|
+
if (isCorrectOption) {
|
|
8326
8372
|
status = "correct" /* CORRECT */;
|
|
8327
|
-
} else if (
|
|
8373
|
+
} else if (isSelected && !isCorrectOption) {
|
|
8328
8374
|
status = "incorrect" /* INCORRECT */;
|
|
8375
|
+
} else {
|
|
8376
|
+
status = "neutral" /* NEUTRAL */;
|
|
8329
8377
|
}
|
|
8330
8378
|
}
|
|
8331
8379
|
return {
|
|
@@ -8345,8 +8393,8 @@ var QuizAlternative = ({
|
|
|
8345
8393
|
name: `question-${currentQuestion?.id || "1"}`,
|
|
8346
8394
|
layout: "compact",
|
|
8347
8395
|
alternatives,
|
|
8348
|
-
value: currentAnswer?.optionId || "",
|
|
8349
|
-
selectedValue: currentAnswer?.optionId || "",
|
|
8396
|
+
value: variant === "result" ? currentQuestionResult?.optionId || "" : currentAnswer?.optionId || "",
|
|
8397
|
+
selectedValue: variant === "result" ? currentQuestionResult?.optionId || "" : currentAnswer?.optionId || "",
|
|
8350
8398
|
onValueChange: (value) => {
|
|
8351
8399
|
if (currentQuestion) {
|
|
8352
8400
|
selectAnswer(currentQuestion.id, value);
|
|
@@ -8357,13 +8405,19 @@ var QuizAlternative = ({
|
|
|
8357
8405
|
) }) })
|
|
8358
8406
|
] });
|
|
8359
8407
|
};
|
|
8360
|
-
var QuizMultipleChoice = ({
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
|
|
8408
|
+
var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
8409
|
+
const {
|
|
8410
|
+
getCurrentQuestion,
|
|
8411
|
+
selectMultipleAnswer,
|
|
8412
|
+
getAllCurrentAnswer,
|
|
8413
|
+
getQuestionResultByQuestionId,
|
|
8414
|
+
variant
|
|
8415
|
+
} = useQuizStore();
|
|
8365
8416
|
const currentQuestion = getCurrentQuestion();
|
|
8366
8417
|
const allCurrentAnswers = getAllCurrentAnswer();
|
|
8418
|
+
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
8419
|
+
currentQuestion?.id || ""
|
|
8420
|
+
);
|
|
8367
8421
|
const prevSelectedValuesRef = useRef10([]);
|
|
8368
8422
|
const prevQuestionIdRef = useRef10("");
|
|
8369
8423
|
const allCurrentAnswerIds = useMemo6(() => {
|
|
@@ -8385,8 +8439,16 @@ var QuizMultipleChoice = ({
|
|
|
8385
8439
|
prevSelectedValuesRef.current = selectedValues;
|
|
8386
8440
|
return selectedValues;
|
|
8387
8441
|
}
|
|
8442
|
+
if (variant == "result" && currentQuestionResult?.options.length && currentQuestionResult?.options.length > 0) {
|
|
8443
|
+
return currentQuestionResult?.options.map((op) => op.id) || [];
|
|
8444
|
+
}
|
|
8388
8445
|
return prevSelectedValuesRef.current;
|
|
8389
|
-
}, [
|
|
8446
|
+
}, [
|
|
8447
|
+
selectedValues,
|
|
8448
|
+
currentQuestion?.id,
|
|
8449
|
+
variant,
|
|
8450
|
+
currentQuestionResult?.optionId
|
|
8451
|
+
]);
|
|
8390
8452
|
const handleSelectedValues = useCallback4(
|
|
8391
8453
|
(values) => {
|
|
8392
8454
|
if (currentQuestion) {
|
|
@@ -8402,11 +8464,18 @@ var QuizMultipleChoice = ({
|
|
|
8402
8464
|
const choices = currentQuestion?.options?.map((option) => {
|
|
8403
8465
|
let status = "neutral" /* NEUTRAL */;
|
|
8404
8466
|
if (variant === "result") {
|
|
8405
|
-
const
|
|
8406
|
-
|
|
8467
|
+
const isCorrectOption = currentQuestion.correctOptionIds?.includes(
|
|
8468
|
+
option.id
|
|
8469
|
+
);
|
|
8470
|
+
const isSelected = currentQuestionResult?.options.find(
|
|
8471
|
+
(op) => op.id === option.id
|
|
8472
|
+
);
|
|
8473
|
+
if (isCorrectOption) {
|
|
8407
8474
|
status = "correct" /* CORRECT */;
|
|
8408
|
-
} else if (
|
|
8475
|
+
} else if (isSelected && !isCorrectOption) {
|
|
8409
8476
|
status = "incorrect" /* INCORRECT */;
|
|
8477
|
+
} else {
|
|
8478
|
+
status = "neutral" /* NEUTRAL */;
|
|
8410
8479
|
}
|
|
8411
8480
|
}
|
|
8412
8481
|
return {
|
|
@@ -8432,12 +8501,18 @@ var QuizMultipleChoice = ({
|
|
|
8432
8501
|
) }) })
|
|
8433
8502
|
] });
|
|
8434
8503
|
};
|
|
8435
|
-
var QuizDissertative = ({
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
|
|
8504
|
+
var QuizDissertative = ({ paddingBottom }) => {
|
|
8505
|
+
const {
|
|
8506
|
+
getCurrentQuestion,
|
|
8507
|
+
getCurrentAnswer,
|
|
8508
|
+
selectDissertativeAnswer,
|
|
8509
|
+
getQuestionResultByQuestionId,
|
|
8510
|
+
variant
|
|
8511
|
+
} = useQuizStore();
|
|
8440
8512
|
const currentQuestion = getCurrentQuestion();
|
|
8513
|
+
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
8514
|
+
currentQuestion?.id || ""
|
|
8515
|
+
);
|
|
8441
8516
|
const currentAnswer = getCurrentAnswer();
|
|
8442
8517
|
const textareaRef = useRef10(null);
|
|
8443
8518
|
const handleAnswerChange = (value) => {
|
|
@@ -8461,6 +8536,7 @@ var QuizDissertative = ({
|
|
|
8461
8536
|
if (!currentQuestion) {
|
|
8462
8537
|
return /* @__PURE__ */ jsx39("div", { className: "space-y-4", children: /* @__PURE__ */ jsx39("p", { className: "text-text-600 text-md", children: "Nenhuma quest\xE3o dispon\xEDvel" }) });
|
|
8463
8538
|
}
|
|
8539
|
+
const localAnswer = (variant == "result" ? currentQuestionResult?.answer : currentAnswer?.answer) || "";
|
|
8464
8540
|
return /* @__PURE__ */ jsxs32(Fragment9, { children: [
|
|
8465
8541
|
/* @__PURE__ */ jsx39(QuizSubTitle, { subTitle: "Resposta" }),
|
|
8466
8542
|
/* @__PURE__ */ jsx39(QuizContainer, { className: cn(variant != "result" && paddingBottom), children: /* @__PURE__ */ jsx39("div", { className: "space-y-4 max-h-[600px] overflow-y-auto", children: variant === "default" ? /* @__PURE__ */ jsx39("div", { className: "space-y-4", children: /* @__PURE__ */ jsx39(
|
|
@@ -8468,22 +8544,20 @@ var QuizDissertative = ({
|
|
|
8468
8544
|
{
|
|
8469
8545
|
ref: textareaRef,
|
|
8470
8546
|
placeholder: "Escreva sua resposta",
|
|
8471
|
-
value:
|
|
8547
|
+
value: localAnswer,
|
|
8472
8548
|
onChange: (e) => handleAnswerChange(e.target.value),
|
|
8473
8549
|
rows: 4,
|
|
8474
8550
|
className: "min-h-[120px] max-h-[400px] resize-none overflow-y-auto"
|
|
8475
8551
|
}
|
|
8476
|
-
) }) : /* @__PURE__ */ jsx39("div", { className: "space-y-4", children: /* @__PURE__ */ jsx39("p", { className: "text-text-600 text-md whitespace-pre-wrap", children:
|
|
8477
|
-
variant === "result" &&
|
|
8552
|
+
) }) : /* @__PURE__ */ jsx39("div", { className: "space-y-4", children: /* @__PURE__ */ jsx39("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: localAnswer || "Nenhuma resposta fornecida" }) }) }) }),
|
|
8553
|
+
variant === "result" && currentQuestionResult?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ jsxs32(Fragment9, { children: [
|
|
8478
8554
|
/* @__PURE__ */ jsx39(QuizSubTitle, { subTitle: "Observa\xE7\xE3o do professor" }),
|
|
8479
8555
|
/* @__PURE__ */ jsx39(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx39("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." }) })
|
|
8480
8556
|
] })
|
|
8481
8557
|
] });
|
|
8482
8558
|
};
|
|
8483
|
-
var QuizTrueOrFalse = ({
|
|
8484
|
-
variant =
|
|
8485
|
-
paddingBottom
|
|
8486
|
-
}) => {
|
|
8559
|
+
var QuizTrueOrFalse = ({ paddingBottom }) => {
|
|
8560
|
+
const { variant } = useQuizStore();
|
|
8487
8561
|
const options = [
|
|
8488
8562
|
{
|
|
8489
8563
|
label: "25 metros",
|
|
@@ -8543,10 +8617,8 @@ var QuizTrueOrFalse = ({
|
|
|
8543
8617
|
}) }) })
|
|
8544
8618
|
] });
|
|
8545
8619
|
};
|
|
8546
|
-
var QuizConnectDots = ({
|
|
8547
|
-
variant =
|
|
8548
|
-
paddingBottom
|
|
8549
|
-
}) => {
|
|
8620
|
+
var QuizConnectDots = ({ paddingBottom }) => {
|
|
8621
|
+
const { variant } = useQuizStore();
|
|
8550
8622
|
const dotsOptions = [
|
|
8551
8623
|
{ label: "Ra\xE7\xE3o" },
|
|
8552
8624
|
{ label: "Rato" },
|
|
@@ -8672,10 +8744,8 @@ var QuizConnectDots = ({
|
|
|
8672
8744
|
}) }) })
|
|
8673
8745
|
] });
|
|
8674
8746
|
};
|
|
8675
|
-
var QuizFill = ({
|
|
8676
|
-
variant =
|
|
8677
|
-
paddingBottom = "pb-[80px]"
|
|
8678
|
-
}) => {
|
|
8747
|
+
var QuizFill = ({ paddingBottom = "pb-[80px]" }) => {
|
|
8748
|
+
const { variant } = useQuizStore();
|
|
8679
8749
|
const options = [
|
|
8680
8750
|
"ci\xEAncia",
|
|
8681
8751
|
"disciplina",
|
|
@@ -8844,10 +8914,8 @@ var QuizFill = ({
|
|
|
8844
8914
|
] })
|
|
8845
8915
|
] });
|
|
8846
8916
|
};
|
|
8847
|
-
var QuizImageQuestion = ({
|
|
8848
|
-
variant =
|
|
8849
|
-
paddingBottom
|
|
8850
|
-
}) => {
|
|
8917
|
+
var QuizImageQuestion = ({ paddingBottom }) => {
|
|
8918
|
+
const { variant } = useQuizStore();
|
|
8851
8919
|
const correctPositionRelative = { x: 0.48, y: 0.45 };
|
|
8852
8920
|
const calculateCorrectRadiusRelative = () => {
|
|
8853
8921
|
const circleWidthRelative = 0.15;
|
|
@@ -9065,7 +9133,6 @@ var QuizFooter = forwardRef19(
|
|
|
9065
9133
|
}, ref) => {
|
|
9066
9134
|
const {
|
|
9067
9135
|
currentQuestionIndex,
|
|
9068
|
-
getUserAnswers,
|
|
9069
9136
|
getTotalQuestions,
|
|
9070
9137
|
goToNextQuestion,
|
|
9071
9138
|
goToPreviousQuestion,
|
|
@@ -9075,7 +9142,7 @@ var QuizFooter = forwardRef19(
|
|
|
9075
9142
|
getCurrentQuestion,
|
|
9076
9143
|
getQuestionStatusFromUserAnswers,
|
|
9077
9144
|
variant,
|
|
9078
|
-
|
|
9145
|
+
getQuestionResultStatistics
|
|
9079
9146
|
} = useQuizStore();
|
|
9080
9147
|
const totalQuestions = getTotalQuestions();
|
|
9081
9148
|
const isFirstQuestion = currentQuestionIndex === 0;
|
|
@@ -9089,7 +9156,6 @@ var QuizFooter = forwardRef19(
|
|
|
9089
9156
|
const [modalResolutionOpen, setModalResolutionOpen] = useState16(false);
|
|
9090
9157
|
const [filterType, setFilterType] = useState16("all");
|
|
9091
9158
|
const unansweredQuestions = getUnansweredQuestionsFromUserAnswers();
|
|
9092
|
-
const userAnswers = getUserAnswers();
|
|
9093
9159
|
const allQuestions = getTotalQuestions();
|
|
9094
9160
|
const handleFinishQuiz = async () => {
|
|
9095
9161
|
if (unansweredQuestions.length > 0) {
|
|
@@ -9249,21 +9315,9 @@ var QuizFooter = forwardRef19(
|
|
|
9249
9315
|
/* @__PURE__ */ jsxs32("p", { className: "text-text-500 font-sm", children: [
|
|
9250
9316
|
"Voc\xEA acertou",
|
|
9251
9317
|
" ",
|
|
9252
|
-
(
|
|
9253
|
-
|
|
9254
|
-
if (!activeQuiz) return 0;
|
|
9255
|
-
return userAnswers.filter((answer) => {
|
|
9256
|
-
const question = activeQuiz.quiz.questions.find(
|
|
9257
|
-
(q) => q.id === answer.questionId
|
|
9258
|
-
);
|
|
9259
|
-
const isCorrectOption = question?.options.find(
|
|
9260
|
-
(op) => op.isCorrect
|
|
9261
|
-
);
|
|
9262
|
-
return question && answer.optionId === isCorrectOption?.id;
|
|
9263
|
-
}).length;
|
|
9264
|
-
})(),
|
|
9318
|
+
getQuestionResultStatistics()?.correctAnswers ?? "--",
|
|
9319
|
+
" de",
|
|
9265
9320
|
" ",
|
|
9266
|
-
"de ",
|
|
9267
9321
|
allQuestions,
|
|
9268
9322
|
" quest\xF5es."
|
|
9269
9323
|
] })
|
|
@@ -9320,7 +9374,7 @@ var QuizFooter = forwardRef19(
|
|
|
9320
9374
|
onClose: () => setModalResolutionOpen(false),
|
|
9321
9375
|
title: "Resolu\xE7\xE3o",
|
|
9322
9376
|
size: "lg",
|
|
9323
|
-
children: currentQuestion?.
|
|
9377
|
+
children: currentQuestion?.solutionExplanation
|
|
9324
9378
|
}
|
|
9325
9379
|
)
|
|
9326
9380
|
] });
|
|
@@ -9336,7 +9390,7 @@ var QuizResultHeaderTitle = forwardRef19(({ className, ...props }, ref) => {
|
|
|
9336
9390
|
...props,
|
|
9337
9391
|
children: [
|
|
9338
9392
|
/* @__PURE__ */ jsx39("p", { className: "text-text-950 font-bold text-2xl", children: "Resultado" }),
|
|
9339
|
-
bySimulated && /* @__PURE__ */ jsx39(Badge_default, { variant: "solid", action: "info", children: bySimulated.
|
|
9393
|
+
bySimulated && /* @__PURE__ */ jsx39(Badge_default, { variant: "solid", action: "info", children: bySimulated.type })
|
|
9340
9394
|
]
|
|
9341
9395
|
}
|
|
9342
9396
|
);
|
|
@@ -9360,13 +9414,11 @@ var QuizResultPerformance = forwardRef19(
|
|
|
9360
9414
|
getTotalQuestions,
|
|
9361
9415
|
timeElapsed,
|
|
9362
9416
|
formatTime: formatTime2,
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
byQuestionary,
|
|
9366
|
-
getUserAnswerByQuestionId
|
|
9417
|
+
getQuestionResultStatistics,
|
|
9418
|
+
getQuestionResult
|
|
9367
9419
|
} = useQuizStore();
|
|
9368
9420
|
const totalQuestions = getTotalQuestions();
|
|
9369
|
-
const
|
|
9421
|
+
const questionResult = getQuestionResult();
|
|
9370
9422
|
let correctAnswers = 0;
|
|
9371
9423
|
let correctEasyAnswers = 0;
|
|
9372
9424
|
let correctMediumAnswers = 0;
|
|
@@ -9374,24 +9426,23 @@ var QuizResultPerformance = forwardRef19(
|
|
|
9374
9426
|
let totalEasyQuestions = 0;
|
|
9375
9427
|
let totalMediumQuestions = 0;
|
|
9376
9428
|
let totalDifficultQuestions = 0;
|
|
9377
|
-
if (
|
|
9378
|
-
|
|
9379
|
-
const
|
|
9380
|
-
const isCorrect = userAnswerItem?.answerStatus == "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */;
|
|
9429
|
+
if (questionResult) {
|
|
9430
|
+
questionResult.answers.forEach((answer) => {
|
|
9431
|
+
const isCorrect = answer.answerStatus == "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */;
|
|
9381
9432
|
if (isCorrect) {
|
|
9382
9433
|
correctAnswers++;
|
|
9383
9434
|
}
|
|
9384
|
-
if (
|
|
9435
|
+
if (answer.difficultyLevel === "FACIL" /* FACIL */) {
|
|
9385
9436
|
totalEasyQuestions++;
|
|
9386
9437
|
if (isCorrect) {
|
|
9387
9438
|
correctEasyAnswers++;
|
|
9388
9439
|
}
|
|
9389
|
-
} else if (
|
|
9440
|
+
} else if (answer.difficultyLevel === "MEDIO" /* MEDIO */) {
|
|
9390
9441
|
totalMediumQuestions++;
|
|
9391
9442
|
if (isCorrect) {
|
|
9392
9443
|
correctMediumAnswers++;
|
|
9393
9444
|
}
|
|
9394
|
-
} else if (
|
|
9445
|
+
} else if (answer.difficultyLevel === "DIFICIL" /* DIFICIL */) {
|
|
9395
9446
|
totalDifficultQuestions++;
|
|
9396
9447
|
if (isCorrect) {
|
|
9397
9448
|
correctDifficultAnswers++;
|
|
@@ -9424,8 +9475,9 @@ var QuizResultPerformance = forwardRef19(
|
|
|
9424
9475
|
/* @__PURE__ */ jsx39("span", { className: "text-2xs font-medium text-text-800", children: formatTime2(timeElapsed) })
|
|
9425
9476
|
] }),
|
|
9426
9477
|
/* @__PURE__ */ jsxs32("div", { className: "text-2xl font-medium text-text-800 leading-7", children: [
|
|
9427
|
-
correctAnswers,
|
|
9428
|
-
" de
|
|
9478
|
+
getQuestionResultStatistics()?.correctAnswers ?? "--",
|
|
9479
|
+
" de",
|
|
9480
|
+
" ",
|
|
9429
9481
|
totalQuestions
|
|
9430
9482
|
] }),
|
|
9431
9483
|
/* @__PURE__ */ jsx39("div", { className: "text-2xs font-medium text-text-600 mt-1", children: "Corretas" })
|