analytica-frontend-lib 1.1.14 → 1.1.16
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 +9 -1
- package/dist/Quiz/index.d.ts +9 -1
- package/dist/Quiz/index.js +78 -66
- package/dist/Quiz/index.js.map +1 -1
- package/dist/Quiz/index.mjs +74 -65
- package/dist/Quiz/index.mjs.map +1 -1
- package/dist/Quiz/useQuizStore/index.d.mts +63 -25
- package/dist/Quiz/useQuizStore/index.d.ts +63 -25
- package/dist/Quiz/useQuizStore/index.js +33 -20
- package/dist/Quiz/useQuizStore/index.js.map +1 -1
- package/dist/Quiz/useQuizStore/index.mjs +33 -20
- package/dist/Quiz/useQuizStore/index.mjs.map +1 -1
- package/dist/index.css +6 -3
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +107 -64
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +103 -64
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +6 -3
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -43,7 +43,7 @@ export { createZustandAuthAdapter } from './Auth/zustandAuthAdapter/index.mjs';
|
|
|
43
43
|
export { useUrlAuthentication } from './Auth/useUrlAuthentication/index.mjs';
|
|
44
44
|
export { useApiConfig } from './Auth/useApiConfig/index.mjs';
|
|
45
45
|
export { Quiz, QuizAlternative, QuizConnectDots, QuizContent, QuizDissertative, QuizFooter, QuizHeader, QuizHeaderResult, QuizImageQuestion, QuizListResult, QuizListResultByMateria, QuizMultipleChoice, QuizQuestionList, QuizResultHeaderTitle, QuizResultPerformance, QuizResultTitle, QuizTitle, QuizTrueOrFalse, getStatusBadge } from './Quiz/index.mjs';
|
|
46
|
-
export { useQuizStore } from './Quiz/useQuizStore/index.mjs';
|
|
46
|
+
export { ANSWER_STATUS, Activity, Lesson, QUESTION_DIFFICULTY, QUESTION_STATUS, QUESTION_TYPE, Question, QuestionResult, QuizState, Simulated, UserAnswerItem, useQuizStore } from './Quiz/useQuizStore/index.mjs';
|
|
47
47
|
import 'react/jsx-runtime';
|
|
48
48
|
|
|
49
49
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export { createZustandAuthAdapter } from './Auth/zustandAuthAdapter/index.js';
|
|
|
43
43
|
export { useUrlAuthentication } from './Auth/useUrlAuthentication/index.js';
|
|
44
44
|
export { useApiConfig } from './Auth/useApiConfig/index.js';
|
|
45
45
|
export { Quiz, QuizAlternative, QuizConnectDots, QuizContent, QuizDissertative, QuizFooter, QuizHeader, QuizHeaderResult, QuizImageQuestion, QuizListResult, QuizListResultByMateria, QuizMultipleChoice, QuizQuestionList, QuizResultHeaderTitle, QuizResultPerformance, QuizResultTitle, QuizTitle, QuizTrueOrFalse, getStatusBadge } from './Quiz/index.js';
|
|
46
|
-
export { useQuizStore } from './Quiz/useQuizStore/index.js';
|
|
46
|
+
export { ANSWER_STATUS, Activity, Lesson, QUESTION_DIFFICULTY, QUESTION_STATUS, QUESTION_TYPE, Question, QuestionResult, QuizState, Simulated, UserAnswerItem, useQuizStore } from './Quiz/useQuizStore/index.js';
|
|
47
47
|
import 'react/jsx-runtime';
|
|
48
48
|
|
|
49
49
|
/**
|
package/dist/index.js
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var src_exports = {};
|
|
32
32
|
__export(src_exports, {
|
|
33
|
+
ANSWER_STATUS: () => ANSWER_STATUS,
|
|
33
34
|
Alert: () => Alert_default,
|
|
34
35
|
AlertDialog: () => AlertDialog,
|
|
35
36
|
AlternativesList: () => AlternativesList,
|
|
@@ -80,6 +81,9 @@ __export(src_exports, {
|
|
|
80
81
|
ProgressCircle: () => ProgressCircle_default,
|
|
81
82
|
ProtectedRoute: () => ProtectedRoute,
|
|
82
83
|
PublicRoute: () => PublicRoute,
|
|
84
|
+
QUESTION_DIFFICULTY: () => QUESTION_DIFFICULTY,
|
|
85
|
+
QUESTION_STATUS: () => QUESTION_STATUS,
|
|
86
|
+
QUESTION_TYPE: () => QUESTION_TYPE,
|
|
83
87
|
Quiz: () => Quiz,
|
|
84
88
|
QuizAlternative: () => QuizAlternative,
|
|
85
89
|
QuizConnectDots: () => QuizConnectDots,
|
|
@@ -7939,6 +7943,35 @@ var import_react27 = require("react");
|
|
|
7939
7943
|
// src/components/Quiz/useQuizStore.ts
|
|
7940
7944
|
var import_zustand7 = require("zustand");
|
|
7941
7945
|
var import_middleware = require("zustand/middleware");
|
|
7946
|
+
var QUESTION_DIFFICULTY = /* @__PURE__ */ ((QUESTION_DIFFICULTY2) => {
|
|
7947
|
+
QUESTION_DIFFICULTY2["FACIL"] = "FACIL";
|
|
7948
|
+
QUESTION_DIFFICULTY2["MEDIO"] = "MEDIO";
|
|
7949
|
+
QUESTION_DIFFICULTY2["DIFICIL"] = "DIFICIL";
|
|
7950
|
+
return QUESTION_DIFFICULTY2;
|
|
7951
|
+
})(QUESTION_DIFFICULTY || {});
|
|
7952
|
+
var QUESTION_TYPE = /* @__PURE__ */ ((QUESTION_TYPE2) => {
|
|
7953
|
+
QUESTION_TYPE2["ALTERNATIVA"] = "ALTERNATIVA";
|
|
7954
|
+
QUESTION_TYPE2["DISSERTATIVA"] = "DISSERTATIVA";
|
|
7955
|
+
QUESTION_TYPE2["MULTIPLA_CHOICE"] = "MULTIPLA_CHOICE";
|
|
7956
|
+
QUESTION_TYPE2["VERDADEIRO_FALSO"] = "VERDADEIRO_FALSO";
|
|
7957
|
+
QUESTION_TYPE2["LIGAR_PONTOS"] = "LIGAR_PONTOS";
|
|
7958
|
+
QUESTION_TYPE2["PREENCHER"] = "PREENCHER";
|
|
7959
|
+
QUESTION_TYPE2["IMAGEM"] = "IMAGEM";
|
|
7960
|
+
return QUESTION_TYPE2;
|
|
7961
|
+
})(QUESTION_TYPE || {});
|
|
7962
|
+
var QUESTION_STATUS = /* @__PURE__ */ ((QUESTION_STATUS2) => {
|
|
7963
|
+
QUESTION_STATUS2["PENDENTE_AVALIACAO"] = "PENDENTE_AVALIACAO";
|
|
7964
|
+
QUESTION_STATUS2["RESPOSTA_CORRETA"] = "RESPOSTA_CORRETA";
|
|
7965
|
+
QUESTION_STATUS2["RESPOSTA_INCORRETA"] = "RESPOSTA_INCORRETA";
|
|
7966
|
+
QUESTION_STATUS2["NAO_RESPONDIDO"] = "NAO_RESPONDIDO";
|
|
7967
|
+
return QUESTION_STATUS2;
|
|
7968
|
+
})(QUESTION_STATUS || {});
|
|
7969
|
+
var ANSWER_STATUS = /* @__PURE__ */ ((ANSWER_STATUS2) => {
|
|
7970
|
+
ANSWER_STATUS2["RESPOSTA_CORRETA"] = "RESPOSTA_CORRETA";
|
|
7971
|
+
ANSWER_STATUS2["RESPOSTA_INCORRETA"] = "RESPOSTA_INCORRETA";
|
|
7972
|
+
ANSWER_STATUS2["PENDENTE_AVALIACAO"] = "PENDENTE_AVALIACAO";
|
|
7973
|
+
return ANSWER_STATUS2;
|
|
7974
|
+
})(ANSWER_STATUS || {});
|
|
7942
7975
|
var useQuizStore = (0, import_zustand7.create)()(
|
|
7943
7976
|
(0, import_middleware.devtools)(
|
|
7944
7977
|
(set, get) => {
|
|
@@ -7974,9 +8007,9 @@ var useQuizStore = (0, import_zustand7.create)()(
|
|
|
7974
8007
|
questionsResult: null,
|
|
7975
8008
|
currentQuestionResult: null,
|
|
7976
8009
|
// Setters
|
|
7977
|
-
setBySimulated: (
|
|
7978
|
-
setByActivity: (
|
|
7979
|
-
setByQuestionary: (
|
|
8010
|
+
setBySimulated: (simulated) => set({ bySimulated: simulated }),
|
|
8011
|
+
setByActivity: (activity) => set({ byActivity: activity }),
|
|
8012
|
+
setByQuestionary: (lesson) => set({ byQuestionary: lesson }),
|
|
7980
8013
|
setUserId: (userId) => set({ userId }),
|
|
7981
8014
|
setUserAnswers: (userAnswers) => set({ userAnswers }),
|
|
7982
8015
|
getUserId: () => get().userId,
|
|
@@ -8342,12 +8375,12 @@ var useQuizStore = (0, import_zustand7.create)()(
|
|
|
8342
8375
|
return unansweredQuestions;
|
|
8343
8376
|
},
|
|
8344
8377
|
getQuestionsGroupedBySubject: () => {
|
|
8345
|
-
const { getActiveQuiz } = get();
|
|
8346
|
-
const
|
|
8347
|
-
if (!
|
|
8378
|
+
const { getQuestionResult, getActiveQuiz, variant } = get();
|
|
8379
|
+
const questions = variant == "result" ? getQuestionResult()?.answers : getActiveQuiz()?.quiz.questions;
|
|
8380
|
+
if (!questions) return {};
|
|
8348
8381
|
const groupedQuestions = {};
|
|
8349
|
-
|
|
8350
|
-
const subjectId = question.knowledgeMatrix?.[0]?.
|
|
8382
|
+
questions.forEach((question) => {
|
|
8383
|
+
const subjectId = question.knowledgeMatrix?.[0]?.subject?.id || "Sem mat\xE9ria";
|
|
8351
8384
|
if (!groupedQuestions[subjectId]) {
|
|
8352
8385
|
groupedQuestions[subjectId] = [];
|
|
8353
8386
|
}
|
|
@@ -8381,12 +8414,22 @@ var useQuizStore = (0, import_zustand7.create)()(
|
|
|
8381
8414
|
return userAnswers;
|
|
8382
8415
|
},
|
|
8383
8416
|
setCurrentQuestion: (question) => {
|
|
8384
|
-
const { getActiveQuiz } = get();
|
|
8417
|
+
const { getActiveQuiz, variant, questionsResult } = get();
|
|
8385
8418
|
const activeQuiz = getActiveQuiz();
|
|
8386
8419
|
if (!activeQuiz) return;
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
|
|
8420
|
+
let questionIndex = 0;
|
|
8421
|
+
if (variant == "result") {
|
|
8422
|
+
if (!questionsResult) return;
|
|
8423
|
+
const questionResult = questionsResult.answers.find((q) => q.id === question.id) ?? questionsResult.answers.find((q) => q.questionId === question.id);
|
|
8424
|
+
if (!questionResult) return;
|
|
8425
|
+
questionIndex = activeQuiz.quiz.questions.findIndex(
|
|
8426
|
+
(q) => q.id === questionResult.questionId
|
|
8427
|
+
);
|
|
8428
|
+
} else {
|
|
8429
|
+
questionIndex = activeQuiz.quiz.questions.findIndex(
|
|
8430
|
+
(q) => q.id === question.id
|
|
8431
|
+
);
|
|
8432
|
+
}
|
|
8390
8433
|
if (questionIndex === -1) {
|
|
8391
8434
|
console.warn(
|
|
8392
8435
|
`Question with id "${question.id}" not found in active quiz`
|
|
@@ -8417,20 +8460,23 @@ var useQuizStore = (0, import_zustand7.create)()(
|
|
|
8417
8460
|
return userAnswer ? userAnswer.answerStatus : null;
|
|
8418
8461
|
},
|
|
8419
8462
|
getQuestionIndex: (questionId) => {
|
|
8420
|
-
const {
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
(q) => q.id === questionId
|
|
8463
|
+
const { questionsResult } = get();
|
|
8464
|
+
if (!questionsResult) return 0;
|
|
8465
|
+
let idx = questionsResult.answers.findIndex(
|
|
8466
|
+
(q) => q.questionId === questionId
|
|
8425
8467
|
);
|
|
8426
|
-
|
|
8468
|
+
if (idx === -1) {
|
|
8469
|
+
idx = questionsResult.answers.findIndex((q) => q.id === questionId);
|
|
8470
|
+
}
|
|
8471
|
+
return idx !== -1 ? idx + 1 : 0;
|
|
8427
8472
|
},
|
|
8428
8473
|
// Question Result
|
|
8429
8474
|
getQuestionResultByQuestionId: (questionId) => {
|
|
8430
8475
|
const { questionsResult } = get();
|
|
8431
|
-
|
|
8476
|
+
const question = questionsResult?.answers.find(
|
|
8432
8477
|
(answer) => answer.questionId === questionId
|
|
8433
|
-
)
|
|
8478
|
+
);
|
|
8479
|
+
return question || null;
|
|
8434
8480
|
},
|
|
8435
8481
|
getQuestionResultStatistics: () => {
|
|
8436
8482
|
const { questionsResult } = get();
|
|
@@ -8581,8 +8627,8 @@ var QuizHeader = () => {
|
|
|
8581
8627
|
HeaderAlternative,
|
|
8582
8628
|
{
|
|
8583
8629
|
title: currentQuestion ? `Quest\xE3o ${currentQuestionIndex + 1}` : "Quest\xE3o",
|
|
8584
|
-
subTitle: currentQuestion?.knowledgeMatrix?.[0]?.
|
|
8585
|
-
content: currentQuestion?.
|
|
8630
|
+
subTitle: currentQuestion?.knowledgeMatrix?.[0]?.topic?.name ?? "",
|
|
8631
|
+
content: currentQuestion?.statement ?? ""
|
|
8586
8632
|
}
|
|
8587
8633
|
);
|
|
8588
8634
|
};
|
|
@@ -8631,10 +8677,10 @@ var QuizAlternative = ({ paddingBottom }) => {
|
|
|
8631
8677
|
const alternatives = currentQuestion?.options?.map((option) => {
|
|
8632
8678
|
let status = "neutral" /* NEUTRAL */;
|
|
8633
8679
|
if (variant === "result") {
|
|
8634
|
-
const isCorrectOption =
|
|
8635
|
-
|
|
8680
|
+
const isCorrectOption = currentQuestionResult?.options?.find((op) => op.id === option.id)?.isCorrect || false;
|
|
8681
|
+
const isSelected = currentQuestionResult?.selectedOptions.some(
|
|
8682
|
+
(selectedOption) => selectedOption.optionId === option.id
|
|
8636
8683
|
);
|
|
8637
|
-
const isSelected = currentQuestionResult?.optionId === option.id;
|
|
8638
8684
|
if (isCorrectOption) {
|
|
8639
8685
|
status = "correct" /* CORRECT */;
|
|
8640
8686
|
} else if (isSelected && !isCorrectOption) {
|
|
@@ -8660,8 +8706,8 @@ var QuizAlternative = ({ paddingBottom }) => {
|
|
|
8660
8706
|
name: `question-${currentQuestion?.id || "1"}`,
|
|
8661
8707
|
layout: "compact",
|
|
8662
8708
|
alternatives,
|
|
8663
|
-
value: variant === "result" ? currentQuestionResult?.optionId || "" : currentAnswer?.optionId || "",
|
|
8664
|
-
selectedValue: variant === "result" ? currentQuestionResult?.optionId || "" : currentAnswer?.optionId || "",
|
|
8709
|
+
value: variant === "result" ? currentQuestionResult?.selectedOptions[0]?.optionId || "" : currentAnswer?.optionId || "",
|
|
8710
|
+
selectedValue: variant === "result" ? currentQuestionResult?.selectedOptions[0]?.optionId || "" : currentAnswer?.optionId || "",
|
|
8665
8711
|
onValueChange: (value) => {
|
|
8666
8712
|
if (currentQuestion) {
|
|
8667
8713
|
selectAnswer(currentQuestion.id, value);
|
|
@@ -8706,15 +8752,16 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
8706
8752
|
prevSelectedValuesRef.current = selectedValues;
|
|
8707
8753
|
return selectedValues;
|
|
8708
8754
|
}
|
|
8709
|
-
if (variant == "result"
|
|
8710
|
-
return currentQuestionResult?.
|
|
8755
|
+
if (variant == "result") {
|
|
8756
|
+
return currentQuestionResult?.selectedOptions.map((op) => op.optionId) || [];
|
|
8757
|
+
} else {
|
|
8758
|
+
return prevSelectedValuesRef.current;
|
|
8711
8759
|
}
|
|
8712
|
-
return prevSelectedValuesRef.current;
|
|
8713
8760
|
}, [
|
|
8714
8761
|
selectedValues,
|
|
8715
8762
|
currentQuestion?.id,
|
|
8716
8763
|
variant,
|
|
8717
|
-
currentQuestionResult?.
|
|
8764
|
+
currentQuestionResult?.selectedOptions
|
|
8718
8765
|
]);
|
|
8719
8766
|
const handleSelectedValues = (0, import_react27.useCallback)(
|
|
8720
8767
|
(values) => {
|
|
@@ -8731,11 +8778,9 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
8731
8778
|
const choices = currentQuestion?.options?.map((option) => {
|
|
8732
8779
|
let status = "neutral" /* NEUTRAL */;
|
|
8733
8780
|
if (variant === "result") {
|
|
8734
|
-
const isCorrectOption =
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
const isSelected = currentQuestionResult?.options.find(
|
|
8738
|
-
(op) => op.id === option.id
|
|
8781
|
+
const isCorrectOption = currentQuestionResult?.options?.find((op) => op.id === option.id)?.isCorrect || false;
|
|
8782
|
+
const isSelected = currentQuestionResult?.selectedOptions?.some(
|
|
8783
|
+
(op) => op.optionId === option.id
|
|
8739
8784
|
);
|
|
8740
8785
|
if (isCorrectOption) {
|
|
8741
8786
|
status = "correct" /* CORRECT */;
|
|
@@ -9011,7 +9056,7 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
9011
9056
|
}) }) })
|
|
9012
9057
|
] });
|
|
9013
9058
|
};
|
|
9014
|
-
var QuizFill = ({ paddingBottom
|
|
9059
|
+
var QuizFill = ({ paddingBottom }) => {
|
|
9015
9060
|
const { variant } = useQuizStore();
|
|
9016
9061
|
const options = [
|
|
9017
9062
|
"ci\xEAncia",
|
|
@@ -9369,7 +9414,7 @@ var QuizQuestionList = ({
|
|
|
9369
9414
|
([subjectId, questions]) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("section", { className: "flex flex-col gap-2", children: [
|
|
9370
9415
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("span", { className: "pt-6 pb-4 flex flex-row gap-2", children: [
|
|
9371
9416
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "bg-primary-500 p-1 rounded-sm flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_phosphor_react20.BookOpen, { size: 17, className: "text-white" }) }),
|
|
9372
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "text-text-800 font-bold text-lg", children:
|
|
9417
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "text-text-800 font-bold text-lg", children: questions?.[0]?.knowledgeMatrix?.[0]?.subject?.name ?? "Sem mat\xE9ria" })
|
|
9373
9418
|
] }),
|
|
9374
9419
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("ul", { className: "flex flex-col gap-2", children: questions.map((question) => {
|
|
9375
9420
|
const status = getQuestionStatus(question.id);
|
|
@@ -9800,28 +9845,24 @@ var QuizResultPerformance = (0, import_react27.forwardRef)(
|
|
|
9800
9845
|
}
|
|
9801
9846
|
);
|
|
9802
9847
|
var QuizListResult = (0, import_react27.forwardRef)(({ className, onSubjectClick, ...props }, ref) => {
|
|
9803
|
-
const {
|
|
9804
|
-
getQuestionsGroupedBySubject,
|
|
9805
|
-
isQuestionAnswered,
|
|
9806
|
-
getUserAnswerByQuestionId
|
|
9807
|
-
} = useQuizStore();
|
|
9848
|
+
const { getQuestionsGroupedBySubject } = useQuizStore();
|
|
9808
9849
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
9809
9850
|
const subjectsStats = Object.entries(groupedQuestions).map(
|
|
9810
9851
|
([subjectId, questions]) => {
|
|
9811
9852
|
let correct = 0;
|
|
9812
9853
|
let incorrect = 0;
|
|
9813
9854
|
questions.forEach((question) => {
|
|
9814
|
-
if (
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
} else {
|
|
9819
|
-
incorrect++;
|
|
9820
|
-
}
|
|
9855
|
+
if (question.answerStatus == "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */) {
|
|
9856
|
+
correct++;
|
|
9857
|
+
} else {
|
|
9858
|
+
incorrect++;
|
|
9821
9859
|
}
|
|
9822
9860
|
});
|
|
9823
9861
|
return {
|
|
9824
|
-
subject:
|
|
9862
|
+
subject: {
|
|
9863
|
+
name: questions?.[0]?.knowledgeMatrix?.[0]?.subject?.name ?? "Sem mat\xE9ria",
|
|
9864
|
+
id: subjectId
|
|
9865
|
+
},
|
|
9825
9866
|
correct,
|
|
9826
9867
|
incorrect,
|
|
9827
9868
|
total: questions.length
|
|
@@ -9833,44 +9874,42 @@ var QuizListResult = (0, import_react27.forwardRef)(({ className, onSubjectClick
|
|
|
9833
9874
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("ul", { className: "flex flex-col gap-2", children: subjectsStats.map((subject) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
9834
9875
|
CardResults,
|
|
9835
9876
|
{
|
|
9836
|
-
onClick: () => onSubjectClick?.(subject.subject),
|
|
9877
|
+
onClick: () => onSubjectClick?.(subject.subject.id),
|
|
9837
9878
|
className: "max-w-full",
|
|
9838
|
-
header: subject.subject,
|
|
9879
|
+
header: subject.subject.name,
|
|
9839
9880
|
correct_answers: subject.correct,
|
|
9840
9881
|
incorrect_answers: subject.incorrect,
|
|
9841
9882
|
icon: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_phosphor_react20.Book, { size: 20 }),
|
|
9842
9883
|
direction: "row"
|
|
9843
9884
|
}
|
|
9844
|
-
) }, subject.subject)) })
|
|
9885
|
+
) }, subject.subject.id)) })
|
|
9845
9886
|
] });
|
|
9846
9887
|
});
|
|
9847
9888
|
var QuizListResultByMateria = ({
|
|
9848
9889
|
subject,
|
|
9849
9890
|
onQuestionClick
|
|
9850
9891
|
}) => {
|
|
9851
|
-
const {
|
|
9852
|
-
getQuestionsGroupedBySubject,
|
|
9853
|
-
getUserAnswerByQuestionId,
|
|
9854
|
-
getQuestionIndex
|
|
9855
|
-
} = useQuizStore();
|
|
9892
|
+
const { getQuestionsGroupedBySubject, getQuestionIndex } = useQuizStore();
|
|
9856
9893
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
9857
9894
|
const answeredQuestions = groupedQuestions[subject] || [];
|
|
9858
9895
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "w-full max-w-[1000px] flex flex-col mx-auto h-full relative not-lg:px-6", children: [
|
|
9859
|
-
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "flex flex-row pt-4 justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: subject }) }),
|
|
9896
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "flex flex-row pt-4 justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: answeredQuestions?.[0]?.knowledgeMatrix?.[0]?.subject?.name ?? "Sem mat\xE9ria" }) }),
|
|
9860
9897
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("section", { className: "flex flex-col ", children: [
|
|
9861
9898
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Resultado das quest\xF5es" }),
|
|
9862
9899
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("ul", { className: "flex flex-col gap-2 pt-4", children: answeredQuestions.map((question) => {
|
|
9863
|
-
const questionIndex = getQuestionIndex(
|
|
9900
|
+
const questionIndex = getQuestionIndex(
|
|
9901
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9902
|
+
question.questionId ?? question.id
|
|
9903
|
+
);
|
|
9864
9904
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
9865
9905
|
CardStatus,
|
|
9866
9906
|
{
|
|
9867
9907
|
className: "max-w-full",
|
|
9868
9908
|
header: `Quest\xE3o ${questionIndex.toString().padStart(2, "0")}`,
|
|
9869
9909
|
status: (() => {
|
|
9870
|
-
|
|
9871
|
-
if (userAnswer?.answerStatus === "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */)
|
|
9910
|
+
if (question.answerStatus === "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */)
|
|
9872
9911
|
return "correct";
|
|
9873
|
-
if (
|
|
9912
|
+
if (question.answerStatus === "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */)
|
|
9874
9913
|
return "incorrect";
|
|
9875
9914
|
return void 0;
|
|
9876
9915
|
})(),
|
|
@@ -9883,6 +9922,7 @@ var QuizListResultByMateria = ({
|
|
|
9883
9922
|
};
|
|
9884
9923
|
// Annotate the CommonJS export names for ESM import in node:
|
|
9885
9924
|
0 && (module.exports = {
|
|
9925
|
+
ANSWER_STATUS,
|
|
9886
9926
|
Alert,
|
|
9887
9927
|
AlertDialog,
|
|
9888
9928
|
AlternativesList,
|
|
@@ -9933,6 +9973,9 @@ var QuizListResultByMateria = ({
|
|
|
9933
9973
|
ProgressCircle,
|
|
9934
9974
|
ProtectedRoute,
|
|
9935
9975
|
PublicRoute,
|
|
9976
|
+
QUESTION_DIFFICULTY,
|
|
9977
|
+
QUESTION_STATUS,
|
|
9978
|
+
QUESTION_TYPE,
|
|
9936
9979
|
Quiz,
|
|
9937
9980
|
QuizAlternative,
|
|
9938
9981
|
QuizConnectDots,
|