analytica-frontend-lib 1.0.96 → 1.0.98
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/CheckBox/index.d.mts +1 -1
- package/dist/CheckBox/index.d.ts +1 -1
- package/dist/Quiz/index.d.mts +12 -14
- package/dist/Quiz/index.d.ts +12 -14
- package/dist/Quiz/index.js +495 -93
- package/dist/Quiz/index.js.map +1 -1
- package/dist/Quiz/index.mjs +494 -93
- package/dist/Quiz/index.mjs.map +1 -1
- package/dist/Quiz/useQuizStore/index.d.mts +4 -1
- package/dist/Quiz/useQuizStore/index.d.ts +4 -1
- package/dist/Quiz/useQuizStore/index.js +3 -0
- package/dist/Quiz/useQuizStore/index.js.map +1 -1
- package/dist/Quiz/useQuizStore/index.mjs +3 -0
- package/dist/Quiz/useQuizStore/index.mjs.map +1 -1
- package/dist/Radio/index.d.mts +2 -2
- package/dist/Radio/index.d.ts +2 -2
- package/dist/Search/index.d.mts +1 -1
- package/dist/Search/index.d.ts +1 -1
- package/dist/Select/index.js +3 -3
- package/dist/Select/index.js.map +1 -1
- package/dist/Select/index.mjs +3 -3
- package/dist/Select/index.mjs.map +1 -1
- package/dist/index.css +35 -3
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +491 -91
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +492 -92
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +35 -3
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -81,6 +81,7 @@ __export(src_exports, {
|
|
|
81
81
|
PublicRoute: () => PublicRoute,
|
|
82
82
|
Quiz: () => Quiz,
|
|
83
83
|
QuizAlternative: () => QuizAlternative,
|
|
84
|
+
QuizConnectDots: () => QuizConnectDots,
|
|
84
85
|
QuizContent: () => QuizContent,
|
|
85
86
|
QuizDissertative: () => QuizDissertative,
|
|
86
87
|
QuizFooter: () => QuizFooter,
|
|
@@ -94,6 +95,7 @@ __export(src_exports, {
|
|
|
94
95
|
QuizResultPerformance: () => QuizResultPerformance,
|
|
95
96
|
QuizResultTitle: () => QuizResultTitle,
|
|
96
97
|
QuizTitle: () => QuizTitle,
|
|
98
|
+
QuizTrueOrFalse: () => QuizTrueOrFalse,
|
|
97
99
|
Radio: () => Radio_default,
|
|
98
100
|
RadioGroup: () => RadioGroup,
|
|
99
101
|
RadioGroupItem: () => RadioGroupItem,
|
|
@@ -120,6 +122,7 @@ __export(src_exports, {
|
|
|
120
122
|
Toaster: () => Toaster_default,
|
|
121
123
|
createZustandAuthAdapter: () => createZustandAuthAdapter,
|
|
122
124
|
getRootDomain: () => getRootDomain,
|
|
125
|
+
getStatusBadge: () => getStatusBadge,
|
|
123
126
|
useApiConfig: () => useApiConfig,
|
|
124
127
|
useAuth: () => useAuth,
|
|
125
128
|
useAuthGuard: () => useAuthGuard,
|
|
@@ -5310,7 +5313,7 @@ var AlternativesList = ({
|
|
|
5310
5313
|
const groupName = name || `alternatives-${uniqueId}`;
|
|
5311
5314
|
const [actualValue, setActualValue] = (0, import_react16.useState)(value);
|
|
5312
5315
|
const isReadonly = mode === "readonly";
|
|
5313
|
-
const
|
|
5316
|
+
const getStatusStyles2 = (status, isReadonly2) => {
|
|
5314
5317
|
const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
|
|
5315
5318
|
switch (status) {
|
|
5316
5319
|
case "correct":
|
|
@@ -5321,7 +5324,7 @@ var AlternativesList = ({
|
|
|
5321
5324
|
return `bg-background border-border-100 ${hoverClass}`;
|
|
5322
5325
|
}
|
|
5323
5326
|
};
|
|
5324
|
-
const
|
|
5327
|
+
const getStatusBadge2 = (status) => {
|
|
5325
5328
|
switch (status) {
|
|
5326
5329
|
case "correct":
|
|
5327
5330
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_phosphor_react14.CheckCircle, {}), children: "Resposta correta" });
|
|
@@ -5351,8 +5354,8 @@ var AlternativesList = ({
|
|
|
5351
5354
|
} else if (isCorrectAnswer) {
|
|
5352
5355
|
displayStatus = "correct";
|
|
5353
5356
|
}
|
|
5354
|
-
const statusStyles =
|
|
5355
|
-
const statusBadge =
|
|
5357
|
+
const statusStyles = getStatusStyles2(displayStatus, true);
|
|
5358
|
+
const statusBadge = getStatusBadge2(displayStatus);
|
|
5356
5359
|
const renderRadio = () => {
|
|
5357
5360
|
const radioClasses = `w-6 h-6 rounded-full border-2 cursor-default transition-all duration-200 flex items-center justify-center ${isUserSelected ? "border-primary-950 bg-background" : "border-border-400 bg-background"}`;
|
|
5358
5361
|
const dotClasses = "w-3 h-3 rounded-full bg-primary-950 transition-all duration-200";
|
|
@@ -5443,8 +5446,8 @@ var AlternativesList = ({
|
|
|
5443
5446
|
className: cn("flex flex-col", getLayoutClasses(), className),
|
|
5444
5447
|
children: alternatives.map((alternative, index) => {
|
|
5445
5448
|
const alternativeId = alternative.value || `alt-${index}`;
|
|
5446
|
-
const statusStyles =
|
|
5447
|
-
const statusBadge =
|
|
5449
|
+
const statusStyles = getStatusStyles2(alternative.status, false);
|
|
5450
|
+
const statusBadge = getStatusBadge2(alternative.status);
|
|
5448
5451
|
if (layout === "detailed") {
|
|
5449
5452
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5450
5453
|
"div",
|
|
@@ -5690,7 +5693,7 @@ var MultipleChoiceList = ({
|
|
|
5690
5693
|
(0, import_react18.useEffect)(() => {
|
|
5691
5694
|
setActualValue(selectedValues);
|
|
5692
5695
|
}, [selectedValues]);
|
|
5693
|
-
const
|
|
5696
|
+
const getStatusBadge2 = (status) => {
|
|
5694
5697
|
switch (status) {
|
|
5695
5698
|
case "correct":
|
|
5696
5699
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_phosphor_react15.CheckCircle, {}), children: "Resposta correta" });
|
|
@@ -5700,7 +5703,7 @@ var MultipleChoiceList = ({
|
|
|
5700
5703
|
return null;
|
|
5701
5704
|
}
|
|
5702
5705
|
};
|
|
5703
|
-
const
|
|
5706
|
+
const getStatusStyles2 = (status) => {
|
|
5704
5707
|
switch (status) {
|
|
5705
5708
|
case "correct":
|
|
5706
5709
|
return "bg-success-background border-success-300";
|
|
@@ -5721,8 +5724,8 @@ var MultipleChoiceList = ({
|
|
|
5721
5724
|
if (mode === "readonly") {
|
|
5722
5725
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: cn("flex flex-col gap-2", className), children: choices.map((choice, i) => {
|
|
5723
5726
|
const isSelected = actualValue?.includes(choice.value) || false;
|
|
5724
|
-
const statusStyles =
|
|
5725
|
-
const statusBadge =
|
|
5727
|
+
const statusStyles = getStatusStyles2(choice.status);
|
|
5728
|
+
const statusBadge = getStatusBadge2(choice.status);
|
|
5726
5729
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
5727
5730
|
"div",
|
|
5728
5731
|
{
|
|
@@ -6104,7 +6107,7 @@ var Select = ({
|
|
|
6104
6107
|
}
|
|
6105
6108
|
}, [propValue]);
|
|
6106
6109
|
const sizeClasses = SIZE_CLASSES12[size];
|
|
6107
|
-
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("w-
|
|
6110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: cn("w-fit", className), children: [
|
|
6108
6111
|
label && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6109
6112
|
"label",
|
|
6110
6113
|
{
|
|
@@ -6113,7 +6116,7 @@ var Select = ({
|
|
|
6113
6116
|
children: label
|
|
6114
6117
|
}
|
|
6115
6118
|
),
|
|
6116
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn("relative"), ref: selectRef, children: injectStore4(children, store, size, selectId) }),
|
|
6119
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn("relative w-fit"), ref: selectRef, children: injectStore4(children, store, size, selectId) }),
|
|
6117
6120
|
(helperText || errorMessage) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "mt-1.5 gap-1.5", children: [
|
|
6118
6121
|
helperText && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-sm text-text-500", children: helperText }),
|
|
6119
6122
|
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("p", { className: "flex gap-1 items-center text-sm text-indicator-error", children: [
|
|
@@ -6206,7 +6209,7 @@ var SelectContent = (0, import_react19.forwardRef)(
|
|
|
6206
6209
|
role: "menu",
|
|
6207
6210
|
ref,
|
|
6208
6211
|
className: cn(
|
|
6209
|
-
"bg-secondary z-50 min-w-[210px] overflow-hidden rounded-md border p-1 shadow-md border-border-100",
|
|
6212
|
+
"bg-secondary z-50 min-w-[210px] max-h-[300px] overflow-y-auto overflow-x-hidden rounded-md border p-1 shadow-md border-border-100",
|
|
6210
6213
|
getPositionClasses(),
|
|
6211
6214
|
className
|
|
6212
6215
|
),
|
|
@@ -7584,6 +7587,24 @@ var simulated_result_default = "./simulated-result-QN5HCUY5.png";
|
|
|
7584
7587
|
|
|
7585
7588
|
// src/components/Quiz/Quiz.tsx
|
|
7586
7589
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
7590
|
+
var getStatusBadge = (status) => {
|
|
7591
|
+
switch (status) {
|
|
7592
|
+
case "correct":
|
|
7593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_phosphor_react18.CheckCircle, {}), children: "Resposta correta" });
|
|
7594
|
+
case "incorrect":
|
|
7595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_phosphor_react18.XCircle, {}), children: "Resposta incorreta" });
|
|
7596
|
+
default:
|
|
7597
|
+
return null;
|
|
7598
|
+
}
|
|
7599
|
+
};
|
|
7600
|
+
var getStatusStyles = (variantCorrect) => {
|
|
7601
|
+
switch (variantCorrect) {
|
|
7602
|
+
case "correct":
|
|
7603
|
+
return "bg-success-background border-success-300";
|
|
7604
|
+
case "incorrect":
|
|
7605
|
+
return "bg-error-background border-error-300";
|
|
7606
|
+
}
|
|
7607
|
+
};
|
|
7587
7608
|
var Quiz = (0, import_react25.forwardRef)(({ children, className, ...props }, ref) => {
|
|
7588
7609
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7589
7610
|
"div",
|
|
@@ -7662,58 +7683,55 @@ var QuizTitle = (0, import_react25.forwardRef)(
|
|
|
7662
7683
|
);
|
|
7663
7684
|
}
|
|
7664
7685
|
);
|
|
7686
|
+
var QuizSubTitle = (0, import_react25.forwardRef)(
|
|
7687
|
+
({ subTitle, ...props }, ref) => {
|
|
7688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "px-4 pb-2 pt-6", ...props, ref, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "font-bold text-lg text-text-950", children: subTitle }) });
|
|
7689
|
+
}
|
|
7690
|
+
);
|
|
7665
7691
|
var QuizHeader = () => {
|
|
7666
|
-
const { getCurrentQuestion } = useQuizStore();
|
|
7692
|
+
const { getCurrentQuestion, currentQuestionIndex } = useQuizStore();
|
|
7667
7693
|
const currentQuestion = getCurrentQuestion();
|
|
7668
7694
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7669
7695
|
HeaderAlternative,
|
|
7670
7696
|
{
|
|
7671
|
-
title: currentQuestion ? `Quest\xE3o ${
|
|
7697
|
+
title: currentQuestion ? `Quest\xE3o ${currentQuestionIndex + 1}` : "Quest\xE3o",
|
|
7672
7698
|
subTitle: currentQuestion?.knowledgeMatrix?.[0]?.topicId ?? "",
|
|
7673
7699
|
content: currentQuestion?.questionText ?? ""
|
|
7674
7700
|
}
|
|
7675
7701
|
);
|
|
7676
7702
|
};
|
|
7677
|
-
var
|
|
7678
|
-
|
|
7703
|
+
var QuizContainer = (0, import_react25.forwardRef)(({ children, className, ...props }, ref) => {
|
|
7704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7705
|
+
"div",
|
|
7706
|
+
{
|
|
7707
|
+
ref,
|
|
7708
|
+
className: cn(
|
|
7709
|
+
"bg-background rounded-t-xl px-4 pt-4 pb-[80px] h-auto flex flex-col gap-4 mb-auto",
|
|
7710
|
+
className
|
|
7711
|
+
),
|
|
7712
|
+
...props,
|
|
7713
|
+
children
|
|
7714
|
+
}
|
|
7715
|
+
);
|
|
7716
|
+
});
|
|
7717
|
+
var QuizContent = (0, import_react25.forwardRef)(({ variant, paddingBottom }) => {
|
|
7718
|
+
const { getCurrentQuestion } = useQuizStore();
|
|
7679
7719
|
const currentQuestion = getCurrentQuestion();
|
|
7680
|
-
const
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
/*
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
),
|
|
7691
|
-
...props,
|
|
7692
|
-
children: currentQuestion && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
7693
|
-
currentQuestion.type === "ALTERNATIVA" /* ALTERNATIVA */ && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizAlternative, { variant }),
|
|
7694
|
-
currentQuestion.type === "MULTIPLA_CHOICE" /* MULTIPLA_CHOICE */ && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizMultipleChoice, { variant }),
|
|
7695
|
-
currentQuestion.type === "DISSERTATIVA" /* DISSERTATIVA */ && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizDissertative, { variant })
|
|
7696
|
-
] })
|
|
7697
|
-
}
|
|
7698
|
-
),
|
|
7699
|
-
currentQuestion?.type === "DISSERTATIVA" /* DISSERTATIVA */ && variant === "result" && currentAnswer?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
7700
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "px-4 pb-2 pt-6", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "font-bold text-lg text-text-950", children: "Observa\xE7\xE3o do professor" }) }),
|
|
7701
|
-
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7702
|
-
"div",
|
|
7703
|
-
{
|
|
7704
|
-
ref,
|
|
7705
|
-
className: cn(
|
|
7706
|
-
"bg-background rounded-t-xl px-4 pt-4 pb-[80px] h-full flex flex-col gap-4 mb-auto",
|
|
7707
|
-
className
|
|
7708
|
-
),
|
|
7709
|
-
...props,
|
|
7710
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime37.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." })
|
|
7711
|
-
}
|
|
7712
|
-
)
|
|
7713
|
-
] })
|
|
7714
|
-
] });
|
|
7720
|
+
const questionComponents = {
|
|
7721
|
+
["ALTERNATIVA" /* ALTERNATIVA */]: QuizAlternative,
|
|
7722
|
+
["MULTIPLA_CHOICE" /* MULTIPLA_CHOICE */]: QuizMultipleChoice,
|
|
7723
|
+
["DISSERTATIVA" /* DISSERTATIVA */]: QuizDissertative,
|
|
7724
|
+
["VERDADEIRO_FALSO" /* VERDADEIRO_FALSO */]: QuizTrueOrFalse,
|
|
7725
|
+
["LIGAR_PONTOS" /* LIGAR_PONTOS */]: QuizConnectDots,
|
|
7726
|
+
["PREENCHER" /* PREENCHER */]: QuizFill
|
|
7727
|
+
};
|
|
7728
|
+
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.type] : null;
|
|
7729
|
+
return QuestionComponent ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuestionComponent, { variant, paddingBottom }) : null;
|
|
7715
7730
|
});
|
|
7716
|
-
var QuizAlternative = ({
|
|
7731
|
+
var QuizAlternative = ({
|
|
7732
|
+
variant = "default",
|
|
7733
|
+
paddingBottom
|
|
7734
|
+
}) => {
|
|
7717
7735
|
const { getCurrentQuestion, selectAnswer, getCurrentAnswer } = useQuizStore();
|
|
7718
7736
|
const currentQuestion = getCurrentQuestion();
|
|
7719
7737
|
const currentAnswer = getCurrentAnswer();
|
|
@@ -7737,26 +7755,30 @@ var QuizAlternative = ({ variant = "default" }) => {
|
|
|
7737
7755
|
});
|
|
7738
7756
|
if (!alternatives)
|
|
7739
7757
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { children: "N\xE3o h\xE1 Alternativas" }) });
|
|
7740
|
-
return /* @__PURE__ */ (0, import_jsx_runtime37.
|
|
7741
|
-
|
|
7742
|
-
{
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
|
|
7758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
7759
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
7760
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7761
|
+
AlternativesList,
|
|
7762
|
+
{
|
|
7763
|
+
mode: variant === "default" ? "interactive" : "readonly",
|
|
7764
|
+
name: `question-${currentQuestion?.id || "1"}`,
|
|
7765
|
+
layout: "compact",
|
|
7766
|
+
alternatives,
|
|
7767
|
+
value: currentAnswer?.optionId || "",
|
|
7768
|
+
selectedValue: currentAnswer?.optionId || "",
|
|
7769
|
+
onValueChange: (value) => {
|
|
7770
|
+
if (currentQuestion) {
|
|
7771
|
+
selectAnswer(currentQuestion.id, value);
|
|
7772
|
+
}
|
|
7752
7773
|
}
|
|
7753
|
-
}
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
|
|
7774
|
+
},
|
|
7775
|
+
`question-${currentQuestion?.id || "1"}`
|
|
7776
|
+
) }) })
|
|
7777
|
+
] });
|
|
7757
7778
|
};
|
|
7758
7779
|
var QuizMultipleChoice = ({
|
|
7759
|
-
variant = "default"
|
|
7780
|
+
variant = "default",
|
|
7781
|
+
paddingBottom
|
|
7760
7782
|
}) => {
|
|
7761
7783
|
const { getCurrentQuestion, selectMultipleAnswer, getAllCurrentAnswer } = useQuizStore();
|
|
7762
7784
|
const currentQuestion = getCurrentQuestion();
|
|
@@ -7814,20 +7836,24 @@ var QuizMultipleChoice = ({
|
|
|
7814
7836
|
});
|
|
7815
7837
|
if (!choices)
|
|
7816
7838
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { children: "N\xE3o h\xE1 Escolhas Multiplas" }) });
|
|
7817
|
-
return /* @__PURE__ */ (0, import_jsx_runtime37.
|
|
7818
|
-
|
|
7819
|
-
{
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
7840
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
7841
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7842
|
+
MultipleChoiceList,
|
|
7843
|
+
{
|
|
7844
|
+
choices,
|
|
7845
|
+
name: questionKey,
|
|
7846
|
+
selectedValues: stableSelectedValues,
|
|
7847
|
+
onHandleSelectedValues: handleSelectedValues,
|
|
7848
|
+
mode: variant === "default" ? "interactive" : "readonly"
|
|
7849
|
+
},
|
|
7850
|
+
questionKey
|
|
7851
|
+
) }) })
|
|
7852
|
+
] });
|
|
7828
7853
|
};
|
|
7829
7854
|
var QuizDissertative = ({
|
|
7830
|
-
variant = "default"
|
|
7855
|
+
variant = "default",
|
|
7856
|
+
paddingBottom
|
|
7831
7857
|
}) => {
|
|
7832
7858
|
const { getCurrentQuestion, getCurrentAnswer, selectDissertativeAnswer } = useQuizStore();
|
|
7833
7859
|
const currentQuestion = getCurrentQuestion();
|
|
@@ -7854,17 +7880,388 @@ var QuizDissertative = ({
|
|
|
7854
7880
|
if (!currentQuestion) {
|
|
7855
7881
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-text-600 text-md", children: "Nenhuma quest\xE3o dispon\xEDvel" }) });
|
|
7856
7882
|
}
|
|
7857
|
-
return /* @__PURE__ */ (0, import_jsx_runtime37.
|
|
7858
|
-
|
|
7883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
7884
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizSubTitle, { subTitle: "Resposta" }),
|
|
7885
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizContainer, { className: cn(variant != "result" && paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "space-y-4 max-h-[600px] overflow-y-auto", children: variant === "default" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7886
|
+
TextArea_default,
|
|
7887
|
+
{
|
|
7888
|
+
ref: textareaRef,
|
|
7889
|
+
placeholder: "Escreva sua resposta",
|
|
7890
|
+
value: currentAnswer?.answer || "",
|
|
7891
|
+
onChange: (e) => handleAnswerChange(e.target.value),
|
|
7892
|
+
rows: 4,
|
|
7893
|
+
className: "min-h-[120px] max-h-[400px] resize-none overflow-y-auto"
|
|
7894
|
+
}
|
|
7895
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: currentAnswer?.answer || "Nenhuma resposta fornecida" }) }) }) }),
|
|
7896
|
+
variant === "result" && currentAnswer?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
7897
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizSubTitle, { subTitle: "Observa\xE7\xE3o do professor" }),
|
|
7898
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime37.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." }) })
|
|
7899
|
+
] })
|
|
7900
|
+
] });
|
|
7901
|
+
};
|
|
7902
|
+
var QuizTrueOrFalse = ({
|
|
7903
|
+
variant = "default",
|
|
7904
|
+
paddingBottom
|
|
7905
|
+
}) => {
|
|
7906
|
+
const options = [
|
|
7907
|
+
{
|
|
7908
|
+
label: "25 metros",
|
|
7909
|
+
isCorrect: true
|
|
7910
|
+
},
|
|
7911
|
+
{
|
|
7912
|
+
label: "30 metros",
|
|
7913
|
+
isCorrect: false
|
|
7914
|
+
},
|
|
7859
7915
|
{
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7916
|
+
label: "40 metros",
|
|
7917
|
+
isCorrect: false
|
|
7918
|
+
},
|
|
7919
|
+
{
|
|
7920
|
+
label: "50 metros",
|
|
7921
|
+
isCorrect: false
|
|
7866
7922
|
}
|
|
7867
|
-
|
|
7923
|
+
];
|
|
7924
|
+
const getLetterByIndex = (index) => String.fromCharCode(97 + index);
|
|
7925
|
+
const isDefaultVariant = variant == "default";
|
|
7926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
7927
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
7928
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
7929
|
+
const variantCorrect = option.isCorrect ? "correct" : "incorrect";
|
|
7930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
7931
|
+
"section",
|
|
7932
|
+
{
|
|
7933
|
+
className: "flex flex-col gap-2",
|
|
7934
|
+
children: [
|
|
7935
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
7936
|
+
"div",
|
|
7937
|
+
{
|
|
7938
|
+
className: cn(
|
|
7939
|
+
"flex flex-row justify-between items-center gap-2 p-2 rounded-md",
|
|
7940
|
+
!isDefaultVariant ? getStatusStyles(variantCorrect) : ""
|
|
7941
|
+
),
|
|
7942
|
+
children: [
|
|
7943
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index).concat(") ").concat(option.label) }),
|
|
7944
|
+
isDefaultVariant ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Select_default, { size: "medium", children: [
|
|
7945
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectTrigger, { className: "w-[180px]", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectValue, { placeholder: "Selecione opc\xE3o" }) }),
|
|
7946
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(SelectContent, { children: [
|
|
7947
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectItem, { value: "V", children: "Verdadeiro" }),
|
|
7948
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectItem, { value: "F", children: "Falso" })
|
|
7949
|
+
] })
|
|
7950
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex-shrink-0", children: getStatusBadge(variantCorrect) })
|
|
7951
|
+
]
|
|
7952
|
+
}
|
|
7953
|
+
),
|
|
7954
|
+
!isDefaultVariant && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
7955
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-text-800 text-2xs", children: "Resposta selecionada: V" }),
|
|
7956
|
+
!option.isCorrect && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-text-800 text-2xs", children: "Resposta correta: F" })
|
|
7957
|
+
] })
|
|
7958
|
+
]
|
|
7959
|
+
},
|
|
7960
|
+
option.label.concat(`-${index}`)
|
|
7961
|
+
);
|
|
7962
|
+
}) }) })
|
|
7963
|
+
] });
|
|
7964
|
+
};
|
|
7965
|
+
var QuizConnectDots = ({
|
|
7966
|
+
variant = "default",
|
|
7967
|
+
paddingBottom
|
|
7968
|
+
}) => {
|
|
7969
|
+
const dotsOptions = [
|
|
7970
|
+
{ label: "Ra\xE7\xE3o" },
|
|
7971
|
+
{ label: "Rato" },
|
|
7972
|
+
{ label: "Grama" },
|
|
7973
|
+
{ label: "Peixe" }
|
|
7974
|
+
];
|
|
7975
|
+
const options = [
|
|
7976
|
+
{
|
|
7977
|
+
label: "Cachorro",
|
|
7978
|
+
correctOption: "Ra\xE7\xE3o"
|
|
7979
|
+
},
|
|
7980
|
+
{
|
|
7981
|
+
label: "Gato",
|
|
7982
|
+
correctOption: "Rato"
|
|
7983
|
+
},
|
|
7984
|
+
{
|
|
7985
|
+
label: "Cabra",
|
|
7986
|
+
correctOption: "Grama"
|
|
7987
|
+
},
|
|
7988
|
+
{
|
|
7989
|
+
label: "Baleia",
|
|
7990
|
+
correctOption: "Peixe"
|
|
7991
|
+
}
|
|
7992
|
+
];
|
|
7993
|
+
const mockUserAnswers = [
|
|
7994
|
+
{
|
|
7995
|
+
option: "Cachorro",
|
|
7996
|
+
dotOption: "Ra\xE7\xE3o",
|
|
7997
|
+
correctOption: "Ra\xE7\xE3o",
|
|
7998
|
+
isCorrect: true
|
|
7999
|
+
},
|
|
8000
|
+
{
|
|
8001
|
+
option: "Gato",
|
|
8002
|
+
dotOption: "Rato",
|
|
8003
|
+
correctOption: "Rato",
|
|
8004
|
+
isCorrect: true
|
|
8005
|
+
},
|
|
8006
|
+
{
|
|
8007
|
+
option: "Cabra",
|
|
8008
|
+
dotOption: "Peixe",
|
|
8009
|
+
correctOption: "Grama",
|
|
8010
|
+
isCorrect: false
|
|
8011
|
+
},
|
|
8012
|
+
{
|
|
8013
|
+
option: "Baleia",
|
|
8014
|
+
dotOption: "Grama",
|
|
8015
|
+
correctOption: "Peixe",
|
|
8016
|
+
isCorrect: false
|
|
8017
|
+
}
|
|
8018
|
+
];
|
|
8019
|
+
const [userAnswers, setUserAnswers] = (0, import_react25.useState)(() => {
|
|
8020
|
+
if (variant === "result") {
|
|
8021
|
+
return mockUserAnswers;
|
|
8022
|
+
}
|
|
8023
|
+
return options.map((option) => ({
|
|
8024
|
+
option: option.label,
|
|
8025
|
+
dotOption: null,
|
|
8026
|
+
correctOption: option.correctOption,
|
|
8027
|
+
isCorrect: null
|
|
8028
|
+
}));
|
|
8029
|
+
});
|
|
8030
|
+
const handleSelectDot = (optionIndex, dotValue) => {
|
|
8031
|
+
setUserAnswers((prev) => {
|
|
8032
|
+
const next = [...prev];
|
|
8033
|
+
const { label: optionLabel, correctOption } = options[optionIndex];
|
|
8034
|
+
next[optionIndex] = {
|
|
8035
|
+
option: optionLabel,
|
|
8036
|
+
dotOption: dotValue,
|
|
8037
|
+
correctOption,
|
|
8038
|
+
isCorrect: dotValue ? dotValue === correctOption : null
|
|
8039
|
+
};
|
|
8040
|
+
return next;
|
|
8041
|
+
});
|
|
8042
|
+
};
|
|
8043
|
+
const getLetterByIndex = (index) => String.fromCharCode(97 + index);
|
|
8044
|
+
const isDefaultVariant = variant === "default";
|
|
8045
|
+
const assignedDots = new Set(
|
|
8046
|
+
userAnswers.map((a) => a.dotOption).filter(Boolean)
|
|
8047
|
+
);
|
|
8048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
8049
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
8050
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
8051
|
+
const answer = userAnswers[index];
|
|
8052
|
+
const variantCorrect = answer.isCorrect ? "correct" : "incorrect";
|
|
8053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("section", { className: "flex flex-col gap-2", children: [
|
|
8054
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
8055
|
+
"div",
|
|
8056
|
+
{
|
|
8057
|
+
className: cn(
|
|
8058
|
+
"flex flex-row justify-between items-center gap-2 p-2 rounded-md",
|
|
8059
|
+
!isDefaultVariant ? getStatusStyles(variantCorrect) : ""
|
|
8060
|
+
),
|
|
8061
|
+
children: [
|
|
8062
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index) + ") " + option.label }),
|
|
8063
|
+
isDefaultVariant ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
8064
|
+
Select_default,
|
|
8065
|
+
{
|
|
8066
|
+
size: "medium",
|
|
8067
|
+
value: answer.dotOption || void 0,
|
|
8068
|
+
onValueChange: (value) => handleSelectDot(index, value),
|
|
8069
|
+
children: [
|
|
8070
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectTrigger, { className: "w-[180px]", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectValue, { placeholder: "Selecione op\xE7\xE3o" }) }),
|
|
8071
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectContent, { children: dotsOptions.filter(
|
|
8072
|
+
(dot) => !assignedDots.has(dot.label) || answer.dotOption === dot.label
|
|
8073
|
+
).map((dot) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectItem, { value: dot.label, children: dot.label }, dot.label)) })
|
|
8074
|
+
]
|
|
8075
|
+
}
|
|
8076
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex-shrink-0", children: answer.isCorrect === null ? null : getStatusBadge(variantCorrect) })
|
|
8077
|
+
]
|
|
8078
|
+
}
|
|
8079
|
+
),
|
|
8080
|
+
!isDefaultVariant && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
8081
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("p", { className: "text-text-800 text-2xs", children: [
|
|
8082
|
+
"Resposta selecionada: ",
|
|
8083
|
+
answer.dotOption || "Nenhuma"
|
|
8084
|
+
] }),
|
|
8085
|
+
!answer.isCorrect && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("p", { className: "text-text-800 text-2xs", children: [
|
|
8086
|
+
"Resposta correta: ",
|
|
8087
|
+
answer.correctOption
|
|
8088
|
+
] })
|
|
8089
|
+
] })
|
|
8090
|
+
] }, option.label);
|
|
8091
|
+
}) }) })
|
|
8092
|
+
] });
|
|
8093
|
+
};
|
|
8094
|
+
var QuizFill = ({
|
|
8095
|
+
variant = "default",
|
|
8096
|
+
paddingBottom = "pb-[80px]"
|
|
8097
|
+
}) => {
|
|
8098
|
+
const options = [
|
|
8099
|
+
"ci\xEAncia",
|
|
8100
|
+
"disciplina",
|
|
8101
|
+
"\xE1rea",
|
|
8102
|
+
"especialidade",
|
|
8103
|
+
"varia\xE7\xF5es"
|
|
8104
|
+
];
|
|
8105
|
+
const exampleText = `A meteorologia \xE9 a {{ciencia}} que estuda os fen\xF4menos atmosf\xE9ricos e suas {{varia\xE7\xF5es}}. Esta disciplina cient\xEDfica tem como objetivo principal {{objetivo}} o comportamento da atmosfera terrestre.
|
|
8106
|
+
|
|
8107
|
+
Os meteorologistas utilizam diversos {{instrumentos}} para coletar dados atmosf\xE9ricos, incluindo term\xF4metros, bar\xF4metros e {{equipamentos}} modernos como radares meteorol\xF3gicos.`;
|
|
8108
|
+
const mockUserAnswers = [
|
|
8109
|
+
{
|
|
8110
|
+
selectId: "ciencia",
|
|
8111
|
+
userAnswer: "tecnologia",
|
|
8112
|
+
correctAnswer: "ci\xEAncia",
|
|
8113
|
+
isCorrect: false
|
|
8114
|
+
},
|
|
8115
|
+
{
|
|
8116
|
+
selectId: "varia\xE7\xF5es",
|
|
8117
|
+
userAnswer: "varia\xE7\xF5es",
|
|
8118
|
+
correctAnswer: "varia\xE7\xF5es",
|
|
8119
|
+
isCorrect: true
|
|
8120
|
+
},
|
|
8121
|
+
{
|
|
8122
|
+
selectId: "objetivo",
|
|
8123
|
+
userAnswer: "estudar",
|
|
8124
|
+
correctAnswer: "compreender",
|
|
8125
|
+
isCorrect: false
|
|
8126
|
+
},
|
|
8127
|
+
{
|
|
8128
|
+
selectId: "instrumentos",
|
|
8129
|
+
userAnswer: "ferramentas",
|
|
8130
|
+
correctAnswer: "instrumentos",
|
|
8131
|
+
isCorrect: false
|
|
8132
|
+
},
|
|
8133
|
+
{
|
|
8134
|
+
selectId: "equipamentos",
|
|
8135
|
+
userAnswer: "equipamentos",
|
|
8136
|
+
correctAnswer: "equipamentos",
|
|
8137
|
+
isCorrect: true
|
|
8138
|
+
}
|
|
8139
|
+
];
|
|
8140
|
+
const [answers, setAnswers] = (0, import_react25.useState)({});
|
|
8141
|
+
const baseId = (0, import_react25.useId)();
|
|
8142
|
+
const getAvailableOptionsForSelect = (selectId) => {
|
|
8143
|
+
const usedOptions = Object.entries(answers).filter(([key]) => key !== selectId).map(([, value]) => value);
|
|
8144
|
+
return options.filter((option) => !usedOptions.includes(option));
|
|
8145
|
+
};
|
|
8146
|
+
const handleSelectChange = (selectId, value) => {
|
|
8147
|
+
const newAnswers = { ...answers, [selectId]: value };
|
|
8148
|
+
setAnswers(newAnswers);
|
|
8149
|
+
};
|
|
8150
|
+
const renderResolutionElement = (selectId) => {
|
|
8151
|
+
const mockAnswer = mockUserAnswers.find(
|
|
8152
|
+
(answer) => answer.selectId === selectId
|
|
8153
|
+
);
|
|
8154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "inline-flex mb-2.5 text-success-600 font-semibold text-md border-b-2 border-success-600", children: mockAnswer?.correctAnswer });
|
|
8155
|
+
};
|
|
8156
|
+
const renderDefaultElement = (selectId, startIndex, selectedValue, availableOptionsForThisSelect) => {
|
|
8157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
8158
|
+
Select_default,
|
|
8159
|
+
{
|
|
8160
|
+
value: selectedValue,
|
|
8161
|
+
onValueChange: (value) => handleSelectChange(selectId, value),
|
|
8162
|
+
className: "inline-flex mb-2.5",
|
|
8163
|
+
children: [
|
|
8164
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectTrigger, { className: "inline-flex w-auto min-w-[140px] h-8 mx-1 bg-white border-gray-300", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectValue, { placeholder: "Selecione op\xE7\xE3o" }) }),
|
|
8165
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectContent, { children: availableOptionsForThisSelect.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectItem, { value: option, children: option }, `${option}-${index}`)) })
|
|
8166
|
+
]
|
|
8167
|
+
},
|
|
8168
|
+
`${selectId}-${startIndex}`
|
|
8169
|
+
);
|
|
8170
|
+
};
|
|
8171
|
+
const renderResultElement = (selectId) => {
|
|
8172
|
+
const mockAnswer = mockUserAnswers.find(
|
|
8173
|
+
(answer) => answer.selectId === selectId
|
|
8174
|
+
);
|
|
8175
|
+
if (!mockAnswer) return null;
|
|
8176
|
+
const action = mockAnswer.isCorrect ? "success" : "error";
|
|
8177
|
+
const icon = mockAnswer.isCorrect ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_phosphor_react18.CheckCircle, {}) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_phosphor_react18.XCircle, {});
|
|
8178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8179
|
+
Badge_default,
|
|
8180
|
+
{
|
|
8181
|
+
variant: "solid",
|
|
8182
|
+
action,
|
|
8183
|
+
iconRight: icon,
|
|
8184
|
+
size: "large",
|
|
8185
|
+
className: "py-3 w-[180px] justify-between mb-2.5",
|
|
8186
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "text-text-900", children: mockAnswer.userAnswer })
|
|
8187
|
+
},
|
|
8188
|
+
selectId
|
|
8189
|
+
);
|
|
8190
|
+
};
|
|
8191
|
+
const renderTextWithSelects = (text, isResolution) => {
|
|
8192
|
+
const elements = [];
|
|
8193
|
+
let lastIndex = 0;
|
|
8194
|
+
let elementCounter = 0;
|
|
8195
|
+
const regex = /\{\{([\p{L}\p{M}\d_]+)\}\}/gu;
|
|
8196
|
+
let match;
|
|
8197
|
+
while ((match = regex.exec(text)) !== null) {
|
|
8198
|
+
const [fullMatch, selectId] = match;
|
|
8199
|
+
const startIndex = match.index;
|
|
8200
|
+
if (startIndex > lastIndex) {
|
|
8201
|
+
elements.push({
|
|
8202
|
+
element: text.slice(lastIndex, startIndex),
|
|
8203
|
+
id: `${baseId}-text-${++elementCounter}`
|
|
8204
|
+
});
|
|
8205
|
+
}
|
|
8206
|
+
const selectedValue = answers[selectId];
|
|
8207
|
+
const availableOptionsForThisSelect = getAvailableOptionsForSelect(selectId);
|
|
8208
|
+
if (isResolution) {
|
|
8209
|
+
elements.push({
|
|
8210
|
+
element: renderResolutionElement(selectId),
|
|
8211
|
+
id: `${baseId}-resolution-${++elementCounter}`
|
|
8212
|
+
});
|
|
8213
|
+
} else if (variant === "default") {
|
|
8214
|
+
elements.push({
|
|
8215
|
+
element: renderDefaultElement(
|
|
8216
|
+
selectId,
|
|
8217
|
+
startIndex,
|
|
8218
|
+
selectedValue,
|
|
8219
|
+
availableOptionsForThisSelect
|
|
8220
|
+
),
|
|
8221
|
+
id: `${baseId}-select-${++elementCounter}`
|
|
8222
|
+
});
|
|
8223
|
+
} else {
|
|
8224
|
+
const resultElement = renderResultElement(selectId);
|
|
8225
|
+
if (resultElement) {
|
|
8226
|
+
elements.push({
|
|
8227
|
+
element: resultElement,
|
|
8228
|
+
id: `${baseId}-result-${++elementCounter}`
|
|
8229
|
+
});
|
|
8230
|
+
}
|
|
8231
|
+
}
|
|
8232
|
+
lastIndex = match.index + fullMatch.length;
|
|
8233
|
+
}
|
|
8234
|
+
if (lastIndex < text.length) {
|
|
8235
|
+
elements.push({
|
|
8236
|
+
element: text.slice(lastIndex),
|
|
8237
|
+
id: `${baseId}-text-${++elementCounter}`
|
|
8238
|
+
});
|
|
8239
|
+
}
|
|
8240
|
+
return elements;
|
|
8241
|
+
};
|
|
8242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
8243
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
8244
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizContainer, { className: "h-auto pb-0", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "space-y-6 px-4 h-auto", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8245
|
+
"div",
|
|
8246
|
+
{
|
|
8247
|
+
className: cn(
|
|
8248
|
+
"text-lg text-text-900 leading-8 h-auto",
|
|
8249
|
+
variant != "result" && paddingBottom
|
|
8250
|
+
),
|
|
8251
|
+
children: renderTextWithSelects(exampleText).map((element) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: element.element }, element.id))
|
|
8252
|
+
}
|
|
8253
|
+
) }) }),
|
|
8254
|
+
variant === "result" && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
8255
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizSubTitle, { subTitle: "Resultado" }),
|
|
8256
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(QuizContainer, { className: "h-auto pb-0", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "space-y-6 px-4", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8257
|
+
"div",
|
|
8258
|
+
{
|
|
8259
|
+
className: cn("text-lg text-text-900 leading-8", paddingBottom),
|
|
8260
|
+
children: renderTextWithSelects(exampleText, true).map((element) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { children: element.element }, element.id))
|
|
8261
|
+
}
|
|
8262
|
+
) }) })
|
|
8263
|
+
] })
|
|
8264
|
+
] });
|
|
7868
8265
|
};
|
|
7869
8266
|
var QuizQuestionList = ({
|
|
7870
8267
|
filterType = "all",
|
|
@@ -8457,6 +8854,7 @@ var QuizListResultByMateria = ({
|
|
|
8457
8854
|
PublicRoute,
|
|
8458
8855
|
Quiz,
|
|
8459
8856
|
QuizAlternative,
|
|
8857
|
+
QuizConnectDots,
|
|
8460
8858
|
QuizContent,
|
|
8461
8859
|
QuizDissertative,
|
|
8462
8860
|
QuizFooter,
|
|
@@ -8470,6 +8868,7 @@ var QuizListResultByMateria = ({
|
|
|
8470
8868
|
QuizResultPerformance,
|
|
8471
8869
|
QuizResultTitle,
|
|
8472
8870
|
QuizTitle,
|
|
8871
|
+
QuizTrueOrFalse,
|
|
8473
8872
|
Radio,
|
|
8474
8873
|
RadioGroup,
|
|
8475
8874
|
RadioGroupItem,
|
|
@@ -8496,6 +8895,7 @@ var QuizListResultByMateria = ({
|
|
|
8496
8895
|
Toaster,
|
|
8497
8896
|
createZustandAuthAdapter,
|
|
8498
8897
|
getRootDomain,
|
|
8898
|
+
getStatusBadge,
|
|
8499
8899
|
useApiConfig,
|
|
8500
8900
|
useAuth,
|
|
8501
8901
|
useAuthGuard,
|