analytica-frontend-lib 1.1.13 → 1.1.15
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/Accordation/index.js +41 -7
- package/dist/Accordation/index.js.map +1 -1
- package/dist/Accordation/index.mjs +41 -7
- package/dist/Accordation/index.mjs.map +1 -1
- package/dist/Card/index.js +41 -7
- package/dist/Card/index.js.map +1 -1
- package/dist/Card/index.mjs +41 -7
- package/dist/Card/index.mjs.map +1 -1
- package/dist/Quiz/index.d.mts +9 -1
- package/dist/Quiz/index.d.ts +9 -1
- package/dist/Quiz/index.js +116 -70
- package/dist/Quiz/index.js.map +1 -1
- package/dist/Quiz/index.mjs +112 -69
- package/dist/Quiz/index.mjs.map +1 -1
- package/dist/Quiz/useQuizStore/index.d.mts +52 -14
- package/dist/Quiz/useQuizStore/index.d.ts +52 -14
- package/dist/Quiz/useQuizStore/index.js +30 -17
- package/dist/Quiz/useQuizStore/index.js.map +1 -1
- package/dist/Quiz/useQuizStore/index.mjs +30 -17
- package/dist/Quiz/useQuizStore/index.mjs.map +1 -1
- package/dist/index.css +9 -3
- package/dist/index.css.map +1 -1
- package/dist/index.js +108 -68
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +108 -68
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +9 -3
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
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");
|
|
@@ -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();
|
|
@@ -3215,6 +3231,8 @@ var CardAudio = (0, import_react7.forwardRef)(
|
|
|
3215
3231
|
const [duration, setDuration] = (0, import_react7.useState)(0);
|
|
3216
3232
|
const [volume, setVolume] = (0, import_react7.useState)(1);
|
|
3217
3233
|
const [showVolumeControl, setShowVolumeControl] = (0, import_react7.useState)(false);
|
|
3234
|
+
const [showSpeedMenu, setShowSpeedMenu] = (0, import_react7.useState)(false);
|
|
3235
|
+
const [playbackRate, setPlaybackRate] = (0, import_react7.useState)(1);
|
|
3218
3236
|
const audioRef = (0, import_react7.useRef)(null);
|
|
3219
3237
|
const formatTime = (time) => {
|
|
3220
3238
|
const minutes = Math.floor(time / 60);
|
|
@@ -3268,6 +3286,16 @@ var CardAudio = (0, import_react7.forwardRef)(
|
|
|
3268
3286
|
const toggleVolumeControl = () => {
|
|
3269
3287
|
setShowVolumeControl(!showVolumeControl);
|
|
3270
3288
|
};
|
|
3289
|
+
const toggleSpeedMenu = () => {
|
|
3290
|
+
setShowSpeedMenu(!showSpeedMenu);
|
|
3291
|
+
};
|
|
3292
|
+
const handleSpeedChange = (speed) => {
|
|
3293
|
+
setPlaybackRate(speed);
|
|
3294
|
+
if (audioRef.current) {
|
|
3295
|
+
audioRef.current.playbackRate = speed;
|
|
3296
|
+
}
|
|
3297
|
+
setShowSpeedMenu(false);
|
|
3298
|
+
};
|
|
3271
3299
|
const getVolumeIcon = () => {
|
|
3272
3300
|
if (volume === 0) {
|
|
3273
3301
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react5.SpeakerSimpleX, {});
|
|
@@ -3424,13 +3452,35 @@ var CardAudio = (0, import_react7.forwardRef)(
|
|
|
3424
3452
|
}
|
|
3425
3453
|
)
|
|
3426
3454
|
] }),
|
|
3427
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3455
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "relative", children: [
|
|
3456
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3457
|
+
"button",
|
|
3458
|
+
{
|
|
3459
|
+
type: "button",
|
|
3460
|
+
onClick: toggleSpeedMenu,
|
|
3461
|
+
className: "cursor-pointer text-text-950 hover:text-primary-600",
|
|
3462
|
+
"aria-label": "Op\xE7\xF5es de velocidade",
|
|
3463
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react5.DotsThreeVertical, { size: 24 })
|
|
3464
|
+
}
|
|
3465
|
+
),
|
|
3466
|
+
showSpeedMenu && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "absolute bottom-full right-0 mb-2 p-2 bg-background border border-border-100 rounded-lg shadow-lg min-w-24 z-10", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex flex-col gap-1", children: [
|
|
3467
|
+
{ speed: 1, label: "1x" },
|
|
3468
|
+
{ speed: 1.5, label: "1.5x" },
|
|
3469
|
+
{ speed: 2, label: "2x" }
|
|
3470
|
+
].map(({ speed, label }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3471
|
+
"button",
|
|
3472
|
+
{
|
|
3473
|
+
type: "button",
|
|
3474
|
+
onClick: () => handleSpeedChange(speed),
|
|
3475
|
+
className: cn(
|
|
3476
|
+
"px-3 py-1 text-sm text-left rounded hover:bg-border-50 transition-colors",
|
|
3477
|
+
playbackRate === speed ? "bg-primary-950 text-secondary-100 font-medium" : "text-text-950"
|
|
3478
|
+
),
|
|
3479
|
+
children: label
|
|
3480
|
+
},
|
|
3481
|
+
speed
|
|
3482
|
+
)) }) })
|
|
3483
|
+
] })
|
|
3434
3484
|
]
|
|
3435
3485
|
}
|
|
3436
3486
|
);
|
|
@@ -4630,8 +4680,8 @@ var QuizHeader = () => {
|
|
|
4630
4680
|
HeaderAlternative,
|
|
4631
4681
|
{
|
|
4632
4682
|
title: currentQuestion ? `Quest\xE3o ${currentQuestionIndex + 1}` : "Quest\xE3o",
|
|
4633
|
-
subTitle: currentQuestion?.knowledgeMatrix?.[0]?.
|
|
4634
|
-
content: currentQuestion?.
|
|
4683
|
+
subTitle: currentQuestion?.knowledgeMatrix?.[0]?.topic?.name ?? "",
|
|
4684
|
+
content: currentQuestion?.statement ?? ""
|
|
4635
4685
|
}
|
|
4636
4686
|
);
|
|
4637
4687
|
};
|
|
@@ -4680,10 +4730,10 @@ var QuizAlternative = ({ paddingBottom }) => {
|
|
|
4680
4730
|
const alternatives = currentQuestion?.options?.map((option) => {
|
|
4681
4731
|
let status = "neutral" /* NEUTRAL */;
|
|
4682
4732
|
if (variant === "result") {
|
|
4683
|
-
const isCorrectOption =
|
|
4684
|
-
|
|
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
|
|
4685
4736
|
);
|
|
4686
|
-
const isSelected = currentQuestionResult?.optionId === option.id;
|
|
4687
4737
|
if (isCorrectOption) {
|
|
4688
4738
|
status = "correct" /* CORRECT */;
|
|
4689
4739
|
} else if (isSelected && !isCorrectOption) {
|
|
@@ -4709,8 +4759,8 @@ var QuizAlternative = ({ paddingBottom }) => {
|
|
|
4709
4759
|
name: `question-${currentQuestion?.id || "1"}`,
|
|
4710
4760
|
layout: "compact",
|
|
4711
4761
|
alternatives,
|
|
4712
|
-
value: variant === "result" ? currentQuestionResult?.optionId || "" : currentAnswer?.optionId || "",
|
|
4713
|
-
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 || "",
|
|
4714
4764
|
onValueChange: (value) => {
|
|
4715
4765
|
if (currentQuestion) {
|
|
4716
4766
|
selectAnswer(currentQuestion.id, value);
|
|
@@ -4755,15 +4805,16 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
4755
4805
|
prevSelectedValuesRef.current = selectedValues;
|
|
4756
4806
|
return selectedValues;
|
|
4757
4807
|
}
|
|
4758
|
-
if (variant == "result"
|
|
4759
|
-
return currentQuestionResult?.
|
|
4808
|
+
if (variant == "result") {
|
|
4809
|
+
return currentQuestionResult?.selectedOptions.map((op) => op.optionId) || [];
|
|
4810
|
+
} else {
|
|
4811
|
+
return prevSelectedValuesRef.current;
|
|
4760
4812
|
}
|
|
4761
|
-
return prevSelectedValuesRef.current;
|
|
4762
4813
|
}, [
|
|
4763
4814
|
selectedValues,
|
|
4764
4815
|
currentQuestion?.id,
|
|
4765
4816
|
variant,
|
|
4766
|
-
currentQuestionResult?.
|
|
4817
|
+
currentQuestionResult?.selectedOptions
|
|
4767
4818
|
]);
|
|
4768
4819
|
const handleSelectedValues = (0, import_react12.useCallback)(
|
|
4769
4820
|
(values) => {
|
|
@@ -4780,11 +4831,9 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
4780
4831
|
const choices = currentQuestion?.options?.map((option) => {
|
|
4781
4832
|
let status = "neutral" /* NEUTRAL */;
|
|
4782
4833
|
if (variant === "result") {
|
|
4783
|
-
const isCorrectOption =
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
const isSelected = currentQuestionResult?.options.find(
|
|
4787
|
-
(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
|
|
4788
4837
|
);
|
|
4789
4838
|
if (isCorrectOption) {
|
|
4790
4839
|
status = "correct" /* CORRECT */;
|
|
@@ -5060,7 +5109,7 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
5060
5109
|
}) }) })
|
|
5061
5110
|
] });
|
|
5062
5111
|
};
|
|
5063
|
-
var QuizFill = ({ paddingBottom
|
|
5112
|
+
var QuizFill = ({ paddingBottom }) => {
|
|
5064
5113
|
const { variant } = useQuizStore();
|
|
5065
5114
|
const options = [
|
|
5066
5115
|
"ci\xEAncia",
|
|
@@ -5418,7 +5467,7 @@ var QuizQuestionList = ({
|
|
|
5418
5467
|
([subjectId, questions]) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: "flex flex-col gap-2", children: [
|
|
5419
5468
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "pt-6 pb-4 flex flex-row gap-2", children: [
|
|
5420
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" }) }),
|
|
5421
|
-
/* @__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" })
|
|
5422
5471
|
] }),
|
|
5423
5472
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { className: "flex flex-col gap-2", children: questions.map((question) => {
|
|
5424
5473
|
const status = getQuestionStatus(question.id);
|
|
@@ -5849,28 +5898,24 @@ var QuizResultPerformance = (0, import_react12.forwardRef)(
|
|
|
5849
5898
|
}
|
|
5850
5899
|
);
|
|
5851
5900
|
var QuizListResult = (0, import_react12.forwardRef)(({ className, onSubjectClick, ...props }, ref) => {
|
|
5852
|
-
const {
|
|
5853
|
-
getQuestionsGroupedBySubject,
|
|
5854
|
-
isQuestionAnswered,
|
|
5855
|
-
getUserAnswerByQuestionId
|
|
5856
|
-
} = useQuizStore();
|
|
5901
|
+
const { getQuestionsGroupedBySubject } = useQuizStore();
|
|
5857
5902
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
5858
5903
|
const subjectsStats = Object.entries(groupedQuestions).map(
|
|
5859
5904
|
([subjectId, questions]) => {
|
|
5860
5905
|
let correct = 0;
|
|
5861
5906
|
let incorrect = 0;
|
|
5862
5907
|
questions.forEach((question) => {
|
|
5863
|
-
if (
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
} else {
|
|
5868
|
-
incorrect++;
|
|
5869
|
-
}
|
|
5908
|
+
if (question.answerStatus == "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */) {
|
|
5909
|
+
correct++;
|
|
5910
|
+
} else {
|
|
5911
|
+
incorrect++;
|
|
5870
5912
|
}
|
|
5871
5913
|
});
|
|
5872
5914
|
return {
|
|
5873
|
-
subject:
|
|
5915
|
+
subject: {
|
|
5916
|
+
name: questions?.[0]?.knowledgeMatrix?.[0]?.subject?.name ?? "Sem mat\xE9ria",
|
|
5917
|
+
id: subjectId
|
|
5918
|
+
},
|
|
5874
5919
|
correct,
|
|
5875
5920
|
incorrect,
|
|
5876
5921
|
total: questions.length
|
|
@@ -5882,44 +5927,42 @@ var QuizListResult = (0, import_react12.forwardRef)(({ className, onSubjectClick
|
|
|
5882
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)(
|
|
5883
5928
|
CardResults,
|
|
5884
5929
|
{
|
|
5885
|
-
onClick: () => onSubjectClick?.(subject.subject),
|
|
5930
|
+
onClick: () => onSubjectClick?.(subject.subject.id),
|
|
5886
5931
|
className: "max-w-full",
|
|
5887
|
-
header: subject.subject,
|
|
5932
|
+
header: subject.subject.name,
|
|
5888
5933
|
correct_answers: subject.correct,
|
|
5889
5934
|
incorrect_answers: subject.incorrect,
|
|
5890
5935
|
icon: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_phosphor_react9.Book, { size: 20 }),
|
|
5891
5936
|
direction: "row"
|
|
5892
5937
|
}
|
|
5893
|
-
) }, subject.subject)) })
|
|
5938
|
+
) }, subject.subject.id)) })
|
|
5894
5939
|
] });
|
|
5895
5940
|
});
|
|
5896
5941
|
var QuizListResultByMateria = ({
|
|
5897
5942
|
subject,
|
|
5898
5943
|
onQuestionClick
|
|
5899
5944
|
}) => {
|
|
5900
|
-
const {
|
|
5901
|
-
getQuestionsGroupedBySubject,
|
|
5902
|
-
getUserAnswerByQuestionId,
|
|
5903
|
-
getQuestionIndex
|
|
5904
|
-
} = useQuizStore();
|
|
5945
|
+
const { getQuestionsGroupedBySubject, getQuestionIndex } = useQuizStore();
|
|
5905
5946
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
5906
5947
|
const answeredQuestions = groupedQuestions[subject] || [];
|
|
5907
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: [
|
|
5908
|
-
/* @__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" }) }),
|
|
5909
5950
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: "flex flex-col ", children: [
|
|
5910
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" }),
|
|
5911
5952
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { className: "flex flex-col gap-2 pt-4", children: answeredQuestions.map((question) => {
|
|
5912
|
-
const questionIndex = getQuestionIndex(
|
|
5953
|
+
const questionIndex = getQuestionIndex(
|
|
5954
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5955
|
+
question.questionId ?? question.id
|
|
5956
|
+
);
|
|
5913
5957
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5914
5958
|
CardStatus,
|
|
5915
5959
|
{
|
|
5916
5960
|
className: "max-w-full",
|
|
5917
5961
|
header: `Quest\xE3o ${questionIndex.toString().padStart(2, "0")}`,
|
|
5918
5962
|
status: (() => {
|
|
5919
|
-
|
|
5920
|
-
if (userAnswer?.answerStatus === "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */)
|
|
5963
|
+
if (question.answerStatus === "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */)
|
|
5921
5964
|
return "correct";
|
|
5922
|
-
if (
|
|
5965
|
+
if (question.answerStatus === "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */)
|
|
5923
5966
|
return "incorrect";
|
|
5924
5967
|
return void 0;
|
|
5925
5968
|
})(),
|
|
@@ -5935,6 +5978,7 @@ var QuizListResultByMateria = ({
|
|
|
5935
5978
|
Quiz,
|
|
5936
5979
|
QuizAlternative,
|
|
5937
5980
|
QuizConnectDots,
|
|
5981
|
+
QuizContainer,
|
|
5938
5982
|
QuizContent,
|
|
5939
5983
|
QuizDissertative,
|
|
5940
5984
|
QuizFill,
|
|
@@ -5949,8 +5993,10 @@ var QuizListResultByMateria = ({
|
|
|
5949
5993
|
QuizResultHeaderTitle,
|
|
5950
5994
|
QuizResultPerformance,
|
|
5951
5995
|
QuizResultTitle,
|
|
5996
|
+
QuizSubTitle,
|
|
5952
5997
|
QuizTitle,
|
|
5953
5998
|
QuizTrueOrFalse,
|
|
5954
|
-
getStatusBadge
|
|
5999
|
+
getStatusBadge,
|
|
6000
|
+
getStatusStyles
|
|
5955
6001
|
});
|
|
5956
6002
|
//# sourceMappingURL=index.js.map
|