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