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/Quiz/index.d.mts
CHANGED
|
@@ -5,6 +5,7 @@ import { Question } from './useQuizStore/index.mjs';
|
|
|
5
5
|
import 'zustand';
|
|
6
6
|
|
|
7
7
|
declare const getStatusBadge: (status?: "correct" | "incorrect") => react_jsx_runtime.JSX.Element | null;
|
|
8
|
+
declare const getStatusStyles: (variantCorrect?: string) => "bg-success-background border-success-300" | "bg-error-background border-error-300" | undefined;
|
|
8
9
|
declare const Quiz: react.ForwardRefExoticComponent<{
|
|
9
10
|
children: ReactNode;
|
|
10
11
|
className?: string;
|
|
@@ -16,7 +17,14 @@ declare const QuizHeaderResult: react.ForwardRefExoticComponent<{
|
|
|
16
17
|
declare const QuizTitle: react.ForwardRefExoticComponent<{
|
|
17
18
|
className?: string;
|
|
18
19
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare const QuizSubTitle: react.ForwardRefExoticComponent<{
|
|
21
|
+
subTitle: string;
|
|
22
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
19
23
|
declare const QuizHeader: () => react_jsx_runtime.JSX.Element;
|
|
24
|
+
declare const QuizContainer: react.ForwardRefExoticComponent<{
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
20
28
|
declare const QuizContent: react.ForwardRefExoticComponent<{
|
|
21
29
|
paddingBottom?: string;
|
|
22
30
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
@@ -56,4 +64,4 @@ declare const QuizListResultByMateria: ({ subject, onQuestionClick, }: {
|
|
|
56
64
|
onQuestionClick: (question: Question) => void;
|
|
57
65
|
}) => react_jsx_runtime.JSX.Element;
|
|
58
66
|
|
|
59
|
-
export { Quiz, QuizAlternative, QuizConnectDots, QuizContent, QuizDissertative, QuizFill, QuizFooter, QuizHeader, QuizHeaderResult, QuizImageQuestion, QuizListResult, QuizListResultByMateria, QuizMultipleChoice, QuizQuestionList, QuizResultHeaderTitle, QuizResultPerformance, QuizResultTitle, QuizTitle, QuizTrueOrFalse, getStatusBadge };
|
|
67
|
+
export { Quiz, QuizAlternative, QuizConnectDots, QuizContainer, QuizContent, QuizDissertative, QuizFill, QuizFooter, QuizHeader, QuizHeaderResult, QuizImageQuestion, QuizListResult, QuizListResultByMateria, QuizMultipleChoice, QuizQuestionList, QuizResultHeaderTitle, QuizResultPerformance, QuizResultTitle, QuizSubTitle, QuizTitle, QuizTrueOrFalse, getStatusBadge, getStatusStyles };
|
package/dist/Quiz/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Question } from './useQuizStore/index.js';
|
|
|
5
5
|
import 'zustand';
|
|
6
6
|
|
|
7
7
|
declare const getStatusBadge: (status?: "correct" | "incorrect") => react_jsx_runtime.JSX.Element | null;
|
|
8
|
+
declare const getStatusStyles: (variantCorrect?: string) => "bg-success-background border-success-300" | "bg-error-background border-error-300" | undefined;
|
|
8
9
|
declare const Quiz: react.ForwardRefExoticComponent<{
|
|
9
10
|
children: ReactNode;
|
|
10
11
|
className?: string;
|
|
@@ -16,7 +17,14 @@ declare const QuizHeaderResult: react.ForwardRefExoticComponent<{
|
|
|
16
17
|
declare const QuizTitle: react.ForwardRefExoticComponent<{
|
|
17
18
|
className?: string;
|
|
18
19
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare const QuizSubTitle: react.ForwardRefExoticComponent<{
|
|
21
|
+
subTitle: string;
|
|
22
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
19
23
|
declare const QuizHeader: () => react_jsx_runtime.JSX.Element;
|
|
24
|
+
declare const QuizContainer: react.ForwardRefExoticComponent<{
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
20
28
|
declare const QuizContent: react.ForwardRefExoticComponent<{
|
|
21
29
|
paddingBottom?: string;
|
|
22
30
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
@@ -56,4 +64,4 @@ declare const QuizListResultByMateria: ({ subject, onQuestionClick, }: {
|
|
|
56
64
|
onQuestionClick: (question: Question) => void;
|
|
57
65
|
}) => react_jsx_runtime.JSX.Element;
|
|
58
66
|
|
|
59
|
-
export { Quiz, QuizAlternative, QuizConnectDots, QuizContent, QuizDissertative, QuizFill, QuizFooter, QuizHeader, QuizHeaderResult, QuizImageQuestion, QuizListResult, QuizListResultByMateria, QuizMultipleChoice, QuizQuestionList, QuizResultHeaderTitle, QuizResultPerformance, QuizResultTitle, QuizTitle, QuizTrueOrFalse, getStatusBadge };
|
|
67
|
+
export { Quiz, QuizAlternative, QuizConnectDots, QuizContainer, QuizContent, QuizDissertative, QuizFill, QuizFooter, QuizHeader, QuizHeaderResult, QuizImageQuestion, QuizListResult, QuizListResultByMateria, QuizMultipleChoice, QuizQuestionList, QuizResultHeaderTitle, QuizResultPerformance, QuizResultTitle, QuizSubTitle, QuizTitle, QuizTrueOrFalse, getStatusBadge, getStatusStyles };
|
package/dist/Quiz/index.js
CHANGED
|
@@ -23,6 +23,7 @@ __export(Quiz_exports, {
|
|
|
23
23
|
Quiz: () => Quiz,
|
|
24
24
|
QuizAlternative: () => QuizAlternative,
|
|
25
25
|
QuizConnectDots: () => QuizConnectDots,
|
|
26
|
+
QuizContainer: () => QuizContainer,
|
|
26
27
|
QuizContent: () => QuizContent,
|
|
27
28
|
QuizDissertative: () => QuizDissertative,
|
|
28
29
|
QuizFill: () => QuizFill,
|
|
@@ -37,9 +38,11 @@ __export(Quiz_exports, {
|
|
|
37
38
|
QuizResultHeaderTitle: () => QuizResultHeaderTitle,
|
|
38
39
|
QuizResultPerformance: () => QuizResultPerformance,
|
|
39
40
|
QuizResultTitle: () => QuizResultTitle,
|
|
41
|
+
QuizSubTitle: () => QuizSubTitle,
|
|
40
42
|
QuizTitle: () => QuizTitle,
|
|
41
43
|
QuizTrueOrFalse: () => QuizTrueOrFalse,
|
|
42
|
-
getStatusBadge: () => getStatusBadge
|
|
44
|
+
getStatusBadge: () => getStatusBadge,
|
|
45
|
+
getStatusStyles: () => getStatusStyles
|
|
43
46
|
});
|
|
44
47
|
module.exports = __toCommonJS(Quiz_exports);
|
|
45
48
|
var import_phosphor_react9 = require("phosphor-react");
|
|
@@ -998,9 +1001,9 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
998
1001
|
questionsResult: null,
|
|
999
1002
|
currentQuestionResult: null,
|
|
1000
1003
|
// Setters
|
|
1001
|
-
setBySimulated: (
|
|
1002
|
-
setByActivity: (
|
|
1003
|
-
setByQuestionary: (
|
|
1004
|
+
setBySimulated: (simulated) => set({ bySimulated: simulated }),
|
|
1005
|
+
setByActivity: (activity) => set({ byActivity: activity }),
|
|
1006
|
+
setByQuestionary: (lesson) => set({ byQuestionary: lesson }),
|
|
1004
1007
|
setUserId: (userId) => set({ userId }),
|
|
1005
1008
|
setUserAnswers: (userAnswers) => set({ userAnswers }),
|
|
1006
1009
|
getUserId: () => get().userId,
|
|
@@ -1366,12 +1369,12 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
1366
1369
|
return unansweredQuestions;
|
|
1367
1370
|
},
|
|
1368
1371
|
getQuestionsGroupedBySubject: () => {
|
|
1369
|
-
const { getActiveQuiz } = get();
|
|
1370
|
-
const
|
|
1371
|
-
if (!
|
|
1372
|
+
const { getQuestionResult, getActiveQuiz, variant } = get();
|
|
1373
|
+
const questions = variant == "result" ? getQuestionResult()?.answers : getActiveQuiz()?.quiz.questions;
|
|
1374
|
+
if (!questions) return {};
|
|
1372
1375
|
const groupedQuestions = {};
|
|
1373
|
-
|
|
1374
|
-
const subjectId = question.knowledgeMatrix?.[0]?.
|
|
1376
|
+
questions.forEach((question) => {
|
|
1377
|
+
const subjectId = question.knowledgeMatrix?.[0]?.subject?.id || "Sem mat\xE9ria";
|
|
1375
1378
|
if (!groupedQuestions[subjectId]) {
|
|
1376
1379
|
groupedQuestions[subjectId] = [];
|
|
1377
1380
|
}
|
|
@@ -1405,12 +1408,22 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
1405
1408
|
return userAnswers;
|
|
1406
1409
|
},
|
|
1407
1410
|
setCurrentQuestion: (question) => {
|
|
1408
|
-
const { getActiveQuiz } = get();
|
|
1411
|
+
const { getActiveQuiz, variant, questionsResult } = get();
|
|
1409
1412
|
const activeQuiz = getActiveQuiz();
|
|
1410
1413
|
if (!activeQuiz) return;
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
+
let questionIndex = 0;
|
|
1415
|
+
if (variant == "result") {
|
|
1416
|
+
if (!questionsResult) return;
|
|
1417
|
+
const questionResult = questionsResult.answers.find((q) => q.id === question.id) ?? questionsResult.answers.find((q) => q.questionId === question.id);
|
|
1418
|
+
if (!questionResult) return;
|
|
1419
|
+
questionIndex = activeQuiz.quiz.questions.findIndex(
|
|
1420
|
+
(q) => q.id === questionResult.questionId
|
|
1421
|
+
);
|
|
1422
|
+
} else {
|
|
1423
|
+
questionIndex = activeQuiz.quiz.questions.findIndex(
|
|
1424
|
+
(q) => q.id === question.id
|
|
1425
|
+
);
|
|
1426
|
+
}
|
|
1414
1427
|
if (questionIndex === -1) {
|
|
1415
1428
|
console.warn(
|
|
1416
1429
|
`Question with id "${question.id}" not found in active quiz`
|
|
@@ -1441,20 +1454,23 @@ var useQuizStore = (0, import_zustand2.create)()(
|
|
|
1441
1454
|
return userAnswer ? userAnswer.answerStatus : null;
|
|
1442
1455
|
},
|
|
1443
1456
|
getQuestionIndex: (questionId) => {
|
|
1444
|
-
const {
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
(q) => q.id === questionId
|
|
1457
|
+
const { questionsResult } = get();
|
|
1458
|
+
if (!questionsResult) return 0;
|
|
1459
|
+
let idx = questionsResult.answers.findIndex(
|
|
1460
|
+
(q) => q.questionId === questionId
|
|
1449
1461
|
);
|
|
1450
|
-
|
|
1462
|
+
if (idx === -1) {
|
|
1463
|
+
idx = questionsResult.answers.findIndex((q) => q.id === questionId);
|
|
1464
|
+
}
|
|
1465
|
+
return idx !== -1 ? idx + 1 : 0;
|
|
1451
1466
|
},
|
|
1452
1467
|
// Question Result
|
|
1453
1468
|
getQuestionResultByQuestionId: (questionId) => {
|
|
1454
1469
|
const { questionsResult } = get();
|
|
1455
|
-
|
|
1470
|
+
const question = questionsResult?.answers.find(
|
|
1456
1471
|
(answer) => answer.questionId === questionId
|
|
1457
|
-
)
|
|
1472
|
+
);
|
|
1473
|
+
return question || null;
|
|
1458
1474
|
},
|
|
1459
1475
|
getQuestionResultStatistics: () => {
|
|
1460
1476
|
const { questionsResult } = get();
|
|
@@ -4664,8 +4680,8 @@ var QuizHeader = () => {
|
|
|
4664
4680
|
HeaderAlternative,
|
|
4665
4681
|
{
|
|
4666
4682
|
title: currentQuestion ? `Quest\xE3o ${currentQuestionIndex + 1}` : "Quest\xE3o",
|
|
4667
|
-
subTitle: currentQuestion?.knowledgeMatrix?.[0]?.
|
|
4668
|
-
content: currentQuestion?.
|
|
4683
|
+
subTitle: currentQuestion?.knowledgeMatrix?.[0]?.topic?.name ?? "",
|
|
4684
|
+
content: currentQuestion?.statement ?? ""
|
|
4669
4685
|
}
|
|
4670
4686
|
);
|
|
4671
4687
|
};
|
|
@@ -4714,10 +4730,10 @@ var QuizAlternative = ({ paddingBottom }) => {
|
|
|
4714
4730
|
const alternatives = currentQuestion?.options?.map((option) => {
|
|
4715
4731
|
let status = "neutral" /* NEUTRAL */;
|
|
4716
4732
|
if (variant === "result") {
|
|
4717
|
-
const isCorrectOption =
|
|
4718
|
-
|
|
4733
|
+
const isCorrectOption = currentQuestionResult?.options?.find((op) => op.id === option.id)?.isCorrect || false;
|
|
4734
|
+
const isSelected = currentQuestionResult?.selectedOptions.some(
|
|
4735
|
+
(selectedOption) => selectedOption.optionId === option.id
|
|
4719
4736
|
);
|
|
4720
|
-
const isSelected = currentQuestionResult?.optionId === option.id;
|
|
4721
4737
|
if (isCorrectOption) {
|
|
4722
4738
|
status = "correct" /* CORRECT */;
|
|
4723
4739
|
} else if (isSelected && !isCorrectOption) {
|
|
@@ -4743,8 +4759,8 @@ var QuizAlternative = ({ paddingBottom }) => {
|
|
|
4743
4759
|
name: `question-${currentQuestion?.id || "1"}`,
|
|
4744
4760
|
layout: "compact",
|
|
4745
4761
|
alternatives,
|
|
4746
|
-
value: variant === "result" ? currentQuestionResult?.optionId || "" : currentAnswer?.optionId || "",
|
|
4747
|
-
selectedValue: variant === "result" ? currentQuestionResult?.optionId || "" : currentAnswer?.optionId || "",
|
|
4762
|
+
value: variant === "result" ? currentQuestionResult?.selectedOptions[0]?.optionId || "" : currentAnswer?.optionId || "",
|
|
4763
|
+
selectedValue: variant === "result" ? currentQuestionResult?.selectedOptions[0]?.optionId || "" : currentAnswer?.optionId || "",
|
|
4748
4764
|
onValueChange: (value) => {
|
|
4749
4765
|
if (currentQuestion) {
|
|
4750
4766
|
selectAnswer(currentQuestion.id, value);
|
|
@@ -4789,15 +4805,16 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
4789
4805
|
prevSelectedValuesRef.current = selectedValues;
|
|
4790
4806
|
return selectedValues;
|
|
4791
4807
|
}
|
|
4792
|
-
if (variant == "result"
|
|
4793
|
-
return currentQuestionResult?.
|
|
4808
|
+
if (variant == "result") {
|
|
4809
|
+
return currentQuestionResult?.selectedOptions.map((op) => op.optionId) || [];
|
|
4810
|
+
} else {
|
|
4811
|
+
return prevSelectedValuesRef.current;
|
|
4794
4812
|
}
|
|
4795
|
-
return prevSelectedValuesRef.current;
|
|
4796
4813
|
}, [
|
|
4797
4814
|
selectedValues,
|
|
4798
4815
|
currentQuestion?.id,
|
|
4799
4816
|
variant,
|
|
4800
|
-
currentQuestionResult?.
|
|
4817
|
+
currentQuestionResult?.selectedOptions
|
|
4801
4818
|
]);
|
|
4802
4819
|
const handleSelectedValues = (0, import_react12.useCallback)(
|
|
4803
4820
|
(values) => {
|
|
@@ -4814,11 +4831,9 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
4814
4831
|
const choices = currentQuestion?.options?.map((option) => {
|
|
4815
4832
|
let status = "neutral" /* NEUTRAL */;
|
|
4816
4833
|
if (variant === "result") {
|
|
4817
|
-
const isCorrectOption =
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
const isSelected = currentQuestionResult?.options.find(
|
|
4821
|
-
(op) => op.id === option.id
|
|
4834
|
+
const isCorrectOption = currentQuestionResult?.options?.find((op) => op.id === option.id)?.isCorrect || false;
|
|
4835
|
+
const isSelected = currentQuestionResult?.selectedOptions?.some(
|
|
4836
|
+
(op) => op.optionId === option.id
|
|
4822
4837
|
);
|
|
4823
4838
|
if (isCorrectOption) {
|
|
4824
4839
|
status = "correct" /* CORRECT */;
|
|
@@ -5094,7 +5109,7 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
5094
5109
|
}) }) })
|
|
5095
5110
|
] });
|
|
5096
5111
|
};
|
|
5097
|
-
var QuizFill = ({ paddingBottom
|
|
5112
|
+
var QuizFill = ({ paddingBottom }) => {
|
|
5098
5113
|
const { variant } = useQuizStore();
|
|
5099
5114
|
const options = [
|
|
5100
5115
|
"ci\xEAncia",
|
|
@@ -5452,7 +5467,7 @@ var QuizQuestionList = ({
|
|
|
5452
5467
|
([subjectId, questions]) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: "flex flex-col gap-2", children: [
|
|
5453
5468
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "pt-6 pb-4 flex flex-row gap-2", children: [
|
|
5454
5469
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "bg-primary-500 p-1 rounded-sm flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_phosphor_react9.BookOpen, { size: 17, className: "text-white" }) }),
|
|
5455
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-text-800 font-bold text-lg", children:
|
|
5470
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-text-800 font-bold text-lg", children: questions?.[0]?.knowledgeMatrix?.[0]?.subject?.name ?? "Sem mat\xE9ria" })
|
|
5456
5471
|
] }),
|
|
5457
5472
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { className: "flex flex-col gap-2", children: questions.map((question) => {
|
|
5458
5473
|
const status = getQuestionStatus(question.id);
|
|
@@ -5883,28 +5898,24 @@ var QuizResultPerformance = (0, import_react12.forwardRef)(
|
|
|
5883
5898
|
}
|
|
5884
5899
|
);
|
|
5885
5900
|
var QuizListResult = (0, import_react12.forwardRef)(({ className, onSubjectClick, ...props }, ref) => {
|
|
5886
|
-
const {
|
|
5887
|
-
getQuestionsGroupedBySubject,
|
|
5888
|
-
isQuestionAnswered,
|
|
5889
|
-
getUserAnswerByQuestionId
|
|
5890
|
-
} = useQuizStore();
|
|
5901
|
+
const { getQuestionsGroupedBySubject } = useQuizStore();
|
|
5891
5902
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
5892
5903
|
const subjectsStats = Object.entries(groupedQuestions).map(
|
|
5893
5904
|
([subjectId, questions]) => {
|
|
5894
5905
|
let correct = 0;
|
|
5895
5906
|
let incorrect = 0;
|
|
5896
5907
|
questions.forEach((question) => {
|
|
5897
|
-
if (
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
} else {
|
|
5902
|
-
incorrect++;
|
|
5903
|
-
}
|
|
5908
|
+
if (question.answerStatus == "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */) {
|
|
5909
|
+
correct++;
|
|
5910
|
+
} else {
|
|
5911
|
+
incorrect++;
|
|
5904
5912
|
}
|
|
5905
5913
|
});
|
|
5906
5914
|
return {
|
|
5907
|
-
subject:
|
|
5915
|
+
subject: {
|
|
5916
|
+
name: questions?.[0]?.knowledgeMatrix?.[0]?.subject?.name ?? "Sem mat\xE9ria",
|
|
5917
|
+
id: subjectId
|
|
5918
|
+
},
|
|
5908
5919
|
correct,
|
|
5909
5920
|
incorrect,
|
|
5910
5921
|
total: questions.length
|
|
@@ -5916,44 +5927,42 @@ var QuizListResult = (0, import_react12.forwardRef)(({ className, onSubjectClick
|
|
|
5916
5927
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { className: "flex flex-col gap-2", children: subjectsStats.map((subject) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5917
5928
|
CardResults,
|
|
5918
5929
|
{
|
|
5919
|
-
onClick: () => onSubjectClick?.(subject.subject),
|
|
5930
|
+
onClick: () => onSubjectClick?.(subject.subject.id),
|
|
5920
5931
|
className: "max-w-full",
|
|
5921
|
-
header: subject.subject,
|
|
5932
|
+
header: subject.subject.name,
|
|
5922
5933
|
correct_answers: subject.correct,
|
|
5923
5934
|
incorrect_answers: subject.incorrect,
|
|
5924
5935
|
icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_phosphor_react9.Book, { size: 20 }),
|
|
5925
5936
|
direction: "row"
|
|
5926
5937
|
}
|
|
5927
|
-
) }, subject.subject)) })
|
|
5938
|
+
) }, subject.subject.id)) })
|
|
5928
5939
|
] });
|
|
5929
5940
|
});
|
|
5930
5941
|
var QuizListResultByMateria = ({
|
|
5931
5942
|
subject,
|
|
5932
5943
|
onQuestionClick
|
|
5933
5944
|
}) => {
|
|
5934
|
-
const {
|
|
5935
|
-
getQuestionsGroupedBySubject,
|
|
5936
|
-
getUserAnswerByQuestionId,
|
|
5937
|
-
getQuestionIndex
|
|
5938
|
-
} = useQuizStore();
|
|
5945
|
+
const { getQuestionsGroupedBySubject, getQuestionIndex } = useQuizStore();
|
|
5939
5946
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
5940
5947
|
const answeredQuestions = groupedQuestions[subject] || [];
|
|
5941
5948
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w-full max-w-[1000px] flex flex-col mx-auto h-full relative not-lg:px-6", children: [
|
|
5942
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex flex-row pt-4 justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: subject }) }),
|
|
5949
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex flex-row pt-4 justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: answeredQuestions?.[0]?.knowledgeMatrix?.[0]?.subject?.name ?? "Sem mat\xE9ria" }) }),
|
|
5943
5950
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: "flex flex-col ", children: [
|
|
5944
5951
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Resultado das quest\xF5es" }),
|
|
5945
5952
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { className: "flex flex-col gap-2 pt-4", children: answeredQuestions.map((question) => {
|
|
5946
|
-
const questionIndex = getQuestionIndex(
|
|
5953
|
+
const questionIndex = getQuestionIndex(
|
|
5954
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5955
|
+
question.questionId ?? question.id
|
|
5956
|
+
);
|
|
5947
5957
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5948
5958
|
CardStatus,
|
|
5949
5959
|
{
|
|
5950
5960
|
className: "max-w-full",
|
|
5951
5961
|
header: `Quest\xE3o ${questionIndex.toString().padStart(2, "0")}`,
|
|
5952
5962
|
status: (() => {
|
|
5953
|
-
|
|
5954
|
-
if (userAnswer?.answerStatus === "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */)
|
|
5963
|
+
if (question.answerStatus === "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */)
|
|
5955
5964
|
return "correct";
|
|
5956
|
-
if (
|
|
5965
|
+
if (question.answerStatus === "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */)
|
|
5957
5966
|
return "incorrect";
|
|
5958
5967
|
return void 0;
|
|
5959
5968
|
})(),
|
|
@@ -5969,6 +5978,7 @@ var QuizListResultByMateria = ({
|
|
|
5969
5978
|
Quiz,
|
|
5970
5979
|
QuizAlternative,
|
|
5971
5980
|
QuizConnectDots,
|
|
5981
|
+
QuizContainer,
|
|
5972
5982
|
QuizContent,
|
|
5973
5983
|
QuizDissertative,
|
|
5974
5984
|
QuizFill,
|
|
@@ -5983,8 +5993,10 @@ var QuizListResultByMateria = ({
|
|
|
5983
5993
|
QuizResultHeaderTitle,
|
|
5984
5994
|
QuizResultPerformance,
|
|
5985
5995
|
QuizResultTitle,
|
|
5996
|
+
QuizSubTitle,
|
|
5986
5997
|
QuizTitle,
|
|
5987
5998
|
QuizTrueOrFalse,
|
|
5988
|
-
getStatusBadge
|
|
5999
|
+
getStatusBadge,
|
|
6000
|
+
getStatusStyles
|
|
5989
6001
|
});
|
|
5990
6002
|
//# sourceMappingURL=index.js.map
|