analytica-frontend-lib 1.2.67 → 1.2.69
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/ActivityCardQuestionBanks/index.js +827 -244
- package/dist/ActivityCardQuestionBanks/index.js.map +1 -1
- package/dist/ActivityCardQuestionBanks/index.mjs +828 -237
- package/dist/ActivityCardQuestionBanks/index.mjs.map +1 -1
- package/dist/ActivityCardQuestionPreview/index.js +650 -67
- package/dist/ActivityCardQuestionPreview/index.js.map +1 -1
- package/dist/ActivityCardQuestionPreview/index.mjs +655 -64
- package/dist/ActivityCardQuestionPreview/index.mjs.map +1 -1
- package/dist/ActivityDetails/index.d.ts +6 -4
- package/dist/ActivityDetails/index.d.ts.map +1 -1
- package/dist/ActivityDetails/index.js +2381 -1007
- package/dist/ActivityDetails/index.js.map +1 -1
- package/dist/ActivityDetails/index.mjs +2352 -953
- package/dist/ActivityDetails/index.mjs.map +1 -1
- package/dist/ActivityPreview/index.js +1175 -592
- package/dist/ActivityPreview/index.js.map +1 -1
- package/dist/ActivityPreview/index.mjs +1171 -580
- package/dist/ActivityPreview/index.mjs.map +1 -1
- package/dist/CorrectActivityModal/index.d.ts +4 -2
- package/dist/CorrectActivityModal/index.d.ts.map +1 -1
- package/dist/CorrectActivityModal/index.js +1999 -527
- package/dist/CorrectActivityModal/index.js.map +1 -1
- package/dist/CorrectActivityModal/index.mjs +2030 -529
- package/dist/CorrectActivityModal/index.mjs.map +1 -1
- package/dist/Quiz/index.js +2 -0
- package/dist/Quiz/index.js.map +1 -1
- package/dist/Quiz/index.mjs +2 -0
- package/dist/Quiz/index.mjs.map +1 -1
- package/dist/hooks/useSendActivity/index.d.ts +47 -0
- package/dist/hooks/useSendActivity/index.d.ts.map +1 -0
- package/dist/hooks/useSendActivity/index.js +194 -0
- package/dist/hooks/useSendActivity/index.js.map +1 -0
- package/dist/hooks/useSendActivity/index.mjs +159 -0
- package/dist/hooks/useSendActivity/index.mjs.map +1 -0
- package/dist/hooks/useSendActivity.d.ts +47 -0
- package/dist/hooks/useSendActivity.d.ts.map +1 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10284 -9202
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10170 -9087
- package/dist/index.mjs.map +1 -1
- package/dist/types/activities/index.d.ts +81 -0
- package/dist/types/activities/index.d.ts.map +1 -0
- package/dist/types/activities/index.js +52 -0
- package/dist/types/activities/index.js.map +1 -0
- package/dist/types/activities/index.mjs +25 -0
- package/dist/types/activities/index.mjs.map +1 -0
- package/dist/types/activities.d.ts +81 -0
- package/dist/types/activities.d.ts.map +1 -0
- package/dist/types/sendActivity/index.d.ts +127 -0
- package/dist/types/sendActivity/index.d.ts.map +1 -0
- package/dist/types/sendActivity/index.js +19 -0
- package/dist/types/sendActivity/index.js.map +1 -0
- package/dist/types/sendActivity/index.mjs +1 -0
- package/dist/types/sendActivity/index.mjs.map +1 -0
- package/dist/types/sendActivity.d.ts +127 -0
- package/dist/types/sendActivity.d.ts.map +1 -0
- package/dist/utils/questionRenderer/alternative/index.d.ts +8 -0
- package/dist/utils/questionRenderer/alternative/index.d.ts.map +1 -0
- package/dist/utils/questionRenderer/components/index.d.ts +25 -0
- package/dist/utils/questionRenderer/components/index.d.ts.map +1 -0
- package/dist/utils/questionRenderer/connectDots/index.d.ts +8 -0
- package/dist/utils/questionRenderer/connectDots/index.d.ts.map +1 -0
- package/dist/utils/questionRenderer/dissertative/index.d.ts +8 -0
- package/dist/utils/questionRenderer/dissertative/index.d.ts.map +1 -0
- package/dist/utils/questionRenderer/fill/index.d.ts +10 -0
- package/dist/utils/questionRenderer/fill/index.d.ts.map +1 -0
- package/dist/utils/questionRenderer/image/index.d.ts +8 -0
- package/dist/utils/questionRenderer/image/index.d.ts.map +1 -0
- package/dist/utils/questionRenderer/index.d.ts +31 -0
- package/dist/utils/questionRenderer/index.d.ts.map +1 -0
- package/dist/utils/questionRenderer/multipleChoice/index.d.ts +8 -0
- package/dist/utils/questionRenderer/multipleChoice/index.d.ts.map +1 -0
- package/dist/utils/questionRenderer/trueOrFalse/index.d.ts +9 -0
- package/dist/utils/questionRenderer/trueOrFalse/index.d.ts.map +1 -0
- package/dist/utils/questionRenderer/types.d.ts +14 -0
- package/dist/utils/questionRenderer/types.d.ts.map +1 -0
- package/dist/utils/studentActivityCorrection/constants.d.ts +13 -0
- package/dist/utils/studentActivityCorrection/constants.d.ts.map +1 -0
- package/dist/utils/studentActivityCorrection/converter.d.ts +13 -0
- package/dist/utils/studentActivityCorrection/converter.d.ts.map +1 -0
- package/dist/utils/studentActivityCorrection/index.d.ts +13 -0
- package/dist/utils/studentActivityCorrection/index.d.ts.map +1 -0
- package/dist/utils/studentActivityCorrection/types.d.ts +84 -0
- package/dist/utils/studentActivityCorrection/types.d.ts.map +1 -0
- package/dist/utils/studentActivityCorrection/utils.d.ts +30 -0
- package/dist/utils/studentActivityCorrection/utils.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/types/studentActivityCorrection.d.ts +0 -62
- package/dist/types/studentActivityCorrection.d.ts.map +0 -1
- package/dist/utils/questionRenderer.d.ts +0 -5
- package/dist/utils/questionRenderer.d.ts.map +0 -1
|
@@ -33,8 +33,8 @@ __export(CorrectActivityModal_exports, {
|
|
|
33
33
|
default: () => CorrectActivityModal_default
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(CorrectActivityModal_exports);
|
|
36
|
-
var
|
|
37
|
-
var
|
|
36
|
+
var import_react15 = require("react");
|
|
37
|
+
var import_phosphor_react12 = require("phosphor-react");
|
|
38
38
|
|
|
39
39
|
// src/components/Modal/Modal.tsx
|
|
40
40
|
var import_react = require("react");
|
|
@@ -493,9 +493,6 @@ var Badge = ({
|
|
|
493
493
|
};
|
|
494
494
|
var Badge_default = Badge;
|
|
495
495
|
|
|
496
|
-
// src/components/Alternative/Alternative.tsx
|
|
497
|
-
var import_phosphor_react3 = require("phosphor-react");
|
|
498
|
-
|
|
499
496
|
// src/components/Radio/Radio.tsx
|
|
500
497
|
var import_react2 = require("react");
|
|
501
498
|
var import_zustand = require("zustand");
|
|
@@ -876,305 +873,210 @@ var RadioGroupItem = (0, import_react2.forwardRef)(
|
|
|
876
873
|
}
|
|
877
874
|
);
|
|
878
875
|
RadioGroupItem.displayName = "RadioGroupItem";
|
|
876
|
+
var Radio_default = Radio;
|
|
879
877
|
|
|
880
|
-
// src/components/
|
|
878
|
+
// src/components/TextArea/TextArea.tsx
|
|
881
879
|
var import_react3 = require("react");
|
|
880
|
+
var import_phosphor_react3 = require("phosphor-react");
|
|
882
881
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
883
|
-
var AlternativesList = ({
|
|
884
|
-
alternatives,
|
|
885
|
-
name,
|
|
886
|
-
defaultValue,
|
|
887
|
-
value,
|
|
888
|
-
onValueChange,
|
|
889
|
-
disabled = false,
|
|
890
|
-
layout = "default",
|
|
891
|
-
className = "",
|
|
892
|
-
mode = "interactive",
|
|
893
|
-
selectedValue
|
|
894
|
-
}) => {
|
|
895
|
-
const uniqueId = (0, import_react3.useId)();
|
|
896
|
-
const groupName = name || `alternatives-${uniqueId}`;
|
|
897
|
-
const [actualValue, setActualValue] = (0, import_react3.useState)(value);
|
|
898
|
-
const isReadonly = mode === "readonly";
|
|
899
|
-
const getStatusStyles = (status, isReadonly2) => {
|
|
900
|
-
const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
|
|
901
|
-
switch (status) {
|
|
902
|
-
case "correct":
|
|
903
|
-
return "bg-success-background border-success-300";
|
|
904
|
-
case "incorrect":
|
|
905
|
-
return "bg-error-background border-error-300";
|
|
906
|
-
default:
|
|
907
|
-
return `bg-background border-border-100 ${hoverClass}`;
|
|
908
|
-
}
|
|
909
|
-
};
|
|
910
|
-
const getStatusBadge = (status) => {
|
|
911
|
-
switch (status) {
|
|
912
|
-
case "correct":
|
|
913
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_phosphor_react3.CheckCircle, {}), children: "Resposta correta" });
|
|
914
|
-
case "incorrect":
|
|
915
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_phosphor_react3.XCircle, {}), children: "Resposta incorreta" });
|
|
916
|
-
default:
|
|
917
|
-
return null;
|
|
918
|
-
}
|
|
919
|
-
};
|
|
920
|
-
const getLayoutClasses = () => {
|
|
921
|
-
switch (layout) {
|
|
922
|
-
case "compact":
|
|
923
|
-
return "gap-2";
|
|
924
|
-
case "detailed":
|
|
925
|
-
return "gap-4";
|
|
926
|
-
default:
|
|
927
|
-
return "gap-3.5";
|
|
928
|
-
}
|
|
929
|
-
};
|
|
930
|
-
const renderReadonlyAlternative = (alternative) => {
|
|
931
|
-
const alternativeId = alternative.value;
|
|
932
|
-
const isUserSelected = selectedValue === alternative.value;
|
|
933
|
-
const isCorrectAnswer = alternative.status === "correct";
|
|
934
|
-
let displayStatus = void 0;
|
|
935
|
-
if (isUserSelected && !isCorrectAnswer) {
|
|
936
|
-
displayStatus = "incorrect";
|
|
937
|
-
} else if (isCorrectAnswer) {
|
|
938
|
-
displayStatus = "correct";
|
|
939
|
-
}
|
|
940
|
-
const statusStyles = getStatusStyles(displayStatus, true);
|
|
941
|
-
const statusBadge = getStatusBadge(displayStatus);
|
|
942
|
-
const renderRadio = () => {
|
|
943
|
-
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"}`;
|
|
944
|
-
const dotClasses = "w-3 h-3 rounded-full bg-primary-950 transition-all duration-200";
|
|
945
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: radioClasses, children: isUserSelected && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: dotClasses }) });
|
|
946
|
-
};
|
|
947
|
-
if (layout === "detailed") {
|
|
948
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
949
|
-
"div",
|
|
950
|
-
{
|
|
951
|
-
className: cn(
|
|
952
|
-
"border-2 rounded-lg p-4 w-full",
|
|
953
|
-
statusStyles,
|
|
954
|
-
alternative.disabled ? "opacity-50" : ""
|
|
955
|
-
),
|
|
956
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
957
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
958
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "mt-1", children: renderRadio() }),
|
|
959
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex-1", children: [
|
|
960
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
961
|
-
"p",
|
|
962
|
-
{
|
|
963
|
-
className: cn(
|
|
964
|
-
"block font-medium",
|
|
965
|
-
selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
|
|
966
|
-
),
|
|
967
|
-
children: alternative.label
|
|
968
|
-
}
|
|
969
|
-
),
|
|
970
|
-
alternative.description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
|
|
971
|
-
] })
|
|
972
|
-
] }),
|
|
973
|
-
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
974
|
-
] })
|
|
975
|
-
},
|
|
976
|
-
alternativeId
|
|
977
|
-
);
|
|
978
|
-
}
|
|
979
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
980
|
-
"div",
|
|
981
|
-
{
|
|
982
|
-
className: cn(
|
|
983
|
-
"flex flex-row justify-between items-start gap-2 p-2 rounded-lg w-full",
|
|
984
|
-
statusStyles,
|
|
985
|
-
alternative.disabled ? "opacity-50" : ""
|
|
986
|
-
),
|
|
987
|
-
children: [
|
|
988
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
989
|
-
renderRadio(),
|
|
990
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
991
|
-
"span",
|
|
992
|
-
{
|
|
993
|
-
className: cn(
|
|
994
|
-
"flex-1",
|
|
995
|
-
selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
|
|
996
|
-
),
|
|
997
|
-
children: alternative.label
|
|
998
|
-
}
|
|
999
|
-
)
|
|
1000
|
-
] }),
|
|
1001
|
-
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
1002
|
-
]
|
|
1003
|
-
},
|
|
1004
|
-
alternativeId
|
|
1005
|
-
);
|
|
1006
|
-
};
|
|
1007
|
-
if (isReadonly) {
|
|
1008
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1009
|
-
"div",
|
|
1010
|
-
{
|
|
1011
|
-
className: cn("flex flex-col", getLayoutClasses(), "w-full", className),
|
|
1012
|
-
children: alternatives.map(
|
|
1013
|
-
(alternative) => renderReadonlyAlternative(alternative)
|
|
1014
|
-
)
|
|
1015
|
-
}
|
|
1016
|
-
);
|
|
1017
|
-
}
|
|
1018
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1019
|
-
RadioGroup,
|
|
1020
|
-
{
|
|
1021
|
-
name: groupName,
|
|
1022
|
-
defaultValue,
|
|
1023
|
-
value,
|
|
1024
|
-
onValueChange: (value2) => {
|
|
1025
|
-
setActualValue(value2);
|
|
1026
|
-
onValueChange?.(value2);
|
|
1027
|
-
},
|
|
1028
|
-
disabled,
|
|
1029
|
-
className: cn("flex flex-col", getLayoutClasses(), className),
|
|
1030
|
-
children: alternatives.map((alternative, index) => {
|
|
1031
|
-
const alternativeId = alternative.value || `alt-${index}`;
|
|
1032
|
-
const statusStyles = getStatusStyles(alternative.status, false);
|
|
1033
|
-
const statusBadge = getStatusBadge(alternative.status);
|
|
1034
|
-
if (layout === "detailed") {
|
|
1035
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1036
|
-
"div",
|
|
1037
|
-
{
|
|
1038
|
-
className: cn(
|
|
1039
|
-
"border-2 rounded-lg p-4 transition-all",
|
|
1040
|
-
statusStyles,
|
|
1041
|
-
alternative.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
1042
|
-
),
|
|
1043
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
1044
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
1045
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1046
|
-
RadioGroupItem,
|
|
1047
|
-
{
|
|
1048
|
-
value: alternative.value,
|
|
1049
|
-
id: alternativeId,
|
|
1050
|
-
disabled: alternative.disabled,
|
|
1051
|
-
className: "mt-1"
|
|
1052
|
-
}
|
|
1053
|
-
),
|
|
1054
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex-1", children: [
|
|
1055
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1056
|
-
"label",
|
|
1057
|
-
{
|
|
1058
|
-
htmlFor: alternativeId,
|
|
1059
|
-
className: cn(
|
|
1060
|
-
"block font-medium",
|
|
1061
|
-
actualValue === alternative.value ? "text-text-950" : "text-text-600",
|
|
1062
|
-
alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
1063
|
-
),
|
|
1064
|
-
children: alternative.label
|
|
1065
|
-
}
|
|
1066
|
-
),
|
|
1067
|
-
alternative.description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
|
|
1068
|
-
] })
|
|
1069
|
-
] }),
|
|
1070
|
-
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
1071
|
-
] })
|
|
1072
|
-
},
|
|
1073
|
-
alternativeId
|
|
1074
|
-
);
|
|
1075
|
-
}
|
|
1076
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1077
|
-
"div",
|
|
1078
|
-
{
|
|
1079
|
-
className: cn(
|
|
1080
|
-
"flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
|
|
1081
|
-
statusStyles,
|
|
1082
|
-
alternative.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
1083
|
-
),
|
|
1084
|
-
children: [
|
|
1085
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
1086
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1087
|
-
RadioGroupItem,
|
|
1088
|
-
{
|
|
1089
|
-
value: alternative.value,
|
|
1090
|
-
id: alternativeId,
|
|
1091
|
-
disabled: alternative.disabled
|
|
1092
|
-
}
|
|
1093
|
-
),
|
|
1094
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1095
|
-
"label",
|
|
1096
|
-
{
|
|
1097
|
-
htmlFor: alternativeId,
|
|
1098
|
-
className: cn(
|
|
1099
|
-
"flex-1",
|
|
1100
|
-
actualValue === alternative.value ? "text-text-950" : "text-text-600",
|
|
1101
|
-
alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
1102
|
-
),
|
|
1103
|
-
children: alternative.label
|
|
1104
|
-
}
|
|
1105
|
-
)
|
|
1106
|
-
] }),
|
|
1107
|
-
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
1108
|
-
]
|
|
1109
|
-
},
|
|
1110
|
-
alternativeId
|
|
1111
|
-
);
|
|
1112
|
-
})
|
|
1113
|
-
}
|
|
1114
|
-
);
|
|
1115
|
-
};
|
|
1116
|
-
var HeaderAlternative = (0, import_react3.forwardRef)(
|
|
1117
|
-
({ className, title, subTitle, content, ...props }, ref) => {
|
|
1118
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1119
|
-
"div",
|
|
1120
|
-
{
|
|
1121
|
-
ref,
|
|
1122
|
-
className: cn(
|
|
1123
|
-
"bg-background p-4 flex flex-col gap-4 rounded-xl",
|
|
1124
|
-
className
|
|
1125
|
-
),
|
|
1126
|
-
...props,
|
|
1127
|
-
children: [
|
|
1128
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "flex flex-col", children: [
|
|
1129
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-text-950 font-bold text-lg", children: title }),
|
|
1130
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-text-700 text-sm ", children: subTitle })
|
|
1131
|
-
] }),
|
|
1132
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-text-950 text-md", children: content })
|
|
1133
|
-
]
|
|
1134
|
-
}
|
|
1135
|
-
);
|
|
1136
|
-
}
|
|
1137
|
-
);
|
|
1138
|
-
|
|
1139
|
-
// src/components/Accordation/Accordation.tsx
|
|
1140
|
-
var import_react6 = require("react");
|
|
1141
|
-
|
|
1142
|
-
// src/components/Card/Card.tsx
|
|
1143
|
-
var import_react5 = require("react");
|
|
1144
|
-
|
|
1145
|
-
// src/components/ProgressBar/ProgressBar.tsx
|
|
1146
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1147
882
|
var SIZE_CLASSES5 = {
|
|
1148
883
|
small: {
|
|
1149
|
-
|
|
1150
|
-
//
|
|
1151
|
-
|
|
1152
|
-
// 4px height for the fill bar
|
|
1153
|
-
spacing: "gap-2",
|
|
1154
|
-
// 8px gap between label and progress bar
|
|
1155
|
-
layout: "flex-col",
|
|
1156
|
-
// vertical layout for small
|
|
1157
|
-
borderRadius: "rounded-full"
|
|
1158
|
-
// 9999px border radius
|
|
884
|
+
textarea: "h-24 text-sm",
|
|
885
|
+
// 96px height, 14px font
|
|
886
|
+
textSize: "sm"
|
|
1159
887
|
},
|
|
1160
888
|
medium: {
|
|
1161
|
-
|
|
1162
|
-
//
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
889
|
+
textarea: "h-24 text-base",
|
|
890
|
+
// 96px height, 16px font
|
|
891
|
+
textSize: "md"
|
|
892
|
+
},
|
|
893
|
+
large: {
|
|
894
|
+
textarea: "h-24 text-lg",
|
|
895
|
+
// 96px height, 18px font
|
|
896
|
+
textSize: "lg"
|
|
897
|
+
},
|
|
898
|
+
extraLarge: {
|
|
899
|
+
textarea: "h-24 text-xl",
|
|
900
|
+
// 96px height, 20px font
|
|
901
|
+
textSize: "xl"
|
|
1171
902
|
}
|
|
1172
903
|
};
|
|
1173
|
-
var
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
904
|
+
var BASE_TEXTAREA_CLASSES = "w-full box-border p-3 bg-background border border-solid rounded-[4px] resize-none focus:outline-none font-roboto font-normal leading-[150%] placeholder:text-text-600 transition-all duration-200";
|
|
905
|
+
var STATE_CLASSES2 = {
|
|
906
|
+
default: {
|
|
907
|
+
base: "border-border-300 bg-background text-text-600",
|
|
908
|
+
hover: "hover:border-border-400",
|
|
909
|
+
focus: "focus:border-border-500"
|
|
910
|
+
},
|
|
911
|
+
hovered: {
|
|
912
|
+
base: "border-border-400 bg-background text-text-600",
|
|
913
|
+
hover: "",
|
|
914
|
+
focus: "focus:border-border-500"
|
|
915
|
+
},
|
|
916
|
+
focused: {
|
|
917
|
+
base: "border-2 border-primary-950 bg-background text-text-900",
|
|
918
|
+
hover: "",
|
|
919
|
+
focus: ""
|
|
920
|
+
},
|
|
921
|
+
invalid: {
|
|
922
|
+
base: "border-2 border-red-700 bg-white text-gray-800",
|
|
923
|
+
hover: "hover:border-red-700",
|
|
924
|
+
focus: "focus:border-red-700"
|
|
925
|
+
},
|
|
926
|
+
disabled: {
|
|
927
|
+
base: "border-border-300 bg-background text-text-600 cursor-not-allowed opacity-40",
|
|
928
|
+
hover: "",
|
|
929
|
+
focus: ""
|
|
930
|
+
}
|
|
931
|
+
};
|
|
932
|
+
var TextArea = (0, import_react3.forwardRef)(
|
|
933
|
+
({
|
|
934
|
+
label,
|
|
935
|
+
size = "medium",
|
|
936
|
+
state = "default",
|
|
937
|
+
errorMessage,
|
|
938
|
+
helperMessage,
|
|
939
|
+
className = "",
|
|
940
|
+
labelClassName = "",
|
|
941
|
+
disabled,
|
|
942
|
+
id,
|
|
943
|
+
onChange,
|
|
944
|
+
placeholder,
|
|
945
|
+
required,
|
|
946
|
+
showCharacterCount = false,
|
|
947
|
+
maxLength,
|
|
948
|
+
value,
|
|
949
|
+
...props
|
|
950
|
+
}, ref) => {
|
|
951
|
+
const generatedId = (0, import_react3.useId)();
|
|
952
|
+
const inputId = id ?? `textarea-${generatedId}`;
|
|
953
|
+
const [isFocused, setIsFocused] = (0, import_react3.useState)(false);
|
|
954
|
+
const currentLength = typeof value === "string" ? value.length : 0;
|
|
955
|
+
const isNearLimit = maxLength && currentLength >= maxLength * 0.8;
|
|
956
|
+
const handleChange = (event) => {
|
|
957
|
+
onChange?.(event);
|
|
958
|
+
};
|
|
959
|
+
const handleFocus = (event) => {
|
|
960
|
+
setIsFocused(true);
|
|
961
|
+
props.onFocus?.(event);
|
|
962
|
+
};
|
|
963
|
+
const handleBlur = (event) => {
|
|
964
|
+
setIsFocused(false);
|
|
965
|
+
props.onBlur?.(event);
|
|
966
|
+
};
|
|
967
|
+
let currentState = disabled ? "disabled" : state;
|
|
968
|
+
if (isFocused && currentState !== "invalid" && currentState !== "disabled") {
|
|
969
|
+
currentState = "focused";
|
|
970
|
+
}
|
|
971
|
+
const sizeClasses = SIZE_CLASSES5[size];
|
|
972
|
+
const stateClasses = STATE_CLASSES2[currentState];
|
|
973
|
+
const textareaClasses = cn(
|
|
974
|
+
BASE_TEXTAREA_CLASSES,
|
|
975
|
+
sizeClasses.textarea,
|
|
976
|
+
stateClasses.base,
|
|
977
|
+
stateClasses.hover,
|
|
978
|
+
stateClasses.focus,
|
|
979
|
+
className
|
|
980
|
+
);
|
|
981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: `flex flex-col`, children: [
|
|
982
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
983
|
+
Text_default,
|
|
984
|
+
{
|
|
985
|
+
as: "label",
|
|
986
|
+
htmlFor: inputId,
|
|
987
|
+
size: sizeClasses.textSize,
|
|
988
|
+
weight: "medium",
|
|
989
|
+
color: "text-text-950",
|
|
990
|
+
className: cn("mb-1.5", labelClassName),
|
|
991
|
+
children: [
|
|
992
|
+
label,
|
|
993
|
+
" ",
|
|
994
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-indicator-error", children: "*" })
|
|
995
|
+
]
|
|
996
|
+
}
|
|
997
|
+
),
|
|
998
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
999
|
+
"textarea",
|
|
1000
|
+
{
|
|
1001
|
+
ref,
|
|
1002
|
+
id: inputId,
|
|
1003
|
+
disabled,
|
|
1004
|
+
onChange: handleChange,
|
|
1005
|
+
onFocus: handleFocus,
|
|
1006
|
+
onBlur: handleBlur,
|
|
1007
|
+
className: textareaClasses,
|
|
1008
|
+
placeholder,
|
|
1009
|
+
required,
|
|
1010
|
+
maxLength,
|
|
1011
|
+
value,
|
|
1012
|
+
...props
|
|
1013
|
+
}
|
|
1014
|
+
),
|
|
1015
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "flex gap-1 items-center text-sm text-indicator-error mt-1.5", children: [
|
|
1016
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_phosphor_react3.WarningCircle, { size: 16 }),
|
|
1017
|
+
" ",
|
|
1018
|
+
errorMessage
|
|
1019
|
+
] }),
|
|
1020
|
+
!errorMessage && showCharacterCount && maxLength && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1021
|
+
Text_default,
|
|
1022
|
+
{
|
|
1023
|
+
size: "sm",
|
|
1024
|
+
weight: "normal",
|
|
1025
|
+
className: `mt-1.5 ${isNearLimit ? "text-indicator-warning" : "text-text-500"}`,
|
|
1026
|
+
children: [
|
|
1027
|
+
currentLength,
|
|
1028
|
+
"/",
|
|
1029
|
+
maxLength,
|
|
1030
|
+
" caracteres"
|
|
1031
|
+
]
|
|
1032
|
+
}
|
|
1033
|
+
),
|
|
1034
|
+
!errorMessage && helperMessage && !(showCharacterCount && maxLength) && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text_default, { size: "sm", weight: "normal", className: "mt-1.5 text-text-500", children: helperMessage })
|
|
1035
|
+
] });
|
|
1036
|
+
}
|
|
1037
|
+
);
|
|
1038
|
+
TextArea.displayName = "TextArea";
|
|
1039
|
+
var TextArea_default = TextArea;
|
|
1040
|
+
|
|
1041
|
+
// src/components/Accordation/Accordation.tsx
|
|
1042
|
+
var import_react6 = require("react");
|
|
1043
|
+
|
|
1044
|
+
// src/components/Card/Card.tsx
|
|
1045
|
+
var import_react5 = require("react");
|
|
1046
|
+
|
|
1047
|
+
// src/components/ProgressBar/ProgressBar.tsx
|
|
1048
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1049
|
+
var SIZE_CLASSES6 = {
|
|
1050
|
+
small: {
|
|
1051
|
+
container: "h-1",
|
|
1052
|
+
// 4px height (h-1 = 4px in Tailwind)
|
|
1053
|
+
bar: "h-1",
|
|
1054
|
+
// 4px height for the fill bar
|
|
1055
|
+
spacing: "gap-2",
|
|
1056
|
+
// 8px gap between label and progress bar
|
|
1057
|
+
layout: "flex-col",
|
|
1058
|
+
// vertical layout for small
|
|
1059
|
+
borderRadius: "rounded-full"
|
|
1060
|
+
// 9999px border radius
|
|
1061
|
+
},
|
|
1062
|
+
medium: {
|
|
1063
|
+
container: "h-2",
|
|
1064
|
+
// 8px height (h-2 = 8px in Tailwind)
|
|
1065
|
+
bar: "h-2",
|
|
1066
|
+
// 8px height for the fill bar
|
|
1067
|
+
spacing: "gap-2",
|
|
1068
|
+
// 8px gap between progress bar and label
|
|
1069
|
+
layout: "flex-row items-center",
|
|
1070
|
+
// horizontal layout for medium
|
|
1071
|
+
borderRadius: "rounded-lg"
|
|
1072
|
+
// 8px border radius
|
|
1073
|
+
}
|
|
1074
|
+
};
|
|
1075
|
+
var VARIANT_CLASSES = {
|
|
1076
|
+
blue: {
|
|
1077
|
+
background: "bg-background-300",
|
|
1078
|
+
// Background track color (#D5D4D4)
|
|
1079
|
+
fill: "bg-primary-700"
|
|
1178
1080
|
// Blue for activity progress (#2271C4)
|
|
1179
1081
|
},
|
|
1180
1082
|
green: {
|
|
@@ -1555,7 +1457,7 @@ var ProgressBar = ({
|
|
|
1555
1457
|
compactHeight
|
|
1556
1458
|
}) => {
|
|
1557
1459
|
const { clampedValue, percentage } = calculateProgressValues(value, max);
|
|
1558
|
-
const sizeClasses =
|
|
1460
|
+
const sizeClasses = SIZE_CLASSES6[size];
|
|
1559
1461
|
const variantClasses = VARIANT_CLASSES[variant];
|
|
1560
1462
|
if (layout === "stacked") {
|
|
1561
1463
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
@@ -3305,7 +3207,7 @@ var generateFileId = () => {
|
|
|
3305
3207
|
return crypto.randomUUID();
|
|
3306
3208
|
};
|
|
3307
3209
|
|
|
3308
|
-
// src/
|
|
3210
|
+
// src/utils/studentActivityCorrection/constants.ts
|
|
3309
3211
|
var QUESTION_STATUS = {
|
|
3310
3212
|
CORRETA: "CORRETA",
|
|
3311
3213
|
INCORRETA: "INCORRETA",
|
|
@@ -3313,6 +3215,22 @@ var QUESTION_STATUS = {
|
|
|
3313
3215
|
/** Reserved for future use - pending teacher evaluation for essay questions */
|
|
3314
3216
|
PENDENTE: "PENDENTE"
|
|
3315
3217
|
};
|
|
3218
|
+
|
|
3219
|
+
// src/utils/studentActivityCorrection/utils.ts
|
|
3220
|
+
var mapAnswerStatusToQuestionStatus = (answerStatus) => {
|
|
3221
|
+
switch (answerStatus) {
|
|
3222
|
+
case "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */:
|
|
3223
|
+
return QUESTION_STATUS.CORRETA;
|
|
3224
|
+
case "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */:
|
|
3225
|
+
return QUESTION_STATUS.INCORRETA;
|
|
3226
|
+
case "NAO_RESPONDIDO" /* NAO_RESPONDIDO */:
|
|
3227
|
+
return QUESTION_STATUS.EM_BRANCO;
|
|
3228
|
+
case "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */:
|
|
3229
|
+
return QUESTION_STATUS.PENDENTE;
|
|
3230
|
+
default:
|
|
3231
|
+
return QUESTION_STATUS.EM_BRANCO;
|
|
3232
|
+
}
|
|
3233
|
+
};
|
|
3316
3234
|
var getQuestionStatusBadgeConfig = (status) => {
|
|
3317
3235
|
const configs = {
|
|
3318
3236
|
[QUESTION_STATUS.CORRETA]: {
|
|
@@ -3336,174 +3254,1749 @@ var getQuestionStatusBadgeConfig = (status) => {
|
|
|
3336
3254
|
textColor: "text-warning-800"
|
|
3337
3255
|
}
|
|
3338
3256
|
};
|
|
3339
|
-
|
|
3257
|
+
const defaultConfig = {
|
|
3258
|
+
label: "Sem categoria",
|
|
3259
|
+
bgColor: "bg-gray-100",
|
|
3260
|
+
textColor: "text-gray-600"
|
|
3261
|
+
};
|
|
3262
|
+
return configs[status] ?? defaultConfig;
|
|
3263
|
+
};
|
|
3264
|
+
var getQuestionStatusFromData = (questionData) => {
|
|
3265
|
+
return mapAnswerStatusToQuestionStatus(questionData.result.answerStatus);
|
|
3340
3266
|
};
|
|
3341
3267
|
|
|
3342
|
-
// src/components/
|
|
3268
|
+
// src/components/Alternative/Alternative.tsx
|
|
3269
|
+
var import_phosphor_react7 = require("phosphor-react");
|
|
3270
|
+
var import_react9 = require("react");
|
|
3343
3271
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
3344
|
-
var
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
iconBg: "bg-indicator-positive",
|
|
3356
|
-
iconColor: "text-text-950",
|
|
3357
|
-
IconComponent: import_phosphor_react7.Medal
|
|
3358
|
-
},
|
|
3359
|
-
incorrect: {
|
|
3360
|
-
bg: "bg-error-100",
|
|
3361
|
-
text: "text-error-700",
|
|
3362
|
-
iconBg: "bg-indicator-negative",
|
|
3363
|
-
iconColor: "text-white",
|
|
3364
|
-
IconComponent: import_phosphor_react7.WarningCircle
|
|
3365
|
-
}
|
|
3366
|
-
};
|
|
3367
|
-
var StatCard = ({ label, value, variant }) => {
|
|
3368
|
-
const config = variantConfig[variant];
|
|
3369
|
-
const IconComponent = config.IconComponent;
|
|
3370
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3371
|
-
"div",
|
|
3372
|
-
{
|
|
3373
|
-
className: cn(
|
|
3374
|
-
"border border-border-50 rounded-xl py-4 px-3 flex flex-col items-center justify-center gap-1",
|
|
3375
|
-
config.bg
|
|
3376
|
-
),
|
|
3377
|
-
children: [
|
|
3378
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3379
|
-
"div",
|
|
3380
|
-
{
|
|
3381
|
-
className: cn(
|
|
3382
|
-
"w-[30px] h-[30px] rounded-2xl flex items-center justify-center",
|
|
3383
|
-
config.iconBg
|
|
3384
|
-
),
|
|
3385
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3386
|
-
IconComponent,
|
|
3387
|
-
{
|
|
3388
|
-
size: 16,
|
|
3389
|
-
className: config.iconColor,
|
|
3390
|
-
weight: "regular"
|
|
3391
|
-
}
|
|
3392
|
-
)
|
|
3393
|
-
}
|
|
3394
|
-
),
|
|
3395
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3396
|
-
Text_default,
|
|
3397
|
-
{
|
|
3398
|
-
className: cn("text-2xs font-bold uppercase text-center", config.text),
|
|
3399
|
-
children: label
|
|
3400
|
-
}
|
|
3401
|
-
),
|
|
3402
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text_default, { className: cn("text-xl font-bold", config.text), children: value })
|
|
3403
|
-
]
|
|
3404
|
-
}
|
|
3405
|
-
);
|
|
3406
|
-
};
|
|
3407
|
-
var CorrectActivityModal = ({
|
|
3408
|
-
isOpen,
|
|
3409
|
-
onClose,
|
|
3410
|
-
data,
|
|
3411
|
-
isViewOnly = false,
|
|
3412
|
-
onObservationSubmit
|
|
3272
|
+
var AlternativesList = ({
|
|
3273
|
+
alternatives,
|
|
3274
|
+
name,
|
|
3275
|
+
defaultValue,
|
|
3276
|
+
value,
|
|
3277
|
+
onValueChange,
|
|
3278
|
+
disabled = false,
|
|
3279
|
+
layout = "default",
|
|
3280
|
+
className = "",
|
|
3281
|
+
mode = "interactive",
|
|
3282
|
+
selectedValue
|
|
3413
3283
|
}) => {
|
|
3414
|
-
const
|
|
3415
|
-
const
|
|
3416
|
-
const [
|
|
3417
|
-
const
|
|
3418
|
-
const
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
setIsObservationExpanded(false);
|
|
3428
|
-
setAttachedFiles([]);
|
|
3429
|
-
setSavedFiles([]);
|
|
3430
|
-
setExistingAttachment(data?.attachment ?? null);
|
|
3431
|
-
if (data?.observation || data?.attachment) {
|
|
3432
|
-
setIsObservationSaved(true);
|
|
3433
|
-
setSavedObservation(data.observation || "");
|
|
3434
|
-
} else {
|
|
3435
|
-
setIsObservationSaved(false);
|
|
3436
|
-
setSavedObservation("");
|
|
3437
|
-
}
|
|
3284
|
+
const uniqueId = (0, import_react9.useId)();
|
|
3285
|
+
const groupName = name || `alternatives-${uniqueId}`;
|
|
3286
|
+
const [actualValue, setActualValue] = (0, import_react9.useState)(value);
|
|
3287
|
+
const isReadonly = mode === "readonly";
|
|
3288
|
+
const getStatusStyles2 = (status, isReadonly2) => {
|
|
3289
|
+
const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
|
|
3290
|
+
switch (status) {
|
|
3291
|
+
case "correct":
|
|
3292
|
+
return "bg-success-background border-success-300";
|
|
3293
|
+
case "incorrect":
|
|
3294
|
+
return "bg-error-background border-error-300";
|
|
3295
|
+
default:
|
|
3296
|
+
return `bg-background border-border-100 ${hoverClass}`;
|
|
3438
3297
|
}
|
|
3439
|
-
}, [isOpen, data?.studentId, data?.observation, data?.attachment]);
|
|
3440
|
-
const handleOpenObservation = () => {
|
|
3441
|
-
setIsObservationExpanded(true);
|
|
3442
3298
|
};
|
|
3443
|
-
const
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3299
|
+
const getStatusBadge2 = (status) => {
|
|
3300
|
+
switch (status) {
|
|
3301
|
+
case "correct":
|
|
3302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_phosphor_react7.CheckCircle, {}), children: "Resposta correta" });
|
|
3303
|
+
case "incorrect":
|
|
3304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_phosphor_react7.XCircle, {}), children: "Resposta incorreta" });
|
|
3305
|
+
default:
|
|
3306
|
+
return null;
|
|
3447
3307
|
}
|
|
3448
3308
|
};
|
|
3449
|
-
const
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
setSavedObservation(observation);
|
|
3458
|
-
setSavedFiles([...attachedFiles]);
|
|
3459
|
-
setIsObservationSaved(true);
|
|
3460
|
-
setIsObservationExpanded(false);
|
|
3461
|
-
onObservationSubmit?.(
|
|
3462
|
-
data.studentId,
|
|
3463
|
-
observation,
|
|
3464
|
-
attachedFiles.map((f) => f.file)
|
|
3465
|
-
);
|
|
3309
|
+
const getLayoutClasses = () => {
|
|
3310
|
+
switch (layout) {
|
|
3311
|
+
case "compact":
|
|
3312
|
+
return "gap-2";
|
|
3313
|
+
case "detailed":
|
|
3314
|
+
return "gap-4";
|
|
3315
|
+
default:
|
|
3316
|
+
return "gap-3.5";
|
|
3466
3317
|
}
|
|
3467
3318
|
};
|
|
3468
|
-
const
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
const
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3319
|
+
const renderReadonlyAlternative = (alternative) => {
|
|
3320
|
+
const alternativeId = alternative.value;
|
|
3321
|
+
const isUserSelected = selectedValue === alternative.value;
|
|
3322
|
+
const isCorrectAnswer = alternative.status === "correct";
|
|
3323
|
+
let displayStatus = void 0;
|
|
3324
|
+
if (isUserSelected && !isCorrectAnswer) {
|
|
3325
|
+
displayStatus = "incorrect";
|
|
3326
|
+
} else if (isCorrectAnswer) {
|
|
3327
|
+
displayStatus = "correct";
|
|
3328
|
+
}
|
|
3329
|
+
const statusStyles = getStatusStyles2(displayStatus, true);
|
|
3330
|
+
const statusBadge = getStatusBadge2(displayStatus);
|
|
3331
|
+
const renderRadio = () => {
|
|
3332
|
+
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"}`;
|
|
3333
|
+
const dotClasses = "w-3 h-3 rounded-full bg-primary-950 transition-all duration-200";
|
|
3334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: radioClasses, children: isUserSelected && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: dotClasses }) });
|
|
3335
|
+
};
|
|
3336
|
+
if (layout === "detailed") {
|
|
3337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3338
|
+
"div",
|
|
3339
|
+
{
|
|
3340
|
+
className: cn(
|
|
3341
|
+
"border-2 rounded-lg p-4 w-full",
|
|
3342
|
+
statusStyles,
|
|
3343
|
+
alternative.disabled ? "opacity-50" : ""
|
|
3344
|
+
),
|
|
3345
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
3346
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
3347
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mt-1", children: renderRadio() }),
|
|
3348
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex-1", children: [
|
|
3349
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3350
|
+
"p",
|
|
3351
|
+
{
|
|
3352
|
+
className: cn(
|
|
3353
|
+
"block font-medium",
|
|
3354
|
+
selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
|
|
3355
|
+
),
|
|
3356
|
+
children: alternative.label
|
|
3357
|
+
}
|
|
3358
|
+
),
|
|
3359
|
+
alternative.description && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
|
|
3360
|
+
] })
|
|
3361
|
+
] }),
|
|
3362
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
3363
|
+
] })
|
|
3364
|
+
},
|
|
3365
|
+
alternativeId
|
|
3366
|
+
);
|
|
3367
|
+
}
|
|
3368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3369
|
+
"div",
|
|
3370
|
+
{
|
|
3371
|
+
className: cn(
|
|
3372
|
+
"flex flex-row justify-between items-start gap-2 p-2 rounded-lg w-full",
|
|
3373
|
+
statusStyles,
|
|
3374
|
+
alternative.disabled ? "opacity-50" : ""
|
|
3375
|
+
),
|
|
3376
|
+
children: [
|
|
3377
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
3378
|
+
renderRadio(),
|
|
3379
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3380
|
+
"span",
|
|
3381
|
+
{
|
|
3382
|
+
className: cn(
|
|
3383
|
+
"flex-1",
|
|
3384
|
+
selectedValue === alternative.value || statusBadge ? "text-text-950" : "text-text-600"
|
|
3385
|
+
),
|
|
3386
|
+
children: alternative.label
|
|
3387
|
+
}
|
|
3388
|
+
)
|
|
3389
|
+
] }),
|
|
3390
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
3391
|
+
]
|
|
3392
|
+
},
|
|
3393
|
+
alternativeId
|
|
3394
|
+
);
|
|
3395
|
+
};
|
|
3396
|
+
if (isReadonly) {
|
|
3397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3398
|
+
"div",
|
|
3399
|
+
{
|
|
3400
|
+
className: cn("flex flex-col", getLayoutClasses(), "w-full", className),
|
|
3401
|
+
children: alternatives.map(
|
|
3402
|
+
(alternative) => renderReadonlyAlternative(alternative)
|
|
3403
|
+
)
|
|
3404
|
+
}
|
|
3405
|
+
);
|
|
3406
|
+
}
|
|
3407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3408
|
+
RadioGroup,
|
|
3409
|
+
{
|
|
3410
|
+
name: groupName,
|
|
3411
|
+
defaultValue,
|
|
3412
|
+
value,
|
|
3413
|
+
onValueChange: (value2) => {
|
|
3414
|
+
setActualValue(value2);
|
|
3415
|
+
onValueChange?.(value2);
|
|
3416
|
+
},
|
|
3417
|
+
disabled,
|
|
3418
|
+
className: cn("flex flex-col", getLayoutClasses(), className),
|
|
3419
|
+
children: alternatives.map((alternative, index) => {
|
|
3420
|
+
const alternativeId = alternative.value || `alt-${index}`;
|
|
3421
|
+
const statusStyles = getStatusStyles2(alternative.status, false);
|
|
3422
|
+
const statusBadge = getStatusBadge2(alternative.status);
|
|
3423
|
+
if (layout === "detailed") {
|
|
3424
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3425
|
+
"div",
|
|
3426
|
+
{
|
|
3427
|
+
className: cn(
|
|
3428
|
+
"border-2 rounded-lg p-4 transition-all",
|
|
3429
|
+
statusStyles,
|
|
3430
|
+
alternative.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
3431
|
+
),
|
|
3432
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
3433
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
3434
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3435
|
+
RadioGroupItem,
|
|
3436
|
+
{
|
|
3437
|
+
value: alternative.value,
|
|
3438
|
+
id: alternativeId,
|
|
3439
|
+
disabled: alternative.disabled,
|
|
3440
|
+
className: "mt-1"
|
|
3441
|
+
}
|
|
3442
|
+
),
|
|
3443
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex-1", children: [
|
|
3444
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3445
|
+
"label",
|
|
3446
|
+
{
|
|
3447
|
+
htmlFor: alternativeId,
|
|
3448
|
+
className: cn(
|
|
3449
|
+
"block font-medium",
|
|
3450
|
+
actualValue === alternative.value ? "text-text-950" : "text-text-600",
|
|
3451
|
+
alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
3452
|
+
),
|
|
3453
|
+
children: alternative.label
|
|
3454
|
+
}
|
|
3455
|
+
),
|
|
3456
|
+
alternative.description && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
|
|
3457
|
+
] })
|
|
3458
|
+
] }),
|
|
3459
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
3460
|
+
] })
|
|
3461
|
+
},
|
|
3462
|
+
alternativeId
|
|
3463
|
+
);
|
|
3464
|
+
}
|
|
3465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3466
|
+
"div",
|
|
3467
|
+
{
|
|
3468
|
+
className: cn(
|
|
3469
|
+
"flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
|
|
3470
|
+
statusStyles,
|
|
3471
|
+
alternative.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
3472
|
+
),
|
|
3473
|
+
children: [
|
|
3474
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
3475
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3476
|
+
RadioGroupItem,
|
|
3477
|
+
{
|
|
3478
|
+
value: alternative.value,
|
|
3479
|
+
id: alternativeId,
|
|
3480
|
+
disabled: alternative.disabled
|
|
3481
|
+
}
|
|
3482
|
+
),
|
|
3483
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3484
|
+
"label",
|
|
3485
|
+
{
|
|
3486
|
+
htmlFor: alternativeId,
|
|
3487
|
+
className: cn(
|
|
3488
|
+
"flex-1",
|
|
3489
|
+
actualValue === alternative.value ? "text-text-950" : "text-text-600",
|
|
3490
|
+
alternative.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
3491
|
+
),
|
|
3492
|
+
children: alternative.label
|
|
3493
|
+
}
|
|
3494
|
+
)
|
|
3495
|
+
] }),
|
|
3496
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
3497
|
+
]
|
|
3498
|
+
},
|
|
3499
|
+
alternativeId
|
|
3500
|
+
);
|
|
3501
|
+
})
|
|
3502
|
+
}
|
|
3503
|
+
);
|
|
3504
|
+
};
|
|
3505
|
+
var HeaderAlternative = (0, import_react9.forwardRef)(
|
|
3506
|
+
({ className, title, subTitle, content, ...props }, ref) => {
|
|
3507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
3508
|
+
"div",
|
|
3509
|
+
{
|
|
3510
|
+
ref,
|
|
3511
|
+
className: cn(
|
|
3512
|
+
"bg-background p-4 flex flex-col gap-4 rounded-xl",
|
|
3513
|
+
className
|
|
3514
|
+
),
|
|
3515
|
+
...props,
|
|
3516
|
+
children: [
|
|
3517
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "flex flex-col", children: [
|
|
3518
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-text-950 font-bold text-lg", children: title }),
|
|
3519
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-text-700 text-sm ", children: subTitle })
|
|
3520
|
+
] }),
|
|
3521
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-text-950 text-md", children: content })
|
|
3522
|
+
]
|
|
3523
|
+
}
|
|
3524
|
+
);
|
|
3525
|
+
}
|
|
3526
|
+
);
|
|
3527
|
+
|
|
3528
|
+
// src/utils/questionRenderer/alternative/index.tsx
|
|
3529
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3530
|
+
var renderQuestionAlternative = ({
|
|
3531
|
+
question,
|
|
3532
|
+
result
|
|
3533
|
+
}) => {
|
|
3534
|
+
const alternatives = question.options?.map((option) => {
|
|
3535
|
+
const isCorrectOption = result?.options?.find((op) => op.id === option.id)?.isCorrect || false;
|
|
3536
|
+
const isSelected = result?.selectedOptions?.some(
|
|
3537
|
+
(selectedOption) => selectedOption.optionId === option.id
|
|
3538
|
+
) || false;
|
|
3539
|
+
const shouldShowCorrectAnswers = result?.answerStatus !== "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */;
|
|
3540
|
+
let status;
|
|
3541
|
+
if (shouldShowCorrectAnswers) {
|
|
3542
|
+
if (isCorrectOption) {
|
|
3543
|
+
status = "correct" /* CORRECT */;
|
|
3544
|
+
} else if (isSelected && !isCorrectOption) {
|
|
3545
|
+
status = "incorrect" /* INCORRECT */;
|
|
3546
|
+
} else {
|
|
3547
|
+
status = "neutral" /* NEUTRAL */;
|
|
3548
|
+
}
|
|
3549
|
+
} else {
|
|
3550
|
+
status = "neutral" /* NEUTRAL */;
|
|
3551
|
+
}
|
|
3552
|
+
return {
|
|
3553
|
+
label: option.option,
|
|
3554
|
+
value: option.id,
|
|
3555
|
+
status
|
|
3556
|
+
};
|
|
3557
|
+
});
|
|
3558
|
+
if (!alternatives || alternatives.length === 0) {
|
|
3559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text_default, { size: "sm", weight: "normal", children: "N\xE3o h\xE1 Alternativas" }) });
|
|
3560
|
+
}
|
|
3561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
3562
|
+
AlternativesList,
|
|
3563
|
+
{
|
|
3564
|
+
mode: "readonly",
|
|
3565
|
+
name: `question-${question.id}`,
|
|
3566
|
+
layout: "compact",
|
|
3567
|
+
alternatives,
|
|
3568
|
+
selectedValue: result?.selectedOptions?.[0]?.optionId || ""
|
|
3569
|
+
},
|
|
3570
|
+
`question-${question.id}`
|
|
3571
|
+
) });
|
|
3572
|
+
};
|
|
3573
|
+
|
|
3574
|
+
// src/components/MultipleChoice/MultipleChoice.tsx
|
|
3575
|
+
var import_react12 = require("react");
|
|
3576
|
+
|
|
3577
|
+
// src/components/CheckBox/CheckboxList.tsx
|
|
3578
|
+
var import_react11 = require("react");
|
|
3579
|
+
var import_zustand3 = require("zustand");
|
|
3580
|
+
|
|
3581
|
+
// src/components/CheckBox/CheckBox.tsx
|
|
3582
|
+
var import_react10 = require("react");
|
|
3583
|
+
var import_phosphor_react8 = require("phosphor-react");
|
|
3584
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3585
|
+
var SIZE_CLASSES7 = {
|
|
3586
|
+
small: {
|
|
3587
|
+
checkbox: "w-4 h-4",
|
|
3588
|
+
// 16px x 16px
|
|
3589
|
+
textSize: "sm",
|
|
3590
|
+
spacing: "gap-1.5",
|
|
3591
|
+
// 6px
|
|
3592
|
+
borderWidth: "border-2",
|
|
3593
|
+
iconSize: 14,
|
|
3594
|
+
// pixels for Phosphor icons
|
|
3595
|
+
labelHeight: "h-[21px]"
|
|
3596
|
+
},
|
|
3597
|
+
medium: {
|
|
3598
|
+
checkbox: "w-5 h-5",
|
|
3599
|
+
// 20px x 20px
|
|
3600
|
+
textSize: "md",
|
|
3601
|
+
spacing: "gap-2",
|
|
3602
|
+
// 8px
|
|
3603
|
+
borderWidth: "border-2",
|
|
3604
|
+
iconSize: 16,
|
|
3605
|
+
// pixels for Phosphor icons
|
|
3606
|
+
labelHeight: "h-6"
|
|
3607
|
+
},
|
|
3608
|
+
large: {
|
|
3609
|
+
checkbox: "w-6 h-6",
|
|
3610
|
+
// 24px x 24px
|
|
3611
|
+
textSize: "lg",
|
|
3612
|
+
spacing: "gap-2",
|
|
3613
|
+
// 8px
|
|
3614
|
+
borderWidth: "border-[3px]",
|
|
3615
|
+
// 3px border
|
|
3616
|
+
iconSize: 20,
|
|
3617
|
+
// pixels for Phosphor icons
|
|
3618
|
+
labelHeight: "h-[27px]"
|
|
3619
|
+
}
|
|
3620
|
+
};
|
|
3621
|
+
var BASE_CHECKBOX_CLASSES = "rounded border cursor-pointer transition-all duration-200 flex items-center justify-center focus:outline-none";
|
|
3622
|
+
var STATE_CLASSES3 = {
|
|
3623
|
+
default: {
|
|
3624
|
+
unchecked: "border-border-400 bg-background hover:border-border-500",
|
|
3625
|
+
checked: "border-primary-950 bg-primary-950 text-text hover:border-primary-800 hover:bg-primary-800"
|
|
3626
|
+
},
|
|
3627
|
+
hovered: {
|
|
3628
|
+
unchecked: "border-border-500 bg-background",
|
|
3629
|
+
checked: "border-primary-800 bg-primary-800 text-text"
|
|
3630
|
+
},
|
|
3631
|
+
focused: {
|
|
3632
|
+
unchecked: "border-indicator-info bg-background ring-2 ring-indicator-info/20",
|
|
3633
|
+
checked: "border-indicator-info bg-primary-950 text-text ring-2 ring-indicator-info/20"
|
|
3634
|
+
},
|
|
3635
|
+
invalid: {
|
|
3636
|
+
unchecked: "border-error-700 bg-background hover:border-error-600",
|
|
3637
|
+
checked: "border-error-700 bg-primary-950 text-text"
|
|
3638
|
+
},
|
|
3639
|
+
disabled: {
|
|
3640
|
+
unchecked: "border-border-400 bg-background cursor-not-allowed opacity-40",
|
|
3641
|
+
checked: "border-primary-600 bg-primary-600 text-text cursor-not-allowed opacity-40"
|
|
3642
|
+
}
|
|
3643
|
+
};
|
|
3644
|
+
var CheckBox = (0, import_react10.forwardRef)(
|
|
3645
|
+
({
|
|
3646
|
+
label,
|
|
3647
|
+
size = "medium",
|
|
3648
|
+
state = "default",
|
|
3649
|
+
indeterminate = false,
|
|
3650
|
+
errorMessage,
|
|
3651
|
+
helperText,
|
|
3652
|
+
className = "",
|
|
3653
|
+
labelClassName = "",
|
|
3654
|
+
checked: checkedProp,
|
|
3655
|
+
disabled,
|
|
3656
|
+
id,
|
|
3657
|
+
onChange,
|
|
3658
|
+
...props
|
|
3659
|
+
}, ref) => {
|
|
3660
|
+
const generatedId = (0, import_react10.useId)();
|
|
3661
|
+
const inputId = id ?? `checkbox-${generatedId}`;
|
|
3662
|
+
const [internalChecked, setInternalChecked] = (0, import_react10.useState)(false);
|
|
3663
|
+
const isControlled = checkedProp !== void 0;
|
|
3664
|
+
const checked = isControlled ? checkedProp : internalChecked;
|
|
3665
|
+
const handleChange = (event) => {
|
|
3666
|
+
if (!isControlled) {
|
|
3667
|
+
setInternalChecked(event.target.checked);
|
|
3668
|
+
}
|
|
3669
|
+
onChange?.(event);
|
|
3670
|
+
};
|
|
3671
|
+
const currentState = disabled ? "disabled" : state;
|
|
3672
|
+
const sizeClasses = SIZE_CLASSES7[size];
|
|
3673
|
+
const checkVariant = checked || indeterminate ? "checked" : "unchecked";
|
|
3674
|
+
const stylingClasses = STATE_CLASSES3[currentState][checkVariant];
|
|
3675
|
+
const borderWidthClass = state === "focused" || state === "hovered" && size === "large" ? "border-[3px]" : sizeClasses.borderWidth;
|
|
3676
|
+
const checkboxClasses = cn(
|
|
3677
|
+
BASE_CHECKBOX_CLASSES,
|
|
3678
|
+
sizeClasses.checkbox,
|
|
3679
|
+
borderWidthClass,
|
|
3680
|
+
stylingClasses,
|
|
3681
|
+
className
|
|
3682
|
+
);
|
|
3683
|
+
const renderIcon = () => {
|
|
3684
|
+
if (indeterminate) {
|
|
3685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3686
|
+
import_phosphor_react8.Minus,
|
|
3687
|
+
{
|
|
3688
|
+
size: sizeClasses.iconSize,
|
|
3689
|
+
weight: "bold",
|
|
3690
|
+
color: "currentColor"
|
|
3691
|
+
}
|
|
3692
|
+
);
|
|
3693
|
+
}
|
|
3694
|
+
if (checked) {
|
|
3695
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3696
|
+
import_phosphor_react8.Check,
|
|
3697
|
+
{
|
|
3698
|
+
size: sizeClasses.iconSize,
|
|
3699
|
+
weight: "bold",
|
|
3700
|
+
color: "currentColor"
|
|
3701
|
+
}
|
|
3702
|
+
);
|
|
3703
|
+
}
|
|
3704
|
+
return null;
|
|
3705
|
+
};
|
|
3706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col", children: [
|
|
3707
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
3708
|
+
"div",
|
|
3709
|
+
{
|
|
3710
|
+
className: cn(
|
|
3711
|
+
"flex flex-row items-center",
|
|
3712
|
+
sizeClasses.spacing,
|
|
3713
|
+
disabled ? "opacity-40" : ""
|
|
3714
|
+
),
|
|
3715
|
+
children: [
|
|
3716
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3717
|
+
"input",
|
|
3718
|
+
{
|
|
3719
|
+
ref,
|
|
3720
|
+
type: "checkbox",
|
|
3721
|
+
id: inputId,
|
|
3722
|
+
checked,
|
|
3723
|
+
disabled,
|
|
3724
|
+
onChange: handleChange,
|
|
3725
|
+
className: "sr-only",
|
|
3726
|
+
...props
|
|
3727
|
+
}
|
|
3728
|
+
),
|
|
3729
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { htmlFor: inputId, className: checkboxClasses, children: renderIcon() }),
|
|
3730
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3731
|
+
"div",
|
|
3732
|
+
{
|
|
3733
|
+
className: cn(
|
|
3734
|
+
"flex flex-row items-center",
|
|
3735
|
+
sizeClasses.labelHeight
|
|
3736
|
+
),
|
|
3737
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3738
|
+
Text_default,
|
|
3739
|
+
{
|
|
3740
|
+
as: "label",
|
|
3741
|
+
htmlFor: inputId,
|
|
3742
|
+
size: sizeClasses.textSize,
|
|
3743
|
+
weight: "normal",
|
|
3744
|
+
className: cn(
|
|
3745
|
+
"cursor-pointer select-none leading-[150%] flex items-center font-roboto",
|
|
3746
|
+
labelClassName
|
|
3747
|
+
),
|
|
3748
|
+
children: label
|
|
3749
|
+
}
|
|
3750
|
+
)
|
|
3751
|
+
}
|
|
3752
|
+
)
|
|
3753
|
+
]
|
|
3754
|
+
}
|
|
3755
|
+
),
|
|
3756
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3757
|
+
Text_default,
|
|
3758
|
+
{
|
|
3759
|
+
size: "sm",
|
|
3760
|
+
weight: "normal",
|
|
3761
|
+
className: "mt-1.5",
|
|
3762
|
+
color: "text-error-600",
|
|
3763
|
+
children: errorMessage
|
|
3764
|
+
}
|
|
3765
|
+
),
|
|
3766
|
+
helperText && !errorMessage && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3767
|
+
Text_default,
|
|
3768
|
+
{
|
|
3769
|
+
size: "sm",
|
|
3770
|
+
weight: "normal",
|
|
3771
|
+
className: "mt-1.5",
|
|
3772
|
+
color: "text-text-500",
|
|
3773
|
+
children: helperText
|
|
3774
|
+
}
|
|
3775
|
+
)
|
|
3776
|
+
] });
|
|
3777
|
+
}
|
|
3778
|
+
);
|
|
3779
|
+
CheckBox.displayName = "CheckBox";
|
|
3780
|
+
var CheckBox_default = CheckBox;
|
|
3781
|
+
|
|
3782
|
+
// src/components/CheckBox/CheckboxList.tsx
|
|
3783
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3784
|
+
var createCheckboxListStore = (name, defaultValues, disabled, onValuesChange) => (0, import_zustand3.create)((set, get) => ({
|
|
3785
|
+
values: defaultValues,
|
|
3786
|
+
setValues: (values) => {
|
|
3787
|
+
if (!get().disabled) {
|
|
3788
|
+
set({ values });
|
|
3789
|
+
get().onValuesChange?.(values);
|
|
3790
|
+
}
|
|
3791
|
+
},
|
|
3792
|
+
toggleValue: (value) => {
|
|
3793
|
+
if (!get().disabled) {
|
|
3794
|
+
const currentValues = get().values;
|
|
3795
|
+
const newValues = currentValues.includes(value) ? currentValues.filter((v) => v !== value) : [...currentValues, value];
|
|
3796
|
+
set({ values: newValues });
|
|
3797
|
+
get().onValuesChange?.(newValues);
|
|
3798
|
+
}
|
|
3799
|
+
},
|
|
3800
|
+
onValuesChange,
|
|
3801
|
+
disabled,
|
|
3802
|
+
name
|
|
3803
|
+
}));
|
|
3804
|
+
var useCheckboxListStore = (externalStore) => {
|
|
3805
|
+
if (!externalStore) {
|
|
3806
|
+
throw new Error("CheckboxListItem must be used within a CheckboxList");
|
|
3807
|
+
}
|
|
3808
|
+
return externalStore;
|
|
3809
|
+
};
|
|
3810
|
+
var injectStore3 = (children, store) => import_react11.Children.map(children, (child) => {
|
|
3811
|
+
if (!(0, import_react11.isValidElement)(child)) return child;
|
|
3812
|
+
const typedChild = child;
|
|
3813
|
+
const shouldInject = typedChild.type === CheckboxListItem;
|
|
3814
|
+
return (0, import_react11.cloneElement)(typedChild, {
|
|
3815
|
+
...shouldInject ? { store } : {},
|
|
3816
|
+
...typedChild.props.children ? { children: injectStore3(typedChild.props.children, store) } : {}
|
|
3817
|
+
});
|
|
3818
|
+
});
|
|
3819
|
+
var CheckboxList = (0, import_react11.forwardRef)(
|
|
3820
|
+
({
|
|
3821
|
+
values: propValues,
|
|
3822
|
+
defaultValues = [],
|
|
3823
|
+
onValuesChange,
|
|
3824
|
+
name: propName,
|
|
3825
|
+
disabled = false,
|
|
3826
|
+
className = "",
|
|
3827
|
+
children,
|
|
3828
|
+
...props
|
|
3829
|
+
}, ref) => {
|
|
3830
|
+
const generatedId = (0, import_react11.useId)();
|
|
3831
|
+
const name = propName || `checkbox-list-${generatedId}`;
|
|
3832
|
+
const storeRef = (0, import_react11.useRef)(null);
|
|
3833
|
+
storeRef.current ??= createCheckboxListStore(
|
|
3834
|
+
name,
|
|
3835
|
+
defaultValues,
|
|
3836
|
+
disabled,
|
|
3837
|
+
onValuesChange
|
|
3838
|
+
);
|
|
3839
|
+
const store = storeRef.current;
|
|
3840
|
+
const { setValues } = (0, import_zustand3.useStore)(store, (s) => s);
|
|
3841
|
+
(0, import_react11.useEffect)(() => {
|
|
3842
|
+
const currentValues = store.getState().values;
|
|
3843
|
+
if (currentValues.length > 0 && onValuesChange) {
|
|
3844
|
+
onValuesChange(currentValues);
|
|
3845
|
+
}
|
|
3846
|
+
}, []);
|
|
3847
|
+
(0, import_react11.useEffect)(() => {
|
|
3848
|
+
if (propValues !== void 0) {
|
|
3849
|
+
setValues(propValues);
|
|
3850
|
+
}
|
|
3851
|
+
}, [propValues, setValues]);
|
|
3852
|
+
(0, import_react11.useEffect)(() => {
|
|
3853
|
+
store.setState({ disabled });
|
|
3854
|
+
}, [disabled, store]);
|
|
3855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3856
|
+
"div",
|
|
3857
|
+
{
|
|
3858
|
+
ref,
|
|
3859
|
+
className: cn("flex flex-col gap-2 w-full", className),
|
|
3860
|
+
"aria-label": name,
|
|
3861
|
+
...props,
|
|
3862
|
+
children: injectStore3(children, store)
|
|
3863
|
+
}
|
|
3864
|
+
);
|
|
3865
|
+
}
|
|
3866
|
+
);
|
|
3867
|
+
CheckboxList.displayName = "CheckboxList";
|
|
3868
|
+
var CheckboxListItem = (0, import_react11.forwardRef)(
|
|
3869
|
+
({
|
|
3870
|
+
value,
|
|
3871
|
+
store: externalStore,
|
|
3872
|
+
disabled: itemDisabled,
|
|
3873
|
+
size = "medium",
|
|
3874
|
+
state = "default",
|
|
3875
|
+
className = "",
|
|
3876
|
+
id,
|
|
3877
|
+
...props
|
|
3878
|
+
}, ref) => {
|
|
3879
|
+
const store = useCheckboxListStore(externalStore);
|
|
3880
|
+
const {
|
|
3881
|
+
values: groupValues,
|
|
3882
|
+
toggleValue,
|
|
3883
|
+
disabled: groupDisabled,
|
|
3884
|
+
name
|
|
3885
|
+
} = (0, import_zustand3.useStore)(store);
|
|
3886
|
+
const generatedId = (0, import_react11.useId)();
|
|
3887
|
+
const inputId = id ?? `checkbox-item-${generatedId}`;
|
|
3888
|
+
const isChecked = groupValues.includes(value);
|
|
3889
|
+
const isDisabled = groupDisabled || itemDisabled;
|
|
3890
|
+
const currentState = isDisabled ? "disabled" : state;
|
|
3891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3892
|
+
CheckBox_default,
|
|
3893
|
+
{
|
|
3894
|
+
ref,
|
|
3895
|
+
id: inputId,
|
|
3896
|
+
name,
|
|
3897
|
+
value,
|
|
3898
|
+
checked: isChecked,
|
|
3899
|
+
disabled: isDisabled,
|
|
3900
|
+
size,
|
|
3901
|
+
state: currentState,
|
|
3902
|
+
className,
|
|
3903
|
+
onChange: () => {
|
|
3904
|
+
if (!isDisabled) {
|
|
3905
|
+
toggleValue(value);
|
|
3906
|
+
}
|
|
3907
|
+
},
|
|
3908
|
+
...props
|
|
3909
|
+
}
|
|
3910
|
+
);
|
|
3911
|
+
}
|
|
3912
|
+
);
|
|
3913
|
+
CheckboxListItem.displayName = "CheckboxListItem";
|
|
3914
|
+
var CheckboxList_default = CheckboxList;
|
|
3915
|
+
|
|
3916
|
+
// src/components/MultipleChoice/MultipleChoice.tsx
|
|
3917
|
+
var import_phosphor_react9 = require("phosphor-react");
|
|
3918
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3919
|
+
var MultipleChoiceList = ({
|
|
3920
|
+
disabled = false,
|
|
3921
|
+
className = "",
|
|
3922
|
+
choices,
|
|
3923
|
+
name,
|
|
3924
|
+
selectedValues,
|
|
3925
|
+
onHandleSelectedValues,
|
|
3926
|
+
mode = "interactive"
|
|
3927
|
+
}) => {
|
|
3928
|
+
const [actualValue, setActualValue] = (0, import_react12.useState)(selectedValues);
|
|
3929
|
+
(0, import_react12.useEffect)(() => {
|
|
3930
|
+
setActualValue(selectedValues);
|
|
3931
|
+
}, [selectedValues]);
|
|
3932
|
+
const getStatusBadge2 = (status) => {
|
|
3933
|
+
switch (status) {
|
|
3934
|
+
case "correct":
|
|
3935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.CheckCircle, {}), children: "Resposta correta" });
|
|
3936
|
+
case "incorrect":
|
|
3937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.XCircle, {}), children: "Resposta incorreta" });
|
|
3938
|
+
default:
|
|
3939
|
+
return null;
|
|
3940
|
+
}
|
|
3941
|
+
};
|
|
3942
|
+
const getStatusStyles2 = (status) => {
|
|
3943
|
+
switch (status) {
|
|
3944
|
+
case "correct":
|
|
3945
|
+
return "bg-success-background border-success-300";
|
|
3946
|
+
case "incorrect":
|
|
3947
|
+
return "bg-error-background border-error-300";
|
|
3948
|
+
default:
|
|
3949
|
+
return `bg-background border-border-100`;
|
|
3950
|
+
}
|
|
3951
|
+
};
|
|
3952
|
+
const renderVisualCheckbox = (isSelected, isDisabled) => {
|
|
3953
|
+
const checkboxClasses = cn(
|
|
3954
|
+
"w-5 h-5 rounded border-2 cursor-default transition-all duration-200 flex items-center justify-center",
|
|
3955
|
+
isSelected ? "border-primary-950 bg-primary-950 text-text" : "border-border-400 bg-background",
|
|
3956
|
+
isDisabled && "opacity-40 cursor-not-allowed"
|
|
3957
|
+
);
|
|
3958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: checkboxClasses, children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_phosphor_react9.Check, { size: 16, weight: "bold" }) });
|
|
3959
|
+
};
|
|
3960
|
+
if (mode === "readonly") {
|
|
3961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("flex flex-col gap-2", className), children: choices.map((choice, i) => {
|
|
3962
|
+
const isSelected = actualValue?.includes(choice.value) || false;
|
|
3963
|
+
const statusStyles = getStatusStyles2(choice.status);
|
|
3964
|
+
const statusBadge = getStatusBadge2(choice.status);
|
|
3965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3966
|
+
"div",
|
|
3967
|
+
{
|
|
3968
|
+
className: cn(
|
|
3969
|
+
"flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
|
|
3970
|
+
statusStyles,
|
|
3971
|
+
choice.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
3972
|
+
),
|
|
3973
|
+
children: [
|
|
3974
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
3975
|
+
renderVisualCheckbox(isSelected, choice.disabled || disabled),
|
|
3976
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3977
|
+
"span",
|
|
3978
|
+
{
|
|
3979
|
+
className: cn(
|
|
3980
|
+
"flex-1",
|
|
3981
|
+
isSelected || choice.status && choice.status != "neutral" ? "text-text-950" : "text-text-600",
|
|
3982
|
+
choice.disabled || disabled ? "cursor-not-allowed" : "cursor-default"
|
|
3983
|
+
),
|
|
3984
|
+
children: choice.label
|
|
3985
|
+
}
|
|
3986
|
+
)
|
|
3987
|
+
] }),
|
|
3988
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
3989
|
+
]
|
|
3990
|
+
},
|
|
3991
|
+
`readonly-${choice.value}-${i}`
|
|
3992
|
+
);
|
|
3993
|
+
}) });
|
|
3994
|
+
}
|
|
3995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3996
|
+
"div",
|
|
3997
|
+
{
|
|
3998
|
+
className: cn(
|
|
3999
|
+
"flex flex-row justify-between gap-2 items-start p-2 rounded-lg transition-all",
|
|
4000
|
+
disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
4001
|
+
className
|
|
4002
|
+
),
|
|
4003
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4004
|
+
CheckboxList_default,
|
|
4005
|
+
{
|
|
4006
|
+
name,
|
|
4007
|
+
values: actualValue,
|
|
4008
|
+
onValuesChange: (v) => {
|
|
4009
|
+
setActualValue(v);
|
|
4010
|
+
onHandleSelectedValues?.(v);
|
|
4011
|
+
},
|
|
4012
|
+
disabled,
|
|
4013
|
+
children: choices.map((choice, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
4014
|
+
"div",
|
|
4015
|
+
{
|
|
4016
|
+
className: "flex flex-row gap-2 items-center",
|
|
4017
|
+
children: [
|
|
4018
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4019
|
+
CheckboxListItem,
|
|
4020
|
+
{
|
|
4021
|
+
value: choice.value,
|
|
4022
|
+
id: `interactive-${choice.value}-${i}`,
|
|
4023
|
+
disabled: choice.disabled || disabled
|
|
4024
|
+
}
|
|
4025
|
+
),
|
|
4026
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4027
|
+
"label",
|
|
4028
|
+
{
|
|
4029
|
+
htmlFor: `interactive-${choice.value}-${i}`,
|
|
4030
|
+
className: cn(
|
|
4031
|
+
"flex-1",
|
|
4032
|
+
actualValue?.includes(choice.value) ? "text-text-950" : "text-text-600",
|
|
4033
|
+
choice.disabled || disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
4034
|
+
),
|
|
4035
|
+
children: choice.label
|
|
4036
|
+
}
|
|
4037
|
+
)
|
|
4038
|
+
]
|
|
4039
|
+
},
|
|
4040
|
+
`interactive-${choice.value}-${i}`
|
|
4041
|
+
))
|
|
4042
|
+
}
|
|
4043
|
+
)
|
|
4044
|
+
}
|
|
4045
|
+
);
|
|
4046
|
+
};
|
|
4047
|
+
|
|
4048
|
+
// src/utils/questionRenderer/multipleChoice/index.tsx
|
|
4049
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
4050
|
+
var renderQuestionMultipleChoice = ({
|
|
4051
|
+
question,
|
|
4052
|
+
result
|
|
4053
|
+
}) => {
|
|
4054
|
+
const choices = question.options?.map((option) => {
|
|
4055
|
+
const isCorrectOption = result?.options?.find((op) => op.id === option.id)?.isCorrect || false;
|
|
4056
|
+
const isSelected = result?.selectedOptions?.some(
|
|
4057
|
+
(op) => op.optionId === option.id
|
|
4058
|
+
);
|
|
4059
|
+
const shouldShowCorrectAnswers = result?.answerStatus !== "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */ && result?.answerStatus !== "NAO_RESPONDIDO" /* NAO_RESPONDIDO */;
|
|
4060
|
+
let status;
|
|
4061
|
+
if (shouldShowCorrectAnswers) {
|
|
4062
|
+
if (isCorrectOption) {
|
|
4063
|
+
status = "correct" /* CORRECT */;
|
|
4064
|
+
} else if (isSelected && !isCorrectOption) {
|
|
4065
|
+
status = "incorrect" /* INCORRECT */;
|
|
4066
|
+
} else {
|
|
4067
|
+
status = "neutral" /* NEUTRAL */;
|
|
4068
|
+
}
|
|
4069
|
+
} else {
|
|
4070
|
+
status = "neutral" /* NEUTRAL */;
|
|
4071
|
+
}
|
|
4072
|
+
return {
|
|
4073
|
+
label: option.option,
|
|
4074
|
+
value: option.id,
|
|
4075
|
+
status
|
|
4076
|
+
};
|
|
4077
|
+
});
|
|
4078
|
+
if (!choices || choices.length === 0) {
|
|
4079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { size: "sm", weight: "normal", children: "N\xE3o h\xE1 Escolhas M\xFAltiplas" }) });
|
|
4080
|
+
}
|
|
4081
|
+
const selectedValues = result?.selectedOptions?.map((op) => op.optionId) || [];
|
|
4082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4083
|
+
MultipleChoiceList,
|
|
4084
|
+
{
|
|
4085
|
+
mode: "readonly",
|
|
4086
|
+
name: `question-${question.id}`,
|
|
4087
|
+
choices,
|
|
4088
|
+
selectedValues
|
|
4089
|
+
},
|
|
4090
|
+
`question-${question.id}`
|
|
4091
|
+
) });
|
|
4092
|
+
};
|
|
4093
|
+
|
|
4094
|
+
// src/components/Quiz/QuizContent.tsx
|
|
4095
|
+
var import_react13 = require("react");
|
|
4096
|
+
var import_phosphor_react10 = require("phosphor-react");
|
|
4097
|
+
|
|
4098
|
+
// src/assets/img/mock-image-question.png
|
|
4099
|
+
var mock_image_question_default = "../mock-image-question-HEZCLFDL.png";
|
|
4100
|
+
|
|
4101
|
+
// src/components/Quiz/QuizContent.tsx
|
|
4102
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4103
|
+
var getStatusStyles = (variantCorrect) => {
|
|
4104
|
+
switch (variantCorrect) {
|
|
4105
|
+
case "correct":
|
|
4106
|
+
return "bg-success-background border-success-300";
|
|
4107
|
+
case "incorrect":
|
|
4108
|
+
return "bg-error-background border-error-300";
|
|
4109
|
+
default:
|
|
4110
|
+
return "";
|
|
4111
|
+
}
|
|
4112
|
+
};
|
|
4113
|
+
var QuizSubTitle = (0, import_react13.forwardRef)(
|
|
4114
|
+
({ subTitle, ...props }, ref) => {
|
|
4115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "px-4 pb-2 pt-6", ...props, ref, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "font-bold text-lg text-text-950", children: subTitle }) });
|
|
4116
|
+
}
|
|
4117
|
+
);
|
|
4118
|
+
var QuizContainer = (0, import_react13.forwardRef)(({ children, className, ...props }, ref) => {
|
|
4119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4120
|
+
"div",
|
|
4121
|
+
{
|
|
4122
|
+
ref,
|
|
4123
|
+
className: cn(
|
|
4124
|
+
"bg-background rounded-t-xl px-4 pt-4 pb-[80px] h-auto flex flex-col gap-4 mb-auto",
|
|
4125
|
+
className
|
|
4126
|
+
),
|
|
4127
|
+
...props,
|
|
4128
|
+
children
|
|
4129
|
+
}
|
|
4130
|
+
);
|
|
4131
|
+
});
|
|
4132
|
+
|
|
4133
|
+
// src/utils/questionRenderer/components/index.tsx
|
|
4134
|
+
var import_react14 = require("react");
|
|
4135
|
+
var import_phosphor_react11 = require("phosphor-react");
|
|
4136
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4137
|
+
var getStatusBadge = (status) => {
|
|
4138
|
+
switch (status) {
|
|
4139
|
+
case "correct":
|
|
4140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_phosphor_react11.CheckCircle, {}), children: "Resposta correta" });
|
|
4141
|
+
case "incorrect":
|
|
4142
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_phosphor_react11.XCircle, {}), children: "Resposta incorreta" });
|
|
4143
|
+
default:
|
|
4144
|
+
return null;
|
|
4145
|
+
}
|
|
4146
|
+
};
|
|
4147
|
+
var QuestionContainer = ({
|
|
4148
|
+
children,
|
|
4149
|
+
className
|
|
4150
|
+
}) => {
|
|
4151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4152
|
+
"div",
|
|
4153
|
+
{
|
|
4154
|
+
className: cn(
|
|
4155
|
+
"bg-background rounded-t-xl px-4 pt-4 pb-[80px] h-auto flex flex-col gap-4 mb-auto",
|
|
4156
|
+
className
|
|
4157
|
+
),
|
|
4158
|
+
children
|
|
4159
|
+
}
|
|
4160
|
+
);
|
|
4161
|
+
};
|
|
4162
|
+
var QuestionSubTitle = ({ subTitle }) => {
|
|
4163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "px-4 pb-2 pt-6", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text_default, { size: "md", weight: "bold", color: "text-text-950", children: subTitle }) });
|
|
4164
|
+
};
|
|
4165
|
+
var FillQuestionContent = ({
|
|
4166
|
+
question,
|
|
4167
|
+
result
|
|
4168
|
+
}) => {
|
|
4169
|
+
const text = question.statement || "";
|
|
4170
|
+
const baseId = (0, import_react14.useId)();
|
|
4171
|
+
const studentAnswers = {};
|
|
4172
|
+
try {
|
|
4173
|
+
if (result?.answer) {
|
|
4174
|
+
const parsed = typeof result.answer === "string" ? JSON.parse(result.answer) : result.answer;
|
|
4175
|
+
if (typeof parsed === "object") {
|
|
4176
|
+
Object.assign(studentAnswers, parsed);
|
|
4177
|
+
}
|
|
4178
|
+
}
|
|
4179
|
+
} catch (error) {
|
|
4180
|
+
console.error("Error parsing answer:", error);
|
|
4181
|
+
}
|
|
4182
|
+
const regex = /\{\{([\p{L}\p{M}\d_]+)\}\}/gu;
|
|
4183
|
+
const placeholders = [];
|
|
4184
|
+
let match;
|
|
4185
|
+
while ((match = regex.exec(text)) !== null) {
|
|
4186
|
+
placeholders.push(match[1]);
|
|
4187
|
+
}
|
|
4188
|
+
const correctAnswers = {};
|
|
4189
|
+
placeholders.forEach((placeholder) => {
|
|
4190
|
+
correctAnswers[placeholder] = studentAnswers[placeholder]?.correctAnswer || `[${placeholder}]`;
|
|
4191
|
+
});
|
|
4192
|
+
const addTextElement = (elements, textContent, elementCounter) => {
|
|
4193
|
+
if (textContent) {
|
|
4194
|
+
elements.push({
|
|
4195
|
+
element: textContent,
|
|
4196
|
+
id: `${baseId}-text-${++elementCounter.current}`
|
|
4197
|
+
});
|
|
4198
|
+
}
|
|
4199
|
+
};
|
|
4200
|
+
const renderGabaritoPlaceholder = (selectId, elementCounter) => {
|
|
4201
|
+
const correctAnswer = correctAnswers[selectId] || `[${selectId}]`;
|
|
4202
|
+
return {
|
|
4203
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4204
|
+
Text_default,
|
|
4205
|
+
{
|
|
4206
|
+
size: "md",
|
|
4207
|
+
weight: "semibold",
|
|
4208
|
+
color: "text-success-600",
|
|
4209
|
+
className: "inline-flex mb-2.5 border-b-2 border-success-600",
|
|
4210
|
+
children: correctAnswer
|
|
4211
|
+
},
|
|
4212
|
+
`${baseId}-gabarito-${selectId}`
|
|
4213
|
+
),
|
|
4214
|
+
id: `${baseId}-gabarito-${++elementCounter.current}`
|
|
4215
|
+
};
|
|
4216
|
+
};
|
|
4217
|
+
const renderStudentPlaceholder = (selectId, elementCounter) => {
|
|
4218
|
+
const studentAnswer = studentAnswers[selectId];
|
|
4219
|
+
if (!studentAnswer) {
|
|
4220
|
+
return {
|
|
4221
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4222
|
+
Text_default,
|
|
4223
|
+
{
|
|
4224
|
+
size: "md",
|
|
4225
|
+
weight: "normal",
|
|
4226
|
+
color: "text-text-400",
|
|
4227
|
+
className: "inline-flex mb-2.5 border-b-2 border-text-300",
|
|
4228
|
+
children: "[N\xE3o respondido]"
|
|
4229
|
+
},
|
|
4230
|
+
`${baseId}-no-answer-${selectId}`
|
|
4231
|
+
),
|
|
4232
|
+
id: `${baseId}-no-answer-${++elementCounter.current}`
|
|
4233
|
+
};
|
|
4234
|
+
}
|
|
4235
|
+
const isCorrect = studentAnswer.isCorrect;
|
|
4236
|
+
const colorClass = isCorrect ? "text-success-600 border-success-600" : "text-error-600 border-error-600";
|
|
4237
|
+
return {
|
|
4238
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4239
|
+
Badge_default,
|
|
4240
|
+
{
|
|
4241
|
+
variant: "solid",
|
|
4242
|
+
action: isCorrect ? "success" : "error",
|
|
4243
|
+
iconRight: isCorrect ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_phosphor_react11.CheckCircle, {}) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_phosphor_react11.XCircle, {}),
|
|
4244
|
+
size: "large",
|
|
4245
|
+
className: `py-3 w-[180px] justify-between mb-2.5 ${colorClass}`,
|
|
4246
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-text-900", children: studentAnswer.answer })
|
|
4247
|
+
},
|
|
4248
|
+
`${baseId}-answer-${selectId}`
|
|
4249
|
+
),
|
|
4250
|
+
id: `${baseId}-answer-${++elementCounter.current}`
|
|
4251
|
+
};
|
|
4252
|
+
};
|
|
4253
|
+
const renderTextWithAnswers = (isGabarito = false) => {
|
|
4254
|
+
const elements = [];
|
|
4255
|
+
let lastIndex = 0;
|
|
4256
|
+
const elementCounter = { current: 0 };
|
|
4257
|
+
regex.lastIndex = 0;
|
|
4258
|
+
while ((match = regex.exec(text)) !== null) {
|
|
4259
|
+
const [fullMatch, selectId] = match;
|
|
4260
|
+
const startIndex = match.index;
|
|
4261
|
+
if (startIndex > lastIndex) {
|
|
4262
|
+
addTextElement(
|
|
4263
|
+
elements,
|
|
4264
|
+
text.slice(lastIndex, startIndex),
|
|
4265
|
+
elementCounter
|
|
4266
|
+
);
|
|
4267
|
+
}
|
|
4268
|
+
const placeholderElement = isGabarito ? renderGabaritoPlaceholder(selectId, elementCounter) : renderStudentPlaceholder(selectId, elementCounter);
|
|
4269
|
+
elements.push(placeholderElement);
|
|
4270
|
+
lastIndex = match.index + fullMatch.length;
|
|
4271
|
+
}
|
|
4272
|
+
if (lastIndex < text.length) {
|
|
4273
|
+
addTextElement(elements, text.slice(lastIndex), elementCounter);
|
|
4274
|
+
}
|
|
4275
|
+
return elements;
|
|
4276
|
+
};
|
|
4277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "pt-2 space-y-4", children: [
|
|
4278
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "space-y-2", children: [
|
|
4279
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text_default, { size: "xs", weight: "normal", color: "text-text-500", children: "Resposta do aluno:" }),
|
|
4280
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "p-3 bg-background-50 rounded-lg border border-border-100", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "leading-8", children: renderTextWithAnswers(false).map((element) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4281
|
+
Text_default,
|
|
4282
|
+
{
|
|
4283
|
+
size: "md",
|
|
4284
|
+
weight: "normal",
|
|
4285
|
+
color: "text-text-900",
|
|
4286
|
+
children: element.element
|
|
4287
|
+
},
|
|
4288
|
+
element.id
|
|
4289
|
+
)) }) })
|
|
4290
|
+
] }),
|
|
4291
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "space-y-2", children: [
|
|
4292
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Text_default, { size: "xs", weight: "normal", color: "text-text-500", children: "Gabarito:" }),
|
|
4293
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "p-3 bg-background-50 rounded-lg border border-border-100", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "leading-8", children: renderTextWithAnswers(true).map((element) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4294
|
+
Text_default,
|
|
4295
|
+
{
|
|
4296
|
+
size: "md",
|
|
4297
|
+
weight: "normal",
|
|
4298
|
+
color: "text-text-900",
|
|
4299
|
+
children: element.element
|
|
4300
|
+
},
|
|
4301
|
+
element.id
|
|
4302
|
+
)) }) })
|
|
4303
|
+
] })
|
|
4304
|
+
] });
|
|
4305
|
+
};
|
|
4306
|
+
|
|
4307
|
+
// src/utils/questionRenderer/trueOrFalse/index.tsx
|
|
4308
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4309
|
+
var renderQuestionTrueOrFalse = ({
|
|
4310
|
+
question,
|
|
4311
|
+
result
|
|
4312
|
+
}) => {
|
|
4313
|
+
const options = question.options || [];
|
|
4314
|
+
const getLetterByIndex = (index) => String.fromCodePoint(97 + index);
|
|
4315
|
+
const shouldShowStatus = result?.answerStatus !== "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */ && result?.answerStatus !== "NAO_RESPONDIDO" /* NAO_RESPONDIDO */;
|
|
4316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
4317
|
+
const statementIsTrue = result?.options?.find((op) => op.id === option.id)?.isCorrect || false;
|
|
4318
|
+
const isSelected = result?.selectedOptions?.some(
|
|
4319
|
+
(op) => op.optionId === option.id
|
|
4320
|
+
);
|
|
4321
|
+
const isStudentCorrect = statementIsTrue === isSelected;
|
|
4322
|
+
const variantCorrect = statementIsTrue ? "correct" : "incorrect";
|
|
4323
|
+
const studentAnswer = isSelected ? "V" : "F";
|
|
4324
|
+
const correctAnswer = statementIsTrue ? "V" : "F";
|
|
4325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4326
|
+
"section",
|
|
4327
|
+
{
|
|
4328
|
+
className: "flex flex-col gap-2",
|
|
4329
|
+
children: [
|
|
4330
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
4331
|
+
"div",
|
|
4332
|
+
{
|
|
4333
|
+
className: cn(
|
|
4334
|
+
"flex flex-row justify-between items-center gap-2 p-2 rounded-md border",
|
|
4335
|
+
shouldShowStatus ? getStatusStyles(variantCorrect) : ""
|
|
4336
|
+
),
|
|
4337
|
+
children: [
|
|
4338
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Text_default, { size: "sm", weight: "normal", color: "text-text-900", children: getLetterByIndex(index).concat(") ").concat(option.option) }),
|
|
4339
|
+
shouldShowStatus && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex-shrink-0", children: getStatusBadge(isStudentCorrect ? "correct" : "incorrect") })
|
|
4340
|
+
]
|
|
4341
|
+
}
|
|
4342
|
+
),
|
|
4343
|
+
shouldShowStatus && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
4344
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text_default, { size: "2xs", weight: "normal", color: "text-text-800", children: [
|
|
4345
|
+
"Resposta selecionada: ",
|
|
4346
|
+
studentAnswer
|
|
4347
|
+
] }),
|
|
4348
|
+
!isStudentCorrect && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Text_default, { size: "2xs", weight: "normal", color: "text-text-800", children: [
|
|
4349
|
+
"Resposta correta: ",
|
|
4350
|
+
correctAnswer
|
|
4351
|
+
] })
|
|
4352
|
+
] })
|
|
4353
|
+
]
|
|
4354
|
+
},
|
|
4355
|
+
option.id || `option-${index}`
|
|
4356
|
+
);
|
|
4357
|
+
}) }) });
|
|
4358
|
+
};
|
|
4359
|
+
|
|
4360
|
+
// src/utils/questionRenderer/dissertative/index.tsx
|
|
4361
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4362
|
+
var renderQuestionDissertative = ({
|
|
4363
|
+
result
|
|
4364
|
+
}) => {
|
|
4365
|
+
const localAnswer = result?.answer || "";
|
|
4366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "pt-2 space-y-4", children: [
|
|
4367
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-2", children: [
|
|
4368
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text_default, { size: "sm", weight: "normal", color: "text-text-950", children: "Resposta do aluno" }),
|
|
4369
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "p-3 bg-background-50 rounded-lg border border-border-100", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text_default, { size: "sm", weight: "normal", color: "text-text-700", children: localAnswer || "Nenhuma resposta fornecida" }) })
|
|
4370
|
+
] }),
|
|
4371
|
+
result?.answerStatus === "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && result?.teacherFeedback && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-2", children: [
|
|
4372
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text_default, { size: "xs", weight: "normal", color: "text-text-500", children: "Observa\xE7\xE3o do professor:" }),
|
|
4373
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "p-3 bg-background-50 rounded-lg border border-border-100", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Text_default, { size: "sm", weight: "normal", color: "text-text-700", children: result.teacherFeedback }) })
|
|
4374
|
+
] })
|
|
4375
|
+
] });
|
|
4376
|
+
};
|
|
4377
|
+
|
|
4378
|
+
// src/utils/questionRenderer/fill/index.tsx
|
|
4379
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4380
|
+
var renderQuestionFill = ({
|
|
4381
|
+
question,
|
|
4382
|
+
result
|
|
4383
|
+
}) => {
|
|
4384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FillQuestionContent, { question, result });
|
|
4385
|
+
};
|
|
4386
|
+
|
|
4387
|
+
// src/utils/questionRenderer/image/index.tsx
|
|
4388
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4389
|
+
var renderQuestionImage = ({
|
|
4390
|
+
result
|
|
4391
|
+
}) => {
|
|
4392
|
+
const correctPositionRelative = { x: 0.48, y: 0.45 };
|
|
4393
|
+
const correctRadiusRelative = 0.1;
|
|
4394
|
+
let userPositionRelative = null;
|
|
4395
|
+
try {
|
|
4396
|
+
if (result?.answer) {
|
|
4397
|
+
const parsed = typeof result.answer === "string" ? JSON.parse(result.answer) : result.answer;
|
|
4398
|
+
if (parsed && typeof parsed.x === "number" && typeof parsed.y === "number") {
|
|
4399
|
+
userPositionRelative = { x: parsed.x, y: parsed.y };
|
|
4400
|
+
}
|
|
4401
|
+
}
|
|
4402
|
+
} catch {
|
|
4403
|
+
userPositionRelative = null;
|
|
4404
|
+
}
|
|
4405
|
+
const isCorrect = userPositionRelative ? Math.sqrt(
|
|
4406
|
+
Math.pow(userPositionRelative.x - correctPositionRelative.x, 2) + Math.pow(userPositionRelative.y - correctPositionRelative.y, 2)
|
|
4407
|
+
) <= correctRadiusRelative : false;
|
|
4408
|
+
const getUserCircleColorClasses = () => {
|
|
4409
|
+
if (!userPositionRelative) return "";
|
|
4410
|
+
return isCorrect ? "bg-success-600/70 border-white" : "bg-indicator-error/70 border-white";
|
|
4411
|
+
};
|
|
4412
|
+
const getPositionDescription = (x, y) => {
|
|
4413
|
+
const xPercent = Math.round(x * 100);
|
|
4414
|
+
const yPercent = Math.round(y * 100);
|
|
4415
|
+
return `${xPercent}% da esquerda, ${yPercent}% do topo`;
|
|
4416
|
+
};
|
|
4417
|
+
const getSpatialRelationship = () => {
|
|
4418
|
+
if (!userPositionRelative) {
|
|
4419
|
+
return `\xC1rea correta localizada em ${getPositionDescription(
|
|
4420
|
+
correctPositionRelative.x,
|
|
4421
|
+
correctPositionRelative.y
|
|
4422
|
+
)}. Nenhuma resposta do aluno fornecida.`;
|
|
4423
|
+
}
|
|
4424
|
+
const deltaX = userPositionRelative.x - correctPositionRelative.x;
|
|
4425
|
+
const deltaY = userPositionRelative.y - correctPositionRelative.y;
|
|
4426
|
+
const distance = Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));
|
|
4427
|
+
const distancePercent = Math.round(distance * 100);
|
|
4428
|
+
let direction = "";
|
|
4429
|
+
if (Math.abs(deltaX) > Math.abs(deltaY)) {
|
|
4430
|
+
direction = deltaX > 0 ? "\xE0 direita" : "\xE0 esquerda";
|
|
4431
|
+
} else {
|
|
4432
|
+
direction = deltaY > 0 ? "abaixo" : "acima";
|
|
4433
|
+
}
|
|
4434
|
+
const correctPos = getPositionDescription(
|
|
4435
|
+
correctPositionRelative.x,
|
|
4436
|
+
correctPositionRelative.y
|
|
4437
|
+
);
|
|
4438
|
+
const userPos = getPositionDescription(
|
|
4439
|
+
userPositionRelative.x,
|
|
4440
|
+
userPositionRelative.y
|
|
4441
|
+
);
|
|
4442
|
+
return `\xC1rea correta localizada em ${correctPos}. Resposta do aluno em ${userPos}. A resposta do aluno est\xE1 ${distancePercent}% de dist\xE2ncia ${direction} da \xE1rea correta. ${isCorrect ? "A resposta est\xE1 dentro da \xE1rea de toler\xE2ncia e \xE9 considerada correta." : "A resposta est\xE1 fora da \xE1rea de toler\xE2ncia e \xE9 considerada incorreta."}`;
|
|
4443
|
+
};
|
|
4444
|
+
const correctPositionDescription = getPositionDescription(
|
|
4445
|
+
correctPositionRelative.x,
|
|
4446
|
+
correctPositionRelative.y
|
|
4447
|
+
);
|
|
4448
|
+
const imageAltText = `Quest\xE3o de imagem com \xE1rea correta localizada em ${correctPositionDescription}`;
|
|
4449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "pt-2 space-y-4", children: [
|
|
4450
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-4 text-xs", children: [
|
|
4451
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4452
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "w-3 h-3 rounded-full bg-indicator-primary/70 border border-[#F8CC2E]" }),
|
|
4453
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text_default, { size: "sm", weight: "normal", color: "text-text-600", children: "\xC1rea correta" })
|
|
4454
|
+
] }),
|
|
4455
|
+
userPositionRelative && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
4456
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4457
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "w-3 h-3 rounded-full bg-success-600/70 border border-white" }),
|
|
4458
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text_default, { size: "sm", weight: "normal", color: "text-text-600", children: "Resposta correta" })
|
|
4459
|
+
] }),
|
|
4460
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4461
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "w-3 h-3 rounded-full bg-indicator-error/70 border border-white" }),
|
|
4462
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text_default, { size: "sm", weight: "normal", color: "text-text-600", children: "Resposta incorreta" })
|
|
4463
|
+
] })
|
|
4464
|
+
] })
|
|
4465
|
+
] }),
|
|
4466
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative w-full", children: [
|
|
4467
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "sr-only", children: getSpatialRelationship() }),
|
|
4468
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4469
|
+
"img",
|
|
4470
|
+
{
|
|
4471
|
+
src: mock_image_question_default,
|
|
4472
|
+
alt: imageAltText,
|
|
4473
|
+
className: "w-full h-auto rounded-md"
|
|
4474
|
+
}
|
|
4475
|
+
),
|
|
4476
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4477
|
+
"div",
|
|
4478
|
+
{
|
|
4479
|
+
role: "img",
|
|
4480
|
+
"aria-label": `\xC1rea correta marcada em ${correctPositionDescription}`,
|
|
4481
|
+
className: "absolute rounded-full bg-indicator-primary/70 border-4 border-[#F8CC2E] pointer-events-none",
|
|
4482
|
+
style: {
|
|
4483
|
+
minWidth: "50px",
|
|
4484
|
+
maxWidth: "160px",
|
|
4485
|
+
width: "15%",
|
|
4486
|
+
aspectRatio: "1 / 1",
|
|
4487
|
+
left: `calc(${correctPositionRelative.x * 100}% - 7.5%)`,
|
|
4488
|
+
top: `calc(${correctPositionRelative.y * 100}% - 15%)`
|
|
4489
|
+
},
|
|
4490
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4491
|
+
Text_default,
|
|
4492
|
+
{
|
|
4493
|
+
size: "sm",
|
|
4494
|
+
weight: "normal",
|
|
4495
|
+
color: "text-text-600",
|
|
4496
|
+
className: "sr-only",
|
|
4497
|
+
children: [
|
|
4498
|
+
"C\xEDrculo amarelo indicando a \xE1rea correta da resposta, posicionado em",
|
|
4499
|
+
" ",
|
|
4500
|
+
correctPositionDescription
|
|
4501
|
+
]
|
|
4502
|
+
}
|
|
4503
|
+
)
|
|
4504
|
+
}
|
|
4505
|
+
),
|
|
4506
|
+
userPositionRelative && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4507
|
+
"div",
|
|
4508
|
+
{
|
|
4509
|
+
role: "img",
|
|
4510
|
+
"aria-label": `Resposta do aluno marcada em ${getPositionDescription(
|
|
4511
|
+
userPositionRelative.x,
|
|
4512
|
+
userPositionRelative.y
|
|
4513
|
+
)}, ${isCorrect ? "correta" : "incorreta"}`,
|
|
4514
|
+
className: `absolute rounded-full border-4 pointer-events-none ${getUserCircleColorClasses()}`,
|
|
4515
|
+
style: {
|
|
4516
|
+
minWidth: "30px",
|
|
4517
|
+
maxWidth: "52px",
|
|
4518
|
+
width: "5%",
|
|
4519
|
+
aspectRatio: "1 / 1",
|
|
4520
|
+
left: `calc(${userPositionRelative.x * 100}% - 2.5%)`,
|
|
4521
|
+
top: `calc(${userPositionRelative.y * 100}% - 2.5%)`
|
|
4522
|
+
},
|
|
4523
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
4524
|
+
Text_default,
|
|
4525
|
+
{
|
|
4526
|
+
size: "sm",
|
|
4527
|
+
weight: "normal",
|
|
4528
|
+
color: "text-text-600",
|
|
4529
|
+
className: "sr-only",
|
|
4530
|
+
children: [
|
|
4531
|
+
"C\xEDrculo ",
|
|
4532
|
+
isCorrect ? "verde" : "vermelho",
|
|
4533
|
+
" indicando a resposta do aluno, posicionado em",
|
|
4534
|
+
" ",
|
|
4535
|
+
getPositionDescription(
|
|
4536
|
+
userPositionRelative.x,
|
|
4537
|
+
userPositionRelative.y
|
|
4538
|
+
),
|
|
4539
|
+
". A resposta est\xE1",
|
|
4540
|
+
" ",
|
|
4541
|
+
Math.round(
|
|
4542
|
+
Math.sqrt(
|
|
4543
|
+
Math.pow(
|
|
4544
|
+
userPositionRelative.x - correctPositionRelative.x,
|
|
4545
|
+
2
|
|
4546
|
+
) + Math.pow(
|
|
4547
|
+
userPositionRelative.y - correctPositionRelative.y,
|
|
4548
|
+
2
|
|
4549
|
+
)
|
|
4550
|
+
) * 100
|
|
4551
|
+
),
|
|
4552
|
+
"% de dist\xE2ncia da \xE1rea correta e \xE9 considerada",
|
|
4553
|
+
" ",
|
|
4554
|
+
isCorrect ? "correta" : "incorreta",
|
|
4555
|
+
"."
|
|
4556
|
+
]
|
|
4557
|
+
}
|
|
4558
|
+
)
|
|
4559
|
+
}
|
|
4560
|
+
)
|
|
4561
|
+
] })
|
|
4562
|
+
] });
|
|
4563
|
+
};
|
|
4564
|
+
|
|
4565
|
+
// src/utils/questionRenderer/connectDots/index.tsx
|
|
4566
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4567
|
+
var renderQuestionConnectDots = ({
|
|
4568
|
+
paddingBottom
|
|
4569
|
+
} = {}) => {
|
|
4570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
4571
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(QuestionSubTitle, { subTitle: "Tipo de quest\xE3o: Ligar Pontos" }),
|
|
4572
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(QuestionContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text_default, { size: "md", weight: "normal", color: "text-text-600", children: "Tipo de quest\xE3o: Ligar Pontos (n\xE3o implementado)" }) }) })
|
|
4573
|
+
] });
|
|
4574
|
+
};
|
|
4575
|
+
|
|
4576
|
+
// src/utils/questionRenderer/index.tsx
|
|
4577
|
+
var questionRendererMap = {
|
|
4578
|
+
["ALTERNATIVA" /* ALTERNATIVA */]: renderQuestionAlternative,
|
|
4579
|
+
["MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */]: renderQuestionMultipleChoice,
|
|
4580
|
+
["VERDADEIRO_FALSO" /* VERDADEIRO_FALSO */]: renderQuestionTrueOrFalse,
|
|
4581
|
+
["DISSERTATIVA" /* DISSERTATIVA */]: renderQuestionDissertative,
|
|
4582
|
+
["PREENCHER" /* PREENCHER */]: renderQuestionFill,
|
|
4583
|
+
["IMAGEM" /* IMAGEM */]: renderQuestionImage,
|
|
4584
|
+
["LIGAR_PONTOS" /* LIGAR_PONTOS */]: renderQuestionConnectDots
|
|
4585
|
+
};
|
|
4586
|
+
|
|
4587
|
+
// src/components/CorrectActivityModal/CorrectActivityModal.tsx
|
|
4588
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4589
|
+
var variantConfig = {
|
|
4590
|
+
score: {
|
|
4591
|
+
bg: "bg-warning-background",
|
|
4592
|
+
text: "text-warning-600",
|
|
4593
|
+
iconBg: "bg-warning-300",
|
|
4594
|
+
iconColor: "text-white",
|
|
4595
|
+
IconComponent: import_phosphor_react12.Star
|
|
4596
|
+
},
|
|
4597
|
+
correct: {
|
|
4598
|
+
bg: "bg-success-200",
|
|
4599
|
+
text: "text-success-700",
|
|
4600
|
+
iconBg: "bg-indicator-positive",
|
|
4601
|
+
iconColor: "text-text-950",
|
|
4602
|
+
IconComponent: import_phosphor_react12.Medal
|
|
4603
|
+
},
|
|
4604
|
+
incorrect: {
|
|
4605
|
+
bg: "bg-error-100",
|
|
4606
|
+
text: "text-error-700",
|
|
4607
|
+
iconBg: "bg-indicator-negative",
|
|
4608
|
+
iconColor: "text-white",
|
|
4609
|
+
IconComponent: import_phosphor_react12.WarningCircle
|
|
4610
|
+
}
|
|
4611
|
+
};
|
|
4612
|
+
var StatCard = ({ label, value, variant }) => {
|
|
4613
|
+
const config = variantConfig[variant];
|
|
4614
|
+
const IconComponent = config.IconComponent;
|
|
4615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4616
|
+
"div",
|
|
4617
|
+
{
|
|
4618
|
+
className: cn(
|
|
4619
|
+
"border border-border-50 rounded-xl py-4 px-3 flex flex-col items-center justify-center gap-1",
|
|
4620
|
+
config.bg
|
|
4621
|
+
),
|
|
4622
|
+
children: [
|
|
4623
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4624
|
+
"div",
|
|
4625
|
+
{
|
|
4626
|
+
className: cn(
|
|
4627
|
+
"w-[30px] h-[30px] rounded-2xl flex items-center justify-center",
|
|
4628
|
+
config.iconBg
|
|
4629
|
+
),
|
|
4630
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4631
|
+
IconComponent,
|
|
4632
|
+
{
|
|
4633
|
+
size: 16,
|
|
4634
|
+
className: config.iconColor,
|
|
4635
|
+
weight: "regular"
|
|
4636
|
+
}
|
|
4637
|
+
)
|
|
4638
|
+
}
|
|
4639
|
+
),
|
|
4640
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4641
|
+
Text_default,
|
|
4642
|
+
{
|
|
4643
|
+
className: cn("text-2xs font-bold uppercase text-center", config.text),
|
|
4644
|
+
children: label
|
|
4645
|
+
}
|
|
4646
|
+
),
|
|
4647
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { className: cn("text-xl font-bold", config.text), children: value })
|
|
4648
|
+
]
|
|
4649
|
+
}
|
|
4650
|
+
);
|
|
4651
|
+
};
|
|
4652
|
+
var CorrectActivityModal = ({
|
|
4653
|
+
isOpen,
|
|
4654
|
+
onClose,
|
|
4655
|
+
data,
|
|
4656
|
+
isViewOnly = false,
|
|
4657
|
+
onObservationSubmit,
|
|
4658
|
+
onQuestionCorrectionSubmit
|
|
4659
|
+
}) => {
|
|
4660
|
+
const [observation, setObservation] = (0, import_react15.useState)("");
|
|
4661
|
+
const [isObservationExpanded, setIsObservationExpanded] = (0, import_react15.useState)(false);
|
|
4662
|
+
const [isObservationSaved, setIsObservationSaved] = (0, import_react15.useState)(false);
|
|
4663
|
+
const [savedObservation, setSavedObservation] = (0, import_react15.useState)("");
|
|
4664
|
+
const [attachedFiles, setAttachedFiles] = (0, import_react15.useState)([]);
|
|
4665
|
+
const [savedFiles, setSavedFiles] = (0, import_react15.useState)([]);
|
|
4666
|
+
const [existingAttachment, setExistingAttachment] = (0, import_react15.useState)(
|
|
4667
|
+
null
|
|
4668
|
+
);
|
|
4669
|
+
const fileInputRef = (0, import_react15.useRef)(null);
|
|
4670
|
+
const [essayCorrections, setEssayCorrections] = (0, import_react15.useState)({});
|
|
4671
|
+
(0, import_react15.useEffect)(() => {
|
|
4672
|
+
if (isOpen) {
|
|
4673
|
+
setObservation("");
|
|
4674
|
+
setIsObservationExpanded(false);
|
|
4675
|
+
setAttachedFiles([]);
|
|
4676
|
+
setSavedFiles([]);
|
|
4677
|
+
setExistingAttachment(data?.attachment ?? null);
|
|
4678
|
+
if (data?.observation || data?.attachment) {
|
|
4679
|
+
setIsObservationSaved(true);
|
|
4680
|
+
setSavedObservation(data.observation || "");
|
|
4681
|
+
} else {
|
|
4682
|
+
setIsObservationSaved(false);
|
|
4683
|
+
setSavedObservation("");
|
|
4684
|
+
}
|
|
4685
|
+
const initialCorrections = {};
|
|
4686
|
+
data?.questions?.forEach((questionData) => {
|
|
4687
|
+
if (questionData.question.questionType === "DISSERTATIVA" /* DISSERTATIVA */) {
|
|
4688
|
+
initialCorrections[questionData.questionNumber] = {
|
|
4689
|
+
isCorrect: questionData.correction?.isCorrect ?? null,
|
|
4690
|
+
teacherFeedback: questionData.correction?.teacherFeedback || "",
|
|
4691
|
+
isSaving: false
|
|
4692
|
+
};
|
|
4693
|
+
}
|
|
4694
|
+
});
|
|
4695
|
+
setEssayCorrections(initialCorrections);
|
|
4696
|
+
}
|
|
4697
|
+
}, [
|
|
4698
|
+
isOpen,
|
|
4699
|
+
data?.studentId,
|
|
4700
|
+
data?.observation,
|
|
4701
|
+
data?.attachment,
|
|
4702
|
+
data?.questions
|
|
4703
|
+
]);
|
|
4704
|
+
const handleOpenObservation = () => {
|
|
4705
|
+
setIsObservationExpanded(true);
|
|
4706
|
+
};
|
|
4707
|
+
const handleFilesAdd = (files) => {
|
|
4708
|
+
const newFile = files[0];
|
|
4709
|
+
if (newFile) {
|
|
4710
|
+
setAttachedFiles([{ file: newFile, id: generateFileId() }]);
|
|
4711
|
+
}
|
|
4712
|
+
};
|
|
4713
|
+
const handleFileRemove = (id) => {
|
|
4714
|
+
setAttachedFiles((prev) => prev.filter((f) => f.id !== id));
|
|
4715
|
+
};
|
|
4716
|
+
const handleSaveObservation = () => {
|
|
4717
|
+
if (observation.trim() || attachedFiles.length > 0 || existingAttachment) {
|
|
4718
|
+
if (!data?.studentId) {
|
|
4719
|
+
return;
|
|
4720
|
+
}
|
|
4721
|
+
setSavedObservation(observation);
|
|
4722
|
+
setSavedFiles([...attachedFiles]);
|
|
4723
|
+
setIsObservationSaved(true);
|
|
4724
|
+
setIsObservationExpanded(false);
|
|
4725
|
+
onObservationSubmit?.(
|
|
4726
|
+
data.studentId,
|
|
4727
|
+
observation,
|
|
4728
|
+
attachedFiles.map((f) => f.file)
|
|
4729
|
+
);
|
|
4730
|
+
}
|
|
4731
|
+
};
|
|
4732
|
+
const handleEditObservation = () => {
|
|
4733
|
+
setObservation(savedObservation);
|
|
4734
|
+
setAttachedFiles([...savedFiles]);
|
|
4735
|
+
setIsObservationSaved(false);
|
|
4736
|
+
setIsObservationExpanded(true);
|
|
4737
|
+
};
|
|
4738
|
+
const handleSaveEssayCorrection = (0, import_react15.useCallback)(
|
|
4739
|
+
async (questionNumber) => {
|
|
4740
|
+
if (!data?.studentId || !onQuestionCorrectionSubmit) return;
|
|
4741
|
+
const correction = essayCorrections[questionNumber];
|
|
4742
|
+
if (correction?.isCorrect == null) {
|
|
4743
|
+
return;
|
|
4744
|
+
}
|
|
4745
|
+
setEssayCorrections((prev) => ({
|
|
4746
|
+
...prev,
|
|
4747
|
+
[questionNumber]: { ...prev[questionNumber], isSaving: true }
|
|
4748
|
+
}));
|
|
4749
|
+
try {
|
|
4750
|
+
const questionData = data?.questions.find(
|
|
4751
|
+
(q) => q.questionNumber === questionNumber
|
|
4752
|
+
);
|
|
4753
|
+
if (!questionData) {
|
|
4754
|
+
console.error("Quest\xE3o n\xE3o encontrada:", questionNumber);
|
|
4755
|
+
return;
|
|
4756
|
+
}
|
|
4757
|
+
await onQuestionCorrectionSubmit(data.studentId, {
|
|
4758
|
+
questionId: questionData.question.id,
|
|
4759
|
+
questionNumber,
|
|
4760
|
+
isCorrect: correction.isCorrect,
|
|
4761
|
+
teacherFeedback: correction.teacherFeedback
|
|
4762
|
+
});
|
|
4763
|
+
} catch (error) {
|
|
4764
|
+
console.error("Erro ao salvar corre\xE7\xE3o da quest\xE3o:", error);
|
|
4765
|
+
} finally {
|
|
4766
|
+
setEssayCorrections((prev) => ({
|
|
4767
|
+
...prev,
|
|
4768
|
+
[questionNumber]: { ...prev[questionNumber], isSaving: false }
|
|
4769
|
+
}));
|
|
4770
|
+
}
|
|
4771
|
+
},
|
|
4772
|
+
[
|
|
4773
|
+
data?.studentId,
|
|
4774
|
+
data?.questions,
|
|
4775
|
+
essayCorrections,
|
|
4776
|
+
onQuestionCorrectionSubmit
|
|
4777
|
+
]
|
|
4778
|
+
);
|
|
4779
|
+
const updateEssayCorrection = (0, import_react15.useCallback)(
|
|
4780
|
+
(questionNumber, field, value) => {
|
|
4781
|
+
setEssayCorrections((prev) => ({
|
|
4782
|
+
...prev,
|
|
4783
|
+
[questionNumber]: {
|
|
4784
|
+
...prev[questionNumber],
|
|
4785
|
+
[field]: value
|
|
4786
|
+
}
|
|
4787
|
+
}));
|
|
4788
|
+
},
|
|
4789
|
+
[]
|
|
4790
|
+
);
|
|
4791
|
+
const getAccordionTitle = (questionType) => {
|
|
4792
|
+
switch (questionType) {
|
|
4793
|
+
case "ALTERNATIVA" /* ALTERNATIVA */:
|
|
4794
|
+
case "MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */:
|
|
4795
|
+
case "VERDADEIRO_FALSO" /* VERDADEIRO_FALSO */:
|
|
4796
|
+
return "Alternativas";
|
|
4797
|
+
case "DISSERTATIVA" /* DISSERTATIVA */:
|
|
4798
|
+
return "Resposta";
|
|
4799
|
+
case "PREENCHER" /* PREENCHER */:
|
|
4800
|
+
return "Preencher Lacunas";
|
|
4801
|
+
case "IMAGEM" /* IMAGEM */:
|
|
4802
|
+
return "Imagem";
|
|
4803
|
+
case "LIGAR_PONTOS" /* LIGAR_PONTOS */:
|
|
4804
|
+
return "Ligar Pontos";
|
|
4805
|
+
default:
|
|
4806
|
+
return "Resposta";
|
|
4807
|
+
}
|
|
4808
|
+
};
|
|
4809
|
+
const renderQuestionContent = (questionData) => {
|
|
4810
|
+
const { question, result } = questionData;
|
|
4811
|
+
const questionType = question.questionType;
|
|
4812
|
+
const accordionTitle = getAccordionTitle(questionType);
|
|
4813
|
+
let content;
|
|
4814
|
+
switch (questionType) {
|
|
4815
|
+
case "ALTERNATIVA" /* ALTERNATIVA */:
|
|
4816
|
+
content = renderQuestionAlternative({
|
|
4817
|
+
question,
|
|
4818
|
+
result
|
|
4819
|
+
});
|
|
4820
|
+
break;
|
|
4821
|
+
case "MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */:
|
|
4822
|
+
content = renderQuestionMultipleChoice({
|
|
4823
|
+
question,
|
|
4824
|
+
result
|
|
4825
|
+
});
|
|
4826
|
+
break;
|
|
4827
|
+
case "VERDADEIRO_FALSO" /* VERDADEIRO_FALSO */:
|
|
4828
|
+
content = renderQuestionTrueOrFalse({
|
|
4829
|
+
question,
|
|
4830
|
+
result
|
|
4831
|
+
});
|
|
4832
|
+
break;
|
|
4833
|
+
case "DISSERTATIVA" /* DISSERTATIVA */:
|
|
4834
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
4835
|
+
renderQuestionDissertative({
|
|
4836
|
+
result
|
|
4837
|
+
}),
|
|
4838
|
+
!isViewOnly && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "space-y-4 border-t border-border-100 pt-4 mt-4", children: renderEssayCorrectionFields(questionData) })
|
|
4839
|
+
] });
|
|
4840
|
+
break;
|
|
4841
|
+
case "PREENCHER" /* PREENCHER */:
|
|
4842
|
+
content = renderQuestionFill({
|
|
4843
|
+
question,
|
|
4844
|
+
result
|
|
4845
|
+
});
|
|
4846
|
+
break;
|
|
4847
|
+
case "IMAGEM" /* IMAGEM */:
|
|
4848
|
+
content = renderQuestionImage({
|
|
4849
|
+
result
|
|
4850
|
+
});
|
|
4851
|
+
break;
|
|
4852
|
+
case "LIGAR_PONTOS" /* LIGAR_PONTOS */:
|
|
4853
|
+
content = renderQuestionConnectDots({ paddingBottom: "" });
|
|
4854
|
+
break;
|
|
4855
|
+
default:
|
|
4856
|
+
if (question.options && question.options.length > 0) {
|
|
4857
|
+
content = renderQuestionAlternative({
|
|
4858
|
+
question,
|
|
4859
|
+
result
|
|
4860
|
+
});
|
|
4861
|
+
} else {
|
|
4862
|
+
content = renderQuestionDissertative({
|
|
4863
|
+
result
|
|
4864
|
+
});
|
|
4865
|
+
}
|
|
4866
|
+
}
|
|
4867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4868
|
+
CardAccordation,
|
|
4869
|
+
{
|
|
4870
|
+
value: `accordion-${questionData.questionNumber}`,
|
|
4871
|
+
className: "border border-border-100 rounded-lg",
|
|
4872
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "py-3 pr-2 w-full", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { className: "text-sm font-bold text-text-950", children: accordionTitle }) }),
|
|
4873
|
+
children: content
|
|
4874
|
+
}
|
|
4875
|
+
);
|
|
4876
|
+
};
|
|
4877
|
+
const renderEssayCorrectionFields = (questionData) => {
|
|
4878
|
+
const correction = essayCorrections[questionData.questionNumber] || {
|
|
4879
|
+
isCorrect: null,
|
|
4880
|
+
teacherFeedback: "",
|
|
4881
|
+
isSaving: false
|
|
4882
|
+
};
|
|
4883
|
+
let radioValue;
|
|
4884
|
+
if (correction.isCorrect === null) {
|
|
4885
|
+
radioValue = void 0;
|
|
4886
|
+
} else if (correction.isCorrect) {
|
|
4887
|
+
radioValue = "true";
|
|
4888
|
+
} else {
|
|
4889
|
+
radioValue = "false";
|
|
4890
|
+
}
|
|
4891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
4892
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-2", children: [
|
|
4893
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { className: "text-sm font-semibold text-text-950", children: "Resposta est\xE1 correta?" }),
|
|
4894
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex gap-4", children: [
|
|
4895
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4896
|
+
Radio_default,
|
|
4897
|
+
{
|
|
4898
|
+
name: `isCorrect-${questionData.questionNumber}`,
|
|
4899
|
+
value: "true",
|
|
4900
|
+
id: `correct-yes-${questionData.questionNumber}`,
|
|
4901
|
+
label: "Sim",
|
|
4902
|
+
size: "medium",
|
|
4903
|
+
checked: radioValue === "true",
|
|
4904
|
+
onChange: (e) => {
|
|
4905
|
+
if (e.target.checked) {
|
|
4906
|
+
updateEssayCorrection(
|
|
4907
|
+
questionData.questionNumber,
|
|
4908
|
+
"isCorrect",
|
|
4909
|
+
true
|
|
4910
|
+
);
|
|
4911
|
+
}
|
|
4912
|
+
}
|
|
4913
|
+
}
|
|
4914
|
+
),
|
|
4915
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4916
|
+
Radio_default,
|
|
4917
|
+
{
|
|
4918
|
+
name: `isCorrect-${questionData.questionNumber}`,
|
|
4919
|
+
value: "false",
|
|
4920
|
+
id: `correct-no-${questionData.questionNumber}`,
|
|
4921
|
+
label: "N\xE3o",
|
|
4922
|
+
size: "medium",
|
|
4923
|
+
checked: radioValue === "false",
|
|
4924
|
+
onChange: (e) => {
|
|
4925
|
+
if (e.target.checked) {
|
|
4926
|
+
updateEssayCorrection(
|
|
4927
|
+
questionData.questionNumber,
|
|
4928
|
+
"isCorrect",
|
|
4929
|
+
false
|
|
4930
|
+
);
|
|
4931
|
+
}
|
|
4932
|
+
}
|
|
4933
|
+
}
|
|
4934
|
+
)
|
|
4935
|
+
] })
|
|
4936
|
+
] }),
|
|
4937
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-2", children: [
|
|
4938
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { className: "text-sm font-semibold text-text-950", children: "Incluir observa\xE7\xE3o" }),
|
|
4939
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4940
|
+
TextArea_default,
|
|
4941
|
+
{
|
|
4942
|
+
value: correction.teacherFeedback,
|
|
4943
|
+
onChange: (e) => {
|
|
4944
|
+
updateEssayCorrection(
|
|
4945
|
+
questionData.questionNumber,
|
|
4946
|
+
"teacherFeedback",
|
|
4947
|
+
e.target.value
|
|
4948
|
+
);
|
|
4949
|
+
},
|
|
4950
|
+
placeholder: "Escreva uma observa\xE7\xE3o sobre a resposta do aluno",
|
|
4951
|
+
rows: 4,
|
|
4952
|
+
size: "medium"
|
|
4953
|
+
}
|
|
4954
|
+
)
|
|
4955
|
+
] }),
|
|
4956
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4957
|
+
Button_default,
|
|
4958
|
+
{
|
|
4959
|
+
size: "small",
|
|
4960
|
+
onClick: () => handleSaveEssayCorrection(questionData.questionNumber),
|
|
4961
|
+
disabled: correction.isCorrect === null || correction.isSaving || !onQuestionCorrectionSubmit,
|
|
4962
|
+
children: correction.isSaving ? "Salvando..." : "Salvar"
|
|
4963
|
+
}
|
|
4964
|
+
)
|
|
4965
|
+
] });
|
|
4966
|
+
};
|
|
4967
|
+
if (!data) return null;
|
|
4968
|
+
const title = isViewOnly ? "Detalhes da atividade" : "Corrigir atividade";
|
|
4969
|
+
const formattedScore = data.score == null ? "-" : data.score.toFixed(1);
|
|
4970
|
+
const renderObservationSection = () => {
|
|
4971
|
+
const getFileNameFromUrl = (url) => {
|
|
4972
|
+
try {
|
|
4973
|
+
const urlObj = new URL(url);
|
|
4974
|
+
const urlPath = urlObj.pathname;
|
|
4975
|
+
return urlPath.split("/").pop() || "Anexo";
|
|
4976
|
+
} catch {
|
|
4977
|
+
return "Anexo";
|
|
4978
|
+
}
|
|
4979
|
+
};
|
|
4980
|
+
const renderAttachmentInput = () => {
|
|
3488
4981
|
if (attachedFiles.length > 0) {
|
|
3489
|
-
return /* @__PURE__ */ (0,
|
|
3490
|
-
/* @__PURE__ */ (0,
|
|
3491
|
-
/* @__PURE__ */ (0,
|
|
3492
|
-
/* @__PURE__ */ (0,
|
|
4982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center justify-center gap-2 px-5 h-10 bg-secondary-500 rounded-full min-w-0 max-w-[150px]", children: [
|
|
4983
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_phosphor_react12.Paperclip, { size: 18, className: "text-text-800 flex-shrink-0" }),
|
|
4984
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-base font-medium text-text-800 truncate", children: attachedFiles[0].file.name }),
|
|
4985
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3493
4986
|
"button",
|
|
3494
4987
|
{
|
|
3495
4988
|
type: "button",
|
|
3496
4989
|
onClick: () => handleFileRemove(attachedFiles[0].id),
|
|
3497
4990
|
className: "text-text-700 hover:text-text-800 flex-shrink-0",
|
|
3498
4991
|
"aria-label": `Remover ${attachedFiles[0].file.name}`,
|
|
3499
|
-
children: /* @__PURE__ */ (0,
|
|
4992
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_phosphor_react12.X, { size: 18 })
|
|
3500
4993
|
}
|
|
3501
4994
|
)
|
|
3502
4995
|
] });
|
|
3503
4996
|
}
|
|
3504
4997
|
if (existingAttachment) {
|
|
3505
|
-
return /* @__PURE__ */ (0,
|
|
3506
|
-
/* @__PURE__ */ (0,
|
|
4998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
4999
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3507
5000
|
"a",
|
|
3508
5001
|
{
|
|
3509
5002
|
href: existingAttachment,
|
|
@@ -3511,12 +5004,12 @@ var CorrectActivityModal = ({
|
|
|
3511
5004
|
rel: "noopener noreferrer",
|
|
3512
5005
|
className: "flex items-center gap-2 px-5 h-10 bg-secondary-500 rounded-full min-w-0 max-w-[150px] hover:bg-secondary-600 transition-colors",
|
|
3513
5006
|
children: [
|
|
3514
|
-
/* @__PURE__ */ (0,
|
|
3515
|
-
/* @__PURE__ */ (0,
|
|
5007
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_phosphor_react12.Paperclip, { size: 18, className: "text-text-800 flex-shrink-0" }),
|
|
5008
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-base font-medium text-text-800 truncate", children: getFileNameFromUrl(existingAttachment) })
|
|
3516
5009
|
]
|
|
3517
5010
|
}
|
|
3518
5011
|
),
|
|
3519
|
-
/* @__PURE__ */ (0,
|
|
5012
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3520
5013
|
Button_default,
|
|
3521
5014
|
{
|
|
3522
5015
|
type: "button",
|
|
@@ -3525,14 +5018,14 @@ var CorrectActivityModal = ({
|
|
|
3525
5018
|
onClick: () => fileInputRef.current?.click(),
|
|
3526
5019
|
className: "flex items-center gap-2",
|
|
3527
5020
|
children: [
|
|
3528
|
-
/* @__PURE__ */ (0,
|
|
5021
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_phosphor_react12.Paperclip, { size: 18 }),
|
|
3529
5022
|
"Trocar"
|
|
3530
5023
|
]
|
|
3531
5024
|
}
|
|
3532
5025
|
)
|
|
3533
5026
|
] });
|
|
3534
5027
|
}
|
|
3535
|
-
return /* @__PURE__ */ (0,
|
|
5028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3536
5029
|
Button_default,
|
|
3537
5030
|
{
|
|
3538
5031
|
type: "button",
|
|
@@ -3541,28 +5034,28 @@ var CorrectActivityModal = ({
|
|
|
3541
5034
|
onClick: () => fileInputRef.current?.click(),
|
|
3542
5035
|
className: "flex items-center gap-2",
|
|
3543
5036
|
children: [
|
|
3544
|
-
/* @__PURE__ */ (0,
|
|
5037
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_phosphor_react12.Paperclip, { size: 18 }),
|
|
3545
5038
|
"Anexar"
|
|
3546
5039
|
]
|
|
3547
5040
|
}
|
|
3548
5041
|
);
|
|
3549
5042
|
};
|
|
3550
5043
|
if (isObservationSaved) {
|
|
3551
|
-
return /* @__PURE__ */ (0,
|
|
3552
|
-
/* @__PURE__ */ (0,
|
|
3553
|
-
/* @__PURE__ */ (0,
|
|
3554
|
-
/* @__PURE__ */ (0,
|
|
3555
|
-
savedFiles.length > 0 && /* @__PURE__ */ (0,
|
|
3556
|
-
/* @__PURE__ */ (0,
|
|
3557
|
-
|
|
5044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "bg-background border border-border-100 rounded-lg p-4 space-y-2", children: [
|
|
5045
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3", children: [
|
|
5046
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { className: "text-sm font-bold text-text-950", children: "Observa\xE7\xE3o" }),
|
|
5047
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
5048
|
+
savedFiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-2 px-5 h-10 bg-secondary-500 rounded-full min-w-0 max-w-[150px]", children: [
|
|
5049
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5050
|
+
import_phosphor_react12.Paperclip,
|
|
3558
5051
|
{
|
|
3559
5052
|
size: 18,
|
|
3560
5053
|
className: "text-text-800 flex-shrink-0"
|
|
3561
5054
|
}
|
|
3562
5055
|
),
|
|
3563
|
-
/* @__PURE__ */ (0,
|
|
5056
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-base font-medium text-text-800 truncate", children: savedFiles[0].file.name })
|
|
3564
5057
|
] }),
|
|
3565
|
-
savedFiles.length === 0 && existingAttachment && /* @__PURE__ */ (0,
|
|
5058
|
+
savedFiles.length === 0 && existingAttachment && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3566
5059
|
"a",
|
|
3567
5060
|
{
|
|
3568
5061
|
href: existingAttachment,
|
|
@@ -3570,18 +5063,18 @@ var CorrectActivityModal = ({
|
|
|
3570
5063
|
rel: "noopener noreferrer",
|
|
3571
5064
|
className: "flex items-center gap-2 px-5 h-10 bg-secondary-500 rounded-full min-w-0 max-w-[150px] hover:bg-secondary-600 transition-colors",
|
|
3572
5065
|
children: [
|
|
3573
|
-
/* @__PURE__ */ (0,
|
|
3574
|
-
|
|
5066
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5067
|
+
import_phosphor_react12.Paperclip,
|
|
3575
5068
|
{
|
|
3576
5069
|
size: 18,
|
|
3577
5070
|
className: "text-text-800 flex-shrink-0"
|
|
3578
5071
|
}
|
|
3579
5072
|
),
|
|
3580
|
-
/* @__PURE__ */ (0,
|
|
5073
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-base font-medium text-text-800 truncate", children: getFileNameFromUrl(existingAttachment) })
|
|
3581
5074
|
]
|
|
3582
5075
|
}
|
|
3583
5076
|
),
|
|
3584
|
-
/* @__PURE__ */ (0,
|
|
5077
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3585
5078
|
Button_default,
|
|
3586
5079
|
{
|
|
3587
5080
|
type: "button",
|
|
@@ -3590,20 +5083,20 @@ var CorrectActivityModal = ({
|
|
|
3590
5083
|
onClick: handleEditObservation,
|
|
3591
5084
|
className: "flex items-center gap-2 flex-shrink-0",
|
|
3592
5085
|
children: [
|
|
3593
|
-
/* @__PURE__ */ (0,
|
|
5086
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_phosphor_react12.PencilSimple, { size: 16 }),
|
|
3594
5087
|
"Editar"
|
|
3595
5088
|
]
|
|
3596
5089
|
}
|
|
3597
5090
|
)
|
|
3598
5091
|
] })
|
|
3599
5092
|
] }),
|
|
3600
|
-
savedObservation && /* @__PURE__ */ (0,
|
|
5093
|
+
savedObservation && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "p-3 bg-background-50 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { className: "text-sm text-text-700", children: savedObservation }) })
|
|
3601
5094
|
] });
|
|
3602
5095
|
}
|
|
3603
5096
|
if (isObservationExpanded) {
|
|
3604
|
-
return /* @__PURE__ */ (0,
|
|
3605
|
-
/* @__PURE__ */ (0,
|
|
3606
|
-
/* @__PURE__ */ (0,
|
|
5097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "bg-background border border-border-100 rounded-lg p-4 space-y-3", children: [
|
|
5098
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { className: "text-sm font-bold text-text-950", children: "Observa\xE7\xE3o" }),
|
|
5099
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3607
5100
|
"textarea",
|
|
3608
5101
|
{
|
|
3609
5102
|
value: observation,
|
|
@@ -3612,7 +5105,7 @@ var CorrectActivityModal = ({
|
|
|
3612
5105
|
className: "w-full min-h-[80px] p-3 border border-border-100 rounded-lg text-sm text-text-700 placeholder:text-text-400 resize-none focus:outline-none focus:ring-2 focus:ring-primary-500"
|
|
3613
5106
|
}
|
|
3614
5107
|
),
|
|
3615
|
-
/* @__PURE__ */ (0,
|
|
5108
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3616
5109
|
"input",
|
|
3617
5110
|
{
|
|
3618
5111
|
type: "file",
|
|
@@ -3630,9 +5123,9 @@ var CorrectActivityModal = ({
|
|
|
3630
5123
|
"aria-label": "Selecionar arquivo"
|
|
3631
5124
|
}
|
|
3632
5125
|
),
|
|
3633
|
-
/* @__PURE__ */ (0,
|
|
5126
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-col-reverse sm:flex-row gap-3 sm:justify-between", children: [
|
|
3634
5127
|
renderAttachmentInput(),
|
|
3635
|
-
/* @__PURE__ */ (0,
|
|
5128
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3636
5129
|
Button_default,
|
|
3637
5130
|
{
|
|
3638
5131
|
type: "button",
|
|
@@ -3643,18 +5136,18 @@ var CorrectActivityModal = ({
|
|
|
3643
5136
|
}
|
|
3644
5137
|
)
|
|
3645
5138
|
] }),
|
|
3646
|
-
data.observation && /* @__PURE__ */ (0,
|
|
3647
|
-
/* @__PURE__ */ (0,
|
|
3648
|
-
/* @__PURE__ */ (0,
|
|
5139
|
+
data.observation && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "p-3 bg-background-50 rounded-lg", children: [
|
|
5140
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { className: "text-xs text-text-500", children: "Observa\xE7\xE3o anterior:" }),
|
|
5141
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { className: "text-sm text-text-700", children: data.observation })
|
|
3649
5142
|
] })
|
|
3650
5143
|
] });
|
|
3651
5144
|
}
|
|
3652
|
-
return /* @__PURE__ */ (0,
|
|
3653
|
-
/* @__PURE__ */ (0,
|
|
3654
|
-
/* @__PURE__ */ (0,
|
|
5145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "bg-background border border-border-100 rounded-lg p-4 flex flex-col sm:flex-row gap-3 sm:items-center sm:justify-between", children: [
|
|
5146
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { className: "text-sm font-bold text-text-950", children: "Observa\xE7\xE3o" }),
|
|
5147
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Button_default, { type: "button", size: "small", onClick: handleOpenObservation, children: "Incluir" })
|
|
3655
5148
|
] });
|
|
3656
5149
|
};
|
|
3657
|
-
return /* @__PURE__ */ (0,
|
|
5150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3658
5151
|
Modal_default,
|
|
3659
5152
|
{
|
|
3660
5153
|
isOpen,
|
|
@@ -3662,14 +5155,14 @@ var CorrectActivityModal = ({
|
|
|
3662
5155
|
title,
|
|
3663
5156
|
size: "lg",
|
|
3664
5157
|
contentClassName: "max-h-[80vh] overflow-y-auto",
|
|
3665
|
-
children: /* @__PURE__ */ (0,
|
|
3666
|
-
/* @__PURE__ */ (0,
|
|
3667
|
-
/* @__PURE__ */ (0,
|
|
3668
|
-
/* @__PURE__ */ (0,
|
|
5158
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-6", children: [
|
|
5159
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
5160
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "w-10 h-10 bg-primary-100 rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { className: "text-lg font-semibold text-primary-700", children: data.studentName?.charAt(0).toUpperCase() || "-" }) }),
|
|
5161
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { className: "text-lg font-medium text-text-950", children: data.studentName || "Aluno" })
|
|
3669
5162
|
] }),
|
|
3670
|
-
/* @__PURE__ */ (0,
|
|
3671
|
-
/* @__PURE__ */ (0,
|
|
3672
|
-
/* @__PURE__ */ (0,
|
|
5163
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "grid grid-cols-3 gap-4", children: [
|
|
5164
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(StatCard, { label: "Nota", value: formattedScore, variant: "score" }),
|
|
5165
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3673
5166
|
StatCard,
|
|
3674
5167
|
{
|
|
3675
5168
|
label: "N\xB0 de quest\xF5es corretas",
|
|
@@ -3677,7 +5170,7 @@ var CorrectActivityModal = ({
|
|
|
3677
5170
|
variant: "correct"
|
|
3678
5171
|
}
|
|
3679
5172
|
),
|
|
3680
|
-
/* @__PURE__ */ (0,
|
|
5173
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3681
5174
|
StatCard,
|
|
3682
5175
|
{
|
|
3683
5176
|
label: "N\xB0 de quest\xF5es incorretas",
|
|
@@ -3687,21 +5180,22 @@ var CorrectActivityModal = ({
|
|
|
3687
5180
|
)
|
|
3688
5181
|
] }),
|
|
3689
5182
|
renderObservationSection(),
|
|
3690
|
-
/* @__PURE__ */ (0,
|
|
3691
|
-
/* @__PURE__ */ (0,
|
|
3692
|
-
/* @__PURE__ */ (0,
|
|
3693
|
-
const
|
|
3694
|
-
|
|
5183
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-2", children: [
|
|
5184
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Text_default, { className: "text-sm font-bold text-text-950", children: "Respostas" }),
|
|
5185
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(AccordionGroup, { type: "multiple", className: "space-y-2", children: data.questions?.map((questionData) => {
|
|
5186
|
+
const status = getQuestionStatusFromData(questionData);
|
|
5187
|
+
const badgeConfig = getQuestionStatusBadgeConfig(status);
|
|
5188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3695
5189
|
CardAccordation,
|
|
3696
5190
|
{
|
|
3697
|
-
value: `question-${
|
|
5191
|
+
value: `question-${questionData.questionNumber}`,
|
|
3698
5192
|
className: "bg-background rounded-xl",
|
|
3699
|
-
trigger: /* @__PURE__ */ (0,
|
|
3700
|
-
/* @__PURE__ */ (0,
|
|
5193
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center justify-between w-full py-3 pr-2", children: [
|
|
5194
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Text_default, { className: "text-base font-bold text-text-950", children: [
|
|
3701
5195
|
"Quest\xE3o ",
|
|
3702
|
-
|
|
5196
|
+
questionData.questionNumber
|
|
3703
5197
|
] }),
|
|
3704
|
-
/* @__PURE__ */ (0,
|
|
5198
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3705
5199
|
Badge_default,
|
|
3706
5200
|
{
|
|
3707
5201
|
className: cn(
|
|
@@ -3713,43 +5207,21 @@ var CorrectActivityModal = ({
|
|
|
3713
5207
|
}
|
|
3714
5208
|
)
|
|
3715
5209
|
] }),
|
|
3716
|
-
children: /* @__PURE__ */ (0,
|
|
3717
|
-
question.
|
|
3718
|
-
|
|
3719
|
-
CardAccordation,
|
|
5210
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-4 pt-2", children: [
|
|
5211
|
+
questionData.question.statement && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5212
|
+
Text_default,
|
|
3720
5213
|
{
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
{
|
|
3727
|
-
mode: "readonly",
|
|
3728
|
-
selectedValue: question.studentAnswer,
|
|
3729
|
-
alternatives: question.alternatives.map(
|
|
3730
|
-
(alt) => ({
|
|
3731
|
-
value: alt.value,
|
|
3732
|
-
label: alt.label,
|
|
3733
|
-
status: alt.isCorrect ? "correct" : void 0
|
|
3734
|
-
})
|
|
3735
|
-
)
|
|
3736
|
-
}
|
|
3737
|
-
) })
|
|
5214
|
+
size: "sm",
|
|
5215
|
+
weight: "normal",
|
|
5216
|
+
color: "text-text-700",
|
|
5217
|
+
className: "whitespace-pre-wrap",
|
|
5218
|
+
children: questionData.question.statement
|
|
3738
5219
|
}
|
|
3739
5220
|
),
|
|
3740
|
-
(
|
|
3741
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex gap-2", children: [
|
|
3742
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text_default, { className: "text-xs text-text-500", children: "Resposta do aluno:" }),
|
|
3743
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text_default, { className: "text-xs text-text-700", children: question.studentAnswer || "N\xE3o respondeu" })
|
|
3744
|
-
] }),
|
|
3745
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex gap-2", children: [
|
|
3746
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text_default, { className: "text-xs text-text-500", children: "Resposta correta:" }),
|
|
3747
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text_default, { className: "text-xs text-success-700", children: question.correctAnswer || "-" })
|
|
3748
|
-
] })
|
|
3749
|
-
] })
|
|
5221
|
+
renderQuestionContent(questionData)
|
|
3750
5222
|
] })
|
|
3751
5223
|
},
|
|
3752
|
-
|
|
5224
|
+
questionData.questionNumber
|
|
3753
5225
|
);
|
|
3754
5226
|
}) })
|
|
3755
5227
|
] })
|