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/index.js
CHANGED
|
@@ -39,6 +39,7 @@ __export(src_exports, {
|
|
|
39
39
|
Calendar: () => Calendar_default,
|
|
40
40
|
CardAccordation: () => CardAccordation,
|
|
41
41
|
CardActivitiesResults: () => CardActivitiesResults,
|
|
42
|
+
CardAudio: () => CardAudio,
|
|
42
43
|
CardPerformance: () => CardPerformance,
|
|
43
44
|
CardProgress: () => CardProgress,
|
|
44
45
|
CardQuestions: () => CardQuestions,
|
|
@@ -6956,11 +6957,11 @@ var VideoPlayer = ({
|
|
|
6956
6957
|
setShowSpeedMenu(!showSpeedMenu);
|
|
6957
6958
|
}, [showSpeedMenu]);
|
|
6958
6959
|
const toggleCaptions = (0, import_react22.useCallback)(() => {
|
|
6959
|
-
if (!trackRef.current?.track) return;
|
|
6960
|
+
if (!trackRef.current?.track || !subtitles) return;
|
|
6960
6961
|
const newShowCaptions = !showCaptions;
|
|
6961
6962
|
setShowCaptions(newShowCaptions);
|
|
6962
|
-
trackRef.current.track.mode = newShowCaptions ? "showing" : "hidden";
|
|
6963
|
-
}, [showCaptions]);
|
|
6963
|
+
trackRef.current.track.mode = newShowCaptions && subtitles ? "showing" : "hidden";
|
|
6964
|
+
}, [showCaptions, subtitles]);
|
|
6964
6965
|
const handleTimeUpdate = (0, import_react22.useCallback)(() => {
|
|
6965
6966
|
if (videoRef.current) {
|
|
6966
6967
|
const current = videoRef.current.currentTime;
|
|
@@ -6989,6 +6990,11 @@ var VideoPlayer = ({
|
|
|
6989
6990
|
setDuration(videoRef.current.duration);
|
|
6990
6991
|
}
|
|
6991
6992
|
}, []);
|
|
6993
|
+
(0, import_react22.useEffect)(() => {
|
|
6994
|
+
if (trackRef.current?.track) {
|
|
6995
|
+
trackRef.current.track.mode = showCaptions && subtitles ? "showing" : "hidden";
|
|
6996
|
+
}
|
|
6997
|
+
}, [subtitles, showCaptions]);
|
|
6992
6998
|
(0, import_react22.useEffect)(() => {
|
|
6993
6999
|
const handleVisibilityChange = () => {
|
|
6994
7000
|
if (document.hidden && isPlaying && videoRef.current) {
|
|
@@ -7094,9 +7100,9 @@ var VideoPlayer = ({
|
|
|
7094
7100
|
{
|
|
7095
7101
|
ref: trackRef,
|
|
7096
7102
|
kind: "captions",
|
|
7097
|
-
src: subtitles || "data:text/vtt;charset=utf-8,WEBVTT
|
|
7098
|
-
srcLang: "
|
|
7099
|
-
label: subtitles ? "
|
|
7103
|
+
src: subtitles || "data:text/vtt;charset=utf-8,WEBVTT",
|
|
7104
|
+
srcLang: "pt-br",
|
|
7105
|
+
label: subtitles ? "Legendas em Portugu\xEAs" : "Sem legendas dispon\xEDveis",
|
|
7100
7106
|
default: false
|
|
7101
7107
|
}
|
|
7102
7108
|
)
|
|
@@ -7716,6 +7722,8 @@ var useQuizStore = (0, import_zustand7.create)()(
|
|
|
7716
7722
|
isFinished: false,
|
|
7717
7723
|
userId: "",
|
|
7718
7724
|
variant: "default",
|
|
7725
|
+
questionsResult: null,
|
|
7726
|
+
currentQuestionResult: null,
|
|
7719
7727
|
// Setters
|
|
7720
7728
|
setBySimulated: (simulado) => set({ bySimulated: simulado }),
|
|
7721
7729
|
setByActivity: (atividade) => set({ byActivity: atividade }),
|
|
@@ -7724,6 +7732,7 @@ var useQuizStore = (0, import_zustand7.create)()(
|
|
|
7724
7732
|
setUserAnswers: (userAnswers) => set({ userAnswers }),
|
|
7725
7733
|
getUserId: () => get().userId,
|
|
7726
7734
|
setVariant: (variant) => set({ variant }),
|
|
7735
|
+
setQuestionResult: (questionsResult) => set({ questionsResult }),
|
|
7727
7736
|
// Navigation
|
|
7728
7737
|
goToNextQuestion: () => {
|
|
7729
7738
|
const { currentQuestionIndex, getTotalQuestions } = get();
|
|
@@ -7776,9 +7785,9 @@ var useQuizStore = (0, import_zustand7.create)()(
|
|
|
7776
7785
|
questionId,
|
|
7777
7786
|
activityId,
|
|
7778
7787
|
userId,
|
|
7779
|
-
answer: question.
|
|
7780
|
-
optionId: question.
|
|
7781
|
-
questionType: question.
|
|
7788
|
+
answer: question.questionType === "DISSERTATIVA" /* DISSERTATIVA */ ? answerId : null,
|
|
7789
|
+
optionId: question.questionType === "DISSERTATIVA" /* DISSERTATIVA */ ? null : answerId,
|
|
7790
|
+
questionType: question.questionType,
|
|
7782
7791
|
answerStatus: "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */
|
|
7783
7792
|
};
|
|
7784
7793
|
let updatedUserAnswers;
|
|
@@ -7818,7 +7827,7 @@ var useQuizStore = (0, import_zustand7.create)()(
|
|
|
7818
7827
|
// selectMultipleAnswer is for non-dissertative questions
|
|
7819
7828
|
optionId: answerId,
|
|
7820
7829
|
// selectMultipleAnswer should only set optionId
|
|
7821
|
-
questionType: question.
|
|
7830
|
+
questionType: question.questionType,
|
|
7822
7831
|
answerStatus: "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */
|
|
7823
7832
|
})
|
|
7824
7833
|
);
|
|
@@ -7845,7 +7854,7 @@ var useQuizStore = (0, import_zustand7.create)()(
|
|
|
7845
7854
|
const question = activeQuiz.quiz.questions.find(
|
|
7846
7855
|
(q) => q.id === questionId
|
|
7847
7856
|
);
|
|
7848
|
-
if (!question || question.
|
|
7857
|
+
if (!question || question.questionType !== "DISSERTATIVA" /* DISSERTATIVA */) {
|
|
7849
7858
|
console.warn(
|
|
7850
7859
|
"selectDissertativeAnswer called for non-dissertative question"
|
|
7851
7860
|
);
|
|
@@ -7895,7 +7904,7 @@ var useQuizStore = (0, import_zustand7.create)()(
|
|
|
7895
7904
|
userId,
|
|
7896
7905
|
answer: null,
|
|
7897
7906
|
optionId: null,
|
|
7898
|
-
questionType: currentQuestion.
|
|
7907
|
+
questionType: currentQuestion.questionType,
|
|
7899
7908
|
answerStatus: "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */
|
|
7900
7909
|
};
|
|
7901
7910
|
let updatedUserAnswers;
|
|
@@ -7931,9 +7940,9 @@ var useQuizStore = (0, import_zustand7.create)()(
|
|
|
7931
7940
|
questionId,
|
|
7932
7941
|
activityId,
|
|
7933
7942
|
userId,
|
|
7934
|
-
answer: question.
|
|
7935
|
-
optionId: question.
|
|
7936
|
-
questionType: question.
|
|
7943
|
+
answer: question.questionType === "DISSERTATIVA" /* DISSERTATIVA */ ? answerId || null : null,
|
|
7944
|
+
optionId: question.questionType !== "DISSERTATIVA" /* DISSERTATIVA */ ? answerId || null : null,
|
|
7945
|
+
questionType: question.questionType,
|
|
7937
7946
|
answerStatus: "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */
|
|
7938
7947
|
};
|
|
7939
7948
|
if (existingAnswerIndex !== -1) {
|
|
@@ -7961,7 +7970,10 @@ var useQuizStore = (0, import_zustand7.create)()(
|
|
|
7961
7970
|
timeElapsed: 0,
|
|
7962
7971
|
isStarted: false,
|
|
7963
7972
|
isFinished: false,
|
|
7964
|
-
userId: ""
|
|
7973
|
+
userId: "",
|
|
7974
|
+
variant: "default",
|
|
7975
|
+
questionsResult: null,
|
|
7976
|
+
currentQuestionResult: null
|
|
7965
7977
|
});
|
|
7966
7978
|
},
|
|
7967
7979
|
// Timer
|
|
@@ -8163,6 +8175,31 @@ var useQuizStore = (0, import_zustand7.create)()(
|
|
|
8163
8175
|
(q) => q.id === questionId
|
|
8164
8176
|
);
|
|
8165
8177
|
return questionIndex + 1;
|
|
8178
|
+
},
|
|
8179
|
+
// Question Result
|
|
8180
|
+
getQuestionResultByQuestionId: (questionId) => {
|
|
8181
|
+
const { questionsResult } = get();
|
|
8182
|
+
return questionsResult?.answers.find(
|
|
8183
|
+
(answer) => answer.questionId === questionId
|
|
8184
|
+
) || null;
|
|
8185
|
+
},
|
|
8186
|
+
getQuestionResultStatistics: () => {
|
|
8187
|
+
const { questionsResult } = get();
|
|
8188
|
+
return questionsResult?.statistics || null;
|
|
8189
|
+
},
|
|
8190
|
+
getQuestionResult: () => {
|
|
8191
|
+
const { questionsResult } = get();
|
|
8192
|
+
return questionsResult;
|
|
8193
|
+
},
|
|
8194
|
+
setQuestionsResult: (questionsResult) => {
|
|
8195
|
+
set({ questionsResult });
|
|
8196
|
+
},
|
|
8197
|
+
setCurrentQuestionResult: (currentQuestionResult) => {
|
|
8198
|
+
set({ currentQuestionResult });
|
|
8199
|
+
},
|
|
8200
|
+
getCurrentQuestionResult: () => {
|
|
8201
|
+
const { currentQuestionResult } = get();
|
|
8202
|
+
return currentQuestionResult;
|
|
8166
8203
|
}
|
|
8167
8204
|
};
|
|
8168
8205
|
},
|
|
@@ -8218,18 +8255,21 @@ var Quiz = (0, import_react27.forwardRef)(({ children, className, variant = "def
|
|
|
8218
8255
|
});
|
|
8219
8256
|
var QuizHeaderResult = (0, import_react27.forwardRef)(
|
|
8220
8257
|
({ className, ...props }, ref) => {
|
|
8221
|
-
const {
|
|
8222
|
-
const usersAnswer = getAllCurrentAnswer();
|
|
8258
|
+
const { getQuestionResultByQuestionId, getCurrentQuestion } = useQuizStore();
|
|
8223
8259
|
const [isCorrect, setIsCorrect] = (0, import_react27.useState)(false);
|
|
8224
8260
|
(0, import_react27.useEffect)(() => {
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
).every(Boolean) : false
|
|
8230
|
-
);
|
|
8261
|
+
const cq = getCurrentQuestion();
|
|
8262
|
+
if (!cq) {
|
|
8263
|
+
setIsCorrect(false);
|
|
8264
|
+
return;
|
|
8231
8265
|
}
|
|
8232
|
-
|
|
8266
|
+
const qr = getQuestionResultByQuestionId(cq.id);
|
|
8267
|
+
setIsCorrect(qr?.answerStatus === "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */);
|
|
8268
|
+
}, [
|
|
8269
|
+
getCurrentQuestion,
|
|
8270
|
+
getQuestionResultByQuestionId,
|
|
8271
|
+
getCurrentQuestion()?.id
|
|
8272
|
+
]);
|
|
8233
8273
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
8234
8274
|
"div",
|
|
8235
8275
|
{
|
|
@@ -8312,7 +8352,7 @@ var QuizContainer = (0, import_react27.forwardRef)(({ children, className, ...pr
|
|
|
8312
8352
|
);
|
|
8313
8353
|
});
|
|
8314
8354
|
var QuizContent = (0, import_react27.forwardRef)(({ paddingBottom }) => {
|
|
8315
|
-
const { getCurrentQuestion
|
|
8355
|
+
const { getCurrentQuestion } = useQuizStore();
|
|
8316
8356
|
const currentQuestion = getCurrentQuestion();
|
|
8317
8357
|
const questionComponents = {
|
|
8318
8358
|
["ALTERNATIVA" /* ALTERNATIVA */]: QuizAlternative,
|
|
@@ -8323,26 +8363,35 @@ var QuizContent = (0, import_react27.forwardRef)(({ paddingBottom }) => {
|
|
|
8323
8363
|
["PREENCHER" /* PREENCHER */]: QuizFill,
|
|
8324
8364
|
["IMAGEM" /* IMAGEM */]: QuizImageQuestion
|
|
8325
8365
|
};
|
|
8326
|
-
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.
|
|
8327
|
-
return QuestionComponent ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(QuestionComponent, {
|
|
8366
|
+
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.questionType] : null;
|
|
8367
|
+
return QuestionComponent ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(QuestionComponent, { paddingBottom }) : null;
|
|
8328
8368
|
});
|
|
8329
|
-
var QuizAlternative = ({
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8369
|
+
var QuizAlternative = ({ paddingBottom }) => {
|
|
8370
|
+
const {
|
|
8371
|
+
getCurrentQuestion,
|
|
8372
|
+
selectAnswer,
|
|
8373
|
+
getQuestionResultByQuestionId,
|
|
8374
|
+
getCurrentAnswer,
|
|
8375
|
+
variant
|
|
8376
|
+
} = useQuizStore();
|
|
8334
8377
|
const currentQuestion = getCurrentQuestion();
|
|
8378
|
+
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
8379
|
+
currentQuestion?.id || ""
|
|
8380
|
+
);
|
|
8335
8381
|
const currentAnswer = getCurrentAnswer();
|
|
8336
8382
|
const alternatives = currentQuestion?.options?.map((option) => {
|
|
8337
8383
|
let status = "neutral" /* NEUTRAL */;
|
|
8338
8384
|
if (variant === "result") {
|
|
8339
|
-
const isCorrectOption = currentQuestion.
|
|
8340
|
-
|
|
8385
|
+
const isCorrectOption = currentQuestion.correctOptionIds?.includes(
|
|
8386
|
+
option.id
|
|
8341
8387
|
);
|
|
8342
|
-
|
|
8388
|
+
const isSelected = currentQuestionResult?.optionId === option.id;
|
|
8389
|
+
if (isCorrectOption) {
|
|
8343
8390
|
status = "correct" /* CORRECT */;
|
|
8344
|
-
} else if (
|
|
8391
|
+
} else if (isSelected && !isCorrectOption) {
|
|
8345
8392
|
status = "incorrect" /* INCORRECT */;
|
|
8393
|
+
} else {
|
|
8394
|
+
status = "neutral" /* NEUTRAL */;
|
|
8346
8395
|
}
|
|
8347
8396
|
}
|
|
8348
8397
|
return {
|
|
@@ -8362,8 +8411,8 @@ var QuizAlternative = ({
|
|
|
8362
8411
|
name: `question-${currentQuestion?.id || "1"}`,
|
|
8363
8412
|
layout: "compact",
|
|
8364
8413
|
alternatives,
|
|
8365
|
-
value: currentAnswer?.optionId || "",
|
|
8366
|
-
selectedValue: currentAnswer?.optionId || "",
|
|
8414
|
+
value: variant === "result" ? currentQuestionResult?.optionId || "" : currentAnswer?.optionId || "",
|
|
8415
|
+
selectedValue: variant === "result" ? currentQuestionResult?.optionId || "" : currentAnswer?.optionId || "",
|
|
8367
8416
|
onValueChange: (value) => {
|
|
8368
8417
|
if (currentQuestion) {
|
|
8369
8418
|
selectAnswer(currentQuestion.id, value);
|
|
@@ -8374,13 +8423,19 @@ var QuizAlternative = ({
|
|
|
8374
8423
|
) }) })
|
|
8375
8424
|
] });
|
|
8376
8425
|
};
|
|
8377
|
-
var QuizMultipleChoice = ({
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8426
|
+
var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
8427
|
+
const {
|
|
8428
|
+
getCurrentQuestion,
|
|
8429
|
+
selectMultipleAnswer,
|
|
8430
|
+
getAllCurrentAnswer,
|
|
8431
|
+
getQuestionResultByQuestionId,
|
|
8432
|
+
variant
|
|
8433
|
+
} = useQuizStore();
|
|
8382
8434
|
const currentQuestion = getCurrentQuestion();
|
|
8383
8435
|
const allCurrentAnswers = getAllCurrentAnswer();
|
|
8436
|
+
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
8437
|
+
currentQuestion?.id || ""
|
|
8438
|
+
);
|
|
8384
8439
|
const prevSelectedValuesRef = (0, import_react27.useRef)([]);
|
|
8385
8440
|
const prevQuestionIdRef = (0, import_react27.useRef)("");
|
|
8386
8441
|
const allCurrentAnswerIds = (0, import_react27.useMemo)(() => {
|
|
@@ -8402,8 +8457,16 @@ var QuizMultipleChoice = ({
|
|
|
8402
8457
|
prevSelectedValuesRef.current = selectedValues;
|
|
8403
8458
|
return selectedValues;
|
|
8404
8459
|
}
|
|
8460
|
+
if (variant == "result" && currentQuestionResult?.options.length && currentQuestionResult?.options.length > 0) {
|
|
8461
|
+
return currentQuestionResult?.options.map((op) => op.id) || [];
|
|
8462
|
+
}
|
|
8405
8463
|
return prevSelectedValuesRef.current;
|
|
8406
|
-
}, [
|
|
8464
|
+
}, [
|
|
8465
|
+
selectedValues,
|
|
8466
|
+
currentQuestion?.id,
|
|
8467
|
+
variant,
|
|
8468
|
+
currentQuestionResult?.optionId
|
|
8469
|
+
]);
|
|
8407
8470
|
const handleSelectedValues = (0, import_react27.useCallback)(
|
|
8408
8471
|
(values) => {
|
|
8409
8472
|
if (currentQuestion) {
|
|
@@ -8419,11 +8482,18 @@ var QuizMultipleChoice = ({
|
|
|
8419
8482
|
const choices = currentQuestion?.options?.map((option) => {
|
|
8420
8483
|
let status = "neutral" /* NEUTRAL */;
|
|
8421
8484
|
if (variant === "result") {
|
|
8422
|
-
const
|
|
8423
|
-
|
|
8485
|
+
const isCorrectOption = currentQuestion.correctOptionIds?.includes(
|
|
8486
|
+
option.id
|
|
8487
|
+
);
|
|
8488
|
+
const isSelected = currentQuestionResult?.options.find(
|
|
8489
|
+
(op) => op.id === option.id
|
|
8490
|
+
);
|
|
8491
|
+
if (isCorrectOption) {
|
|
8424
8492
|
status = "correct" /* CORRECT */;
|
|
8425
|
-
} else if (
|
|
8493
|
+
} else if (isSelected && !isCorrectOption) {
|
|
8426
8494
|
status = "incorrect" /* INCORRECT */;
|
|
8495
|
+
} else {
|
|
8496
|
+
status = "neutral" /* NEUTRAL */;
|
|
8427
8497
|
}
|
|
8428
8498
|
}
|
|
8429
8499
|
return {
|
|
@@ -8449,12 +8519,18 @@ var QuizMultipleChoice = ({
|
|
|
8449
8519
|
) }) })
|
|
8450
8520
|
] });
|
|
8451
8521
|
};
|
|
8452
|
-
var QuizDissertative = ({
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8522
|
+
var QuizDissertative = ({ paddingBottom }) => {
|
|
8523
|
+
const {
|
|
8524
|
+
getCurrentQuestion,
|
|
8525
|
+
getCurrentAnswer,
|
|
8526
|
+
selectDissertativeAnswer,
|
|
8527
|
+
getQuestionResultByQuestionId,
|
|
8528
|
+
variant
|
|
8529
|
+
} = useQuizStore();
|
|
8457
8530
|
const currentQuestion = getCurrentQuestion();
|
|
8531
|
+
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
8532
|
+
currentQuestion?.id || ""
|
|
8533
|
+
);
|
|
8458
8534
|
const currentAnswer = getCurrentAnswer();
|
|
8459
8535
|
const textareaRef = (0, import_react27.useRef)(null);
|
|
8460
8536
|
const handleAnswerChange = (value) => {
|
|
@@ -8478,6 +8554,7 @@ var QuizDissertative = ({
|
|
|
8478
8554
|
if (!currentQuestion) {
|
|
8479
8555
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "text-text-600 text-md", children: "Nenhuma quest\xE3o dispon\xEDvel" }) });
|
|
8480
8556
|
}
|
|
8557
|
+
const localAnswer = (variant == "result" ? currentQuestionResult?.answer : currentAnswer?.answer) || "";
|
|
8481
8558
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
8482
8559
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(QuizSubTitle, { subTitle: "Resposta" }),
|
|
8483
8560
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(QuizContainer, { className: cn(variant != "result" && paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "space-y-4 max-h-[600px] overflow-y-auto", children: variant === "default" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
@@ -8485,22 +8562,20 @@ var QuizDissertative = ({
|
|
|
8485
8562
|
{
|
|
8486
8563
|
ref: textareaRef,
|
|
8487
8564
|
placeholder: "Escreva sua resposta",
|
|
8488
|
-
value:
|
|
8565
|
+
value: localAnswer,
|
|
8489
8566
|
onChange: (e) => handleAnswerChange(e.target.value),
|
|
8490
8567
|
rows: 4,
|
|
8491
8568
|
className: "min-h-[120px] max-h-[400px] resize-none overflow-y-auto"
|
|
8492
8569
|
}
|
|
8493
|
-
) }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "text-text-600 text-md whitespace-pre-wrap", children:
|
|
8494
|
-
variant === "result" &&
|
|
8570
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: localAnswer || "Nenhuma resposta fornecida" }) }) }) }),
|
|
8571
|
+
variant === "result" && currentQuestionResult?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
8495
8572
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(QuizSubTitle, { subTitle: "Observa\xE7\xE3o do professor" }),
|
|
8496
8573
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime39.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." }) })
|
|
8497
8574
|
] })
|
|
8498
8575
|
] });
|
|
8499
8576
|
};
|
|
8500
|
-
var QuizTrueOrFalse = ({
|
|
8501
|
-
variant =
|
|
8502
|
-
paddingBottom
|
|
8503
|
-
}) => {
|
|
8577
|
+
var QuizTrueOrFalse = ({ paddingBottom }) => {
|
|
8578
|
+
const { variant } = useQuizStore();
|
|
8504
8579
|
const options = [
|
|
8505
8580
|
{
|
|
8506
8581
|
label: "25 metros",
|
|
@@ -8560,10 +8635,8 @@ var QuizTrueOrFalse = ({
|
|
|
8560
8635
|
}) }) })
|
|
8561
8636
|
] });
|
|
8562
8637
|
};
|
|
8563
|
-
var QuizConnectDots = ({
|
|
8564
|
-
variant =
|
|
8565
|
-
paddingBottom
|
|
8566
|
-
}) => {
|
|
8638
|
+
var QuizConnectDots = ({ paddingBottom }) => {
|
|
8639
|
+
const { variant } = useQuizStore();
|
|
8567
8640
|
const dotsOptions = [
|
|
8568
8641
|
{ label: "Ra\xE7\xE3o" },
|
|
8569
8642
|
{ label: "Rato" },
|
|
@@ -8689,10 +8762,8 @@ var QuizConnectDots = ({
|
|
|
8689
8762
|
}) }) })
|
|
8690
8763
|
] });
|
|
8691
8764
|
};
|
|
8692
|
-
var QuizFill = ({
|
|
8693
|
-
variant =
|
|
8694
|
-
paddingBottom = "pb-[80px]"
|
|
8695
|
-
}) => {
|
|
8765
|
+
var QuizFill = ({ paddingBottom = "pb-[80px]" }) => {
|
|
8766
|
+
const { variant } = useQuizStore();
|
|
8696
8767
|
const options = [
|
|
8697
8768
|
"ci\xEAncia",
|
|
8698
8769
|
"disciplina",
|
|
@@ -8861,10 +8932,8 @@ var QuizFill = ({
|
|
|
8861
8932
|
] })
|
|
8862
8933
|
] });
|
|
8863
8934
|
};
|
|
8864
|
-
var QuizImageQuestion = ({
|
|
8865
|
-
variant =
|
|
8866
|
-
paddingBottom
|
|
8867
|
-
}) => {
|
|
8935
|
+
var QuizImageQuestion = ({ paddingBottom }) => {
|
|
8936
|
+
const { variant } = useQuizStore();
|
|
8868
8937
|
const correctPositionRelative = { x: 0.48, y: 0.45 };
|
|
8869
8938
|
const calculateCorrectRadiusRelative = () => {
|
|
8870
8939
|
const circleWidthRelative = 0.15;
|
|
@@ -9082,7 +9151,6 @@ var QuizFooter = (0, import_react27.forwardRef)(
|
|
|
9082
9151
|
}, ref) => {
|
|
9083
9152
|
const {
|
|
9084
9153
|
currentQuestionIndex,
|
|
9085
|
-
getUserAnswers,
|
|
9086
9154
|
getTotalQuestions,
|
|
9087
9155
|
goToNextQuestion,
|
|
9088
9156
|
goToPreviousQuestion,
|
|
@@ -9092,7 +9160,7 @@ var QuizFooter = (0, import_react27.forwardRef)(
|
|
|
9092
9160
|
getCurrentQuestion,
|
|
9093
9161
|
getQuestionStatusFromUserAnswers,
|
|
9094
9162
|
variant,
|
|
9095
|
-
|
|
9163
|
+
getQuestionResultStatistics
|
|
9096
9164
|
} = useQuizStore();
|
|
9097
9165
|
const totalQuestions = getTotalQuestions();
|
|
9098
9166
|
const isFirstQuestion = currentQuestionIndex === 0;
|
|
@@ -9106,7 +9174,6 @@ var QuizFooter = (0, import_react27.forwardRef)(
|
|
|
9106
9174
|
const [modalResolutionOpen, setModalResolutionOpen] = (0, import_react27.useState)(false);
|
|
9107
9175
|
const [filterType, setFilterType] = (0, import_react27.useState)("all");
|
|
9108
9176
|
const unansweredQuestions = getUnansweredQuestionsFromUserAnswers();
|
|
9109
|
-
const userAnswers = getUserAnswers();
|
|
9110
9177
|
const allQuestions = getTotalQuestions();
|
|
9111
9178
|
const handleFinishQuiz = async () => {
|
|
9112
9179
|
if (unansweredQuestions.length > 0) {
|
|
@@ -9266,21 +9333,9 @@ var QuizFooter = (0, import_react27.forwardRef)(
|
|
|
9266
9333
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("p", { className: "text-text-500 font-sm", children: [
|
|
9267
9334
|
"Voc\xEA acertou",
|
|
9268
9335
|
" ",
|
|
9269
|
-
(
|
|
9270
|
-
|
|
9271
|
-
if (!activeQuiz) return 0;
|
|
9272
|
-
return userAnswers.filter((answer) => {
|
|
9273
|
-
const question = activeQuiz.quiz.questions.find(
|
|
9274
|
-
(q) => q.id === answer.questionId
|
|
9275
|
-
);
|
|
9276
|
-
const isCorrectOption = question?.options.find(
|
|
9277
|
-
(op) => op.isCorrect
|
|
9278
|
-
);
|
|
9279
|
-
return question && answer.optionId === isCorrectOption?.id;
|
|
9280
|
-
}).length;
|
|
9281
|
-
})(),
|
|
9336
|
+
getQuestionResultStatistics()?.correctAnswers ?? "--",
|
|
9337
|
+
" de",
|
|
9282
9338
|
" ",
|
|
9283
|
-
"de ",
|
|
9284
9339
|
allQuestions,
|
|
9285
9340
|
" quest\xF5es."
|
|
9286
9341
|
] })
|
|
@@ -9337,7 +9392,7 @@ var QuizFooter = (0, import_react27.forwardRef)(
|
|
|
9337
9392
|
onClose: () => setModalResolutionOpen(false),
|
|
9338
9393
|
title: "Resolu\xE7\xE3o",
|
|
9339
9394
|
size: "lg",
|
|
9340
|
-
children: currentQuestion?.
|
|
9395
|
+
children: currentQuestion?.solutionExplanation
|
|
9341
9396
|
}
|
|
9342
9397
|
)
|
|
9343
9398
|
] });
|
|
@@ -9353,7 +9408,7 @@ var QuizResultHeaderTitle = (0, import_react27.forwardRef)(({ className, ...prop
|
|
|
9353
9408
|
...props,
|
|
9354
9409
|
children: [
|
|
9355
9410
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: "Resultado" }),
|
|
9356
|
-
bySimulated && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Badge_default, { variant: "solid", action: "info", children: bySimulated.
|
|
9411
|
+
bySimulated && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Badge_default, { variant: "solid", action: "info", children: bySimulated.type })
|
|
9357
9412
|
]
|
|
9358
9413
|
}
|
|
9359
9414
|
);
|
|
@@ -9377,13 +9432,11 @@ var QuizResultPerformance = (0, import_react27.forwardRef)(
|
|
|
9377
9432
|
getTotalQuestions,
|
|
9378
9433
|
timeElapsed,
|
|
9379
9434
|
formatTime: formatTime2,
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
byQuestionary,
|
|
9383
|
-
getUserAnswerByQuestionId
|
|
9435
|
+
getQuestionResultStatistics,
|
|
9436
|
+
getQuestionResult
|
|
9384
9437
|
} = useQuizStore();
|
|
9385
9438
|
const totalQuestions = getTotalQuestions();
|
|
9386
|
-
const
|
|
9439
|
+
const questionResult = getQuestionResult();
|
|
9387
9440
|
let correctAnswers = 0;
|
|
9388
9441
|
let correctEasyAnswers = 0;
|
|
9389
9442
|
let correctMediumAnswers = 0;
|
|
@@ -9391,24 +9444,23 @@ var QuizResultPerformance = (0, import_react27.forwardRef)(
|
|
|
9391
9444
|
let totalEasyQuestions = 0;
|
|
9392
9445
|
let totalMediumQuestions = 0;
|
|
9393
9446
|
let totalDifficultQuestions = 0;
|
|
9394
|
-
if (
|
|
9395
|
-
|
|
9396
|
-
const
|
|
9397
|
-
const isCorrect = userAnswerItem?.answerStatus == "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */;
|
|
9447
|
+
if (questionResult) {
|
|
9448
|
+
questionResult.answers.forEach((answer) => {
|
|
9449
|
+
const isCorrect = answer.answerStatus == "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */;
|
|
9398
9450
|
if (isCorrect) {
|
|
9399
9451
|
correctAnswers++;
|
|
9400
9452
|
}
|
|
9401
|
-
if (
|
|
9453
|
+
if (answer.difficultyLevel === "FACIL" /* FACIL */) {
|
|
9402
9454
|
totalEasyQuestions++;
|
|
9403
9455
|
if (isCorrect) {
|
|
9404
9456
|
correctEasyAnswers++;
|
|
9405
9457
|
}
|
|
9406
|
-
} else if (
|
|
9458
|
+
} else if (answer.difficultyLevel === "MEDIO" /* MEDIO */) {
|
|
9407
9459
|
totalMediumQuestions++;
|
|
9408
9460
|
if (isCorrect) {
|
|
9409
9461
|
correctMediumAnswers++;
|
|
9410
9462
|
}
|
|
9411
|
-
} else if (
|
|
9463
|
+
} else if (answer.difficultyLevel === "DIFICIL" /* DIFICIL */) {
|
|
9412
9464
|
totalDifficultQuestions++;
|
|
9413
9465
|
if (isCorrect) {
|
|
9414
9466
|
correctDifficultAnswers++;
|
|
@@ -9441,8 +9493,9 @@ var QuizResultPerformance = (0, import_react27.forwardRef)(
|
|
|
9441
9493
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-2xs font-medium text-text-800", children: formatTime2(timeElapsed) })
|
|
9442
9494
|
] }),
|
|
9443
9495
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "text-2xl font-medium text-text-800 leading-7", children: [
|
|
9444
|
-
correctAnswers,
|
|
9445
|
-
" de
|
|
9496
|
+
getQuestionResultStatistics()?.correctAnswers ?? "--",
|
|
9497
|
+
" de",
|
|
9498
|
+
" ",
|
|
9446
9499
|
totalQuestions
|
|
9447
9500
|
] }),
|
|
9448
9501
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "text-2xs font-medium text-text-600 mt-1", children: "Corretas" })
|
|
@@ -9590,6 +9643,7 @@ var QuizListResultByMateria = ({
|
|
|
9590
9643
|
Calendar,
|
|
9591
9644
|
CardAccordation,
|
|
9592
9645
|
CardActivitiesResults,
|
|
9646
|
+
CardAudio,
|
|
9593
9647
|
CardPerformance,
|
|
9594
9648
|
CardProgress,
|
|
9595
9649
|
CardQuestions,
|