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
|
@@ -985,10 +985,152 @@ var RadioGroupItem = (0, import_react3.forwardRef)(
|
|
|
985
985
|
);
|
|
986
986
|
RadioGroupItem.displayName = "RadioGroupItem";
|
|
987
987
|
|
|
988
|
-
// src/components/
|
|
989
|
-
var import_phosphor_react3 = require("phosphor-react");
|
|
988
|
+
// src/components/IconRender/IconRender.tsx
|
|
990
989
|
var import_react4 = require("react");
|
|
990
|
+
var PhosphorIcons = __toESM(require("phosphor-react"));
|
|
991
|
+
|
|
992
|
+
// src/assets/icons/subjects/ChatPT.tsx
|
|
991
993
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
994
|
+
var ChatPT = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
995
|
+
"svg",
|
|
996
|
+
{
|
|
997
|
+
width: size,
|
|
998
|
+
height: size,
|
|
999
|
+
viewBox: "0 0 32 32",
|
|
1000
|
+
fill: "none",
|
|
1001
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1002
|
+
children: [
|
|
1003
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1004
|
+
"path",
|
|
1005
|
+
{
|
|
1006
|
+
d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
|
|
1007
|
+
fill: color
|
|
1008
|
+
}
|
|
1009
|
+
),
|
|
1010
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1011
|
+
"path",
|
|
1012
|
+
{
|
|
1013
|
+
d: "M21.1758 12V20.5312H19.7168V12H21.1758ZM23.8535 12V13.1719H17.0625V12H23.8535Z",
|
|
1014
|
+
fill: color
|
|
1015
|
+
}
|
|
1016
|
+
),
|
|
1017
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1018
|
+
"path",
|
|
1019
|
+
{
|
|
1020
|
+
d: "M13.2402 17.3496H11.0195V16.1836H13.2402C13.627 16.1836 13.9395 16.1211 14.1777 15.9961C14.416 15.8711 14.5898 15.6992 14.6992 15.4805C14.8125 15.2578 14.8691 15.0039 14.8691 14.7188C14.8691 14.4492 14.8125 14.1973 14.6992 13.9629C14.5898 13.7246 14.416 13.5332 14.1777 13.3887C13.9395 13.2441 13.627 13.1719 13.2402 13.1719H11.4707V20.5312H10V12H13.2402C13.9004 12 14.4609 12.1172 14.9219 12.3516C15.3867 12.582 15.7402 12.9023 15.9824 13.3125C16.2246 13.7188 16.3457 14.1836 16.3457 14.707C16.3457 15.2578 16.2246 15.7305 15.9824 16.125C15.7402 16.5195 15.3867 16.8223 14.9219 17.0332C14.4609 17.2441 13.9004 17.3496 13.2402 17.3496Z",
|
|
1021
|
+
fill: color
|
|
1022
|
+
}
|
|
1023
|
+
)
|
|
1024
|
+
]
|
|
1025
|
+
}
|
|
1026
|
+
);
|
|
1027
|
+
|
|
1028
|
+
// src/assets/icons/subjects/ChatEN.tsx
|
|
1029
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1030
|
+
var ChatEN = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1031
|
+
"svg",
|
|
1032
|
+
{
|
|
1033
|
+
width: size,
|
|
1034
|
+
height: size,
|
|
1035
|
+
viewBox: "0 0 32 32",
|
|
1036
|
+
fill: "none",
|
|
1037
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1038
|
+
children: [
|
|
1039
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1040
|
+
"path",
|
|
1041
|
+
{
|
|
1042
|
+
d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
|
|
1043
|
+
fill: color
|
|
1044
|
+
}
|
|
1045
|
+
),
|
|
1046
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1047
|
+
"path",
|
|
1048
|
+
{
|
|
1049
|
+
d: "M22.5488 12V20.5312H21.0781L17.252 14.4199V20.5312H15.7812V12H17.252L21.0898 18.123V12H22.5488Z",
|
|
1050
|
+
fill: color
|
|
1051
|
+
}
|
|
1052
|
+
),
|
|
1053
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1054
|
+
"path",
|
|
1055
|
+
{
|
|
1056
|
+
d: "M14.584 19.3652V20.5312H10.0547V19.3652H14.584ZM10.4707 12V20.5312H9V12H10.4707ZM13.9922 15.5625V16.7109H10.0547V15.5625H13.9922ZM14.5547 12V13.1719H10.0547V12H14.5547Z",
|
|
1057
|
+
fill: color
|
|
1058
|
+
}
|
|
1059
|
+
)
|
|
1060
|
+
]
|
|
1061
|
+
}
|
|
1062
|
+
);
|
|
1063
|
+
|
|
1064
|
+
// src/assets/icons/subjects/ChatES.tsx
|
|
1065
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1066
|
+
var ChatES = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1067
|
+
"svg",
|
|
1068
|
+
{
|
|
1069
|
+
width: size,
|
|
1070
|
+
height: size,
|
|
1071
|
+
viewBox: "0 0 32 32",
|
|
1072
|
+
fill: "none",
|
|
1073
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1074
|
+
children: [
|
|
1075
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1076
|
+
"path",
|
|
1077
|
+
{
|
|
1078
|
+
d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
|
|
1079
|
+
fill: color
|
|
1080
|
+
}
|
|
1081
|
+
),
|
|
1082
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1083
|
+
"path",
|
|
1084
|
+
{
|
|
1085
|
+
d: "M21.1426 17.8027C21.1426 17.627 21.1152 17.4707 21.0605 17.334C21.0098 17.1973 20.918 17.0723 20.7852 16.959C20.6523 16.8457 20.4648 16.7363 20.2227 16.6309C19.9844 16.5215 19.6797 16.4102 19.3086 16.2969C18.9023 16.1719 18.5273 16.0332 18.1836 15.8809C17.8438 15.7246 17.5469 15.5449 17.293 15.3418C17.0391 15.1348 16.8418 14.8984 16.7012 14.6328C16.5605 14.3633 16.4902 14.0527 16.4902 13.7012C16.4902 13.3535 16.5625 13.0371 16.707 12.752C16.8555 12.4668 17.0645 12.2207 17.334 12.0137C17.6074 11.8027 17.9297 11.6406 18.3008 11.5273C18.6719 11.4102 19.082 11.3516 19.5312 11.3516C20.1641 11.3516 20.709 11.4688 21.166 11.7031C21.627 11.9375 21.9805 12.252 22.2266 12.6465C22.4766 13.041 22.6016 13.4766 22.6016 13.9531H21.1426C21.1426 13.6719 21.082 13.4238 20.9609 13.209C20.8438 12.9902 20.6641 12.8184 20.4219 12.6934C20.1836 12.5684 19.8809 12.5059 19.5137 12.5059C19.166 12.5059 18.877 12.5586 18.6465 12.6641C18.416 12.7695 18.2441 12.9121 18.1309 13.0918C18.0176 13.2715 17.9609 13.4746 17.9609 13.7012C17.9609 13.8613 17.998 14.0078 18.0723 14.1406C18.1465 14.2695 18.2598 14.3906 18.4121 14.5039C18.5645 14.6133 18.7559 14.7168 18.9863 14.8145C19.2168 14.9121 19.4883 15.0059 19.8008 15.0957C20.2734 15.2363 20.6855 15.3926 21.0371 15.5645C21.3887 15.7324 21.6816 15.9238 21.916 16.1387C22.1504 16.3535 22.3262 16.5977 22.4434 16.8711C22.5605 17.1406 22.6191 17.4473 22.6191 17.791C22.6191 18.1504 22.5469 18.4746 22.4023 18.7637C22.2578 19.0488 22.0508 19.293 21.7812 19.4961C21.5156 19.6953 21.1953 19.8496 20.8203 19.959C20.4492 20.0645 20.0352 20.1172 19.5781 20.1172C19.168 20.1172 18.7637 20.0625 18.3652 19.9531C17.9707 19.8438 17.6113 19.6777 17.2871 19.4551C16.9629 19.2285 16.7051 18.9473 16.5137 18.6113C16.3223 18.2715 16.2266 17.875 16.2266 17.4219H17.6973C17.6973 17.6992 17.7441 17.9355 17.8379 18.1309C17.9355 18.3262 18.0703 18.4863 18.2422 18.6113C18.4141 18.7324 18.6133 18.8223 18.8398 18.8809C19.0703 18.9395 19.3164 18.9688 19.5781 18.9688C19.9219 18.9688 20.209 18.9199 20.4395 18.8223C20.6738 18.7246 20.8496 18.5879 20.9668 18.4121C21.084 18.2363 21.1426 18.0332 21.1426 17.8027Z",
|
|
1086
|
+
fill: color
|
|
1087
|
+
}
|
|
1088
|
+
),
|
|
1089
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1090
|
+
"path",
|
|
1091
|
+
{
|
|
1092
|
+
d: "M15.4512 18.834V20H10.9219V18.834H15.4512ZM11.3379 11.4688V20H9.86719V11.4688H11.3379ZM14.8594 15.0312V16.1797H10.9219V15.0312H14.8594ZM15.4219 11.4688V12.6406H10.9219V11.4688H15.4219Z",
|
|
1093
|
+
fill: color
|
|
1094
|
+
}
|
|
1095
|
+
)
|
|
1096
|
+
]
|
|
1097
|
+
}
|
|
1098
|
+
);
|
|
1099
|
+
|
|
1100
|
+
// src/components/IconRender/IconRender.tsx
|
|
1101
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1102
|
+
var IconRender = ({
|
|
1103
|
+
iconName,
|
|
1104
|
+
color = "#000000",
|
|
1105
|
+
size = 24,
|
|
1106
|
+
weight = "regular"
|
|
1107
|
+
}) => {
|
|
1108
|
+
if (typeof iconName === "string") {
|
|
1109
|
+
switch (iconName) {
|
|
1110
|
+
case "Chat_PT":
|
|
1111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChatPT, { size, color });
|
|
1112
|
+
case "Chat_EN":
|
|
1113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChatEN, { size, color });
|
|
1114
|
+
case "Chat_ES":
|
|
1115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChatES, { size, color });
|
|
1116
|
+
default: {
|
|
1117
|
+
const IconComponent = PhosphorIcons[iconName] || PhosphorIcons.Question;
|
|
1118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconComponent, { size, color, weight });
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
} else {
|
|
1122
|
+
return (0, import_react4.cloneElement)(iconName, {
|
|
1123
|
+
size,
|
|
1124
|
+
color: "currentColor"
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
};
|
|
1128
|
+
var IconRender_default = IconRender;
|
|
1129
|
+
|
|
1130
|
+
// src/components/Alternative/Alternative.tsx
|
|
1131
|
+
var import_phosphor_react3 = require("phosphor-react");
|
|
1132
|
+
var import_react5 = require("react");
|
|
1133
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
992
1134
|
var AlternativesList = ({
|
|
993
1135
|
alternatives,
|
|
994
1136
|
name,
|
|
@@ -1001,11 +1143,11 @@ var AlternativesList = ({
|
|
|
1001
1143
|
mode = "interactive",
|
|
1002
1144
|
selectedValue
|
|
1003
1145
|
}) => {
|
|
1004
|
-
const uniqueId = (0,
|
|
1146
|
+
const uniqueId = (0, import_react5.useId)();
|
|
1005
1147
|
const groupName = name || `alternatives-${uniqueId}`;
|
|
1006
|
-
const [actualValue, setActualValue] = (0,
|
|
1148
|
+
const [actualValue, setActualValue] = (0, import_react5.useState)(value);
|
|
1007
1149
|
const isReadonly = mode === "readonly";
|
|
1008
|
-
const
|
|
1150
|
+
const getStatusStyles2 = (status, isReadonly2) => {
|
|
1009
1151
|
const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
|
|
1010
1152
|
switch (status) {
|
|
1011
1153
|
case "correct":
|
|
@@ -1016,12 +1158,12 @@ var AlternativesList = ({
|
|
|
1016
1158
|
return `bg-background border-border-100 ${hoverClass}`;
|
|
1017
1159
|
}
|
|
1018
1160
|
};
|
|
1019
|
-
const
|
|
1161
|
+
const getStatusBadge2 = (status) => {
|
|
1020
1162
|
switch (status) {
|
|
1021
1163
|
case "correct":
|
|
1022
|
-
return /* @__PURE__ */ (0,
|
|
1164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react3.CheckCircle, {}), children: "Resposta correta" });
|
|
1023
1165
|
case "incorrect":
|
|
1024
|
-
return /* @__PURE__ */ (0,
|
|
1166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_phosphor_react3.XCircle, {}), children: "Resposta incorreta" });
|
|
1025
1167
|
default:
|
|
1026
1168
|
return null;
|
|
1027
1169
|
}
|
|
@@ -1046,15 +1188,15 @@ var AlternativesList = ({
|
|
|
1046
1188
|
} else if (isCorrectAnswer) {
|
|
1047
1189
|
displayStatus = "correct";
|
|
1048
1190
|
}
|
|
1049
|
-
const statusStyles =
|
|
1050
|
-
const statusBadge =
|
|
1191
|
+
const statusStyles = getStatusStyles2(displayStatus, true);
|
|
1192
|
+
const statusBadge = getStatusBadge2(displayStatus);
|
|
1051
1193
|
const renderRadio = () => {
|
|
1052
1194
|
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"}`;
|
|
1053
1195
|
const dotClasses = "w-3 h-3 rounded-full bg-primary-950 transition-all duration-200";
|
|
1054
|
-
return /* @__PURE__ */ (0,
|
|
1196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: radioClasses, children: isUserSelected && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: dotClasses }) });
|
|
1055
1197
|
};
|
|
1056
1198
|
if (layout === "detailed") {
|
|
1057
|
-
return /* @__PURE__ */ (0,
|
|
1199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1058
1200
|
"div",
|
|
1059
1201
|
{
|
|
1060
1202
|
className: cn(
|
|
@@ -1062,11 +1204,11 @@ var AlternativesList = ({
|
|
|
1062
1204
|
statusStyles,
|
|
1063
1205
|
alternative.disabled ? "opacity-50" : ""
|
|
1064
1206
|
),
|
|
1065
|
-
children: /* @__PURE__ */ (0,
|
|
1066
|
-
/* @__PURE__ */ (0,
|
|
1067
|
-
/* @__PURE__ */ (0,
|
|
1068
|
-
/* @__PURE__ */ (0,
|
|
1069
|
-
/* @__PURE__ */ (0,
|
|
1207
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
1208
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
1209
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "mt-1", children: renderRadio() }),
|
|
1210
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex-1", children: [
|
|
1211
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1070
1212
|
"p",
|
|
1071
1213
|
{
|
|
1072
1214
|
className: cn(
|
|
@@ -1076,16 +1218,16 @@ var AlternativesList = ({
|
|
|
1076
1218
|
children: alternative.label
|
|
1077
1219
|
}
|
|
1078
1220
|
),
|
|
1079
|
-
alternative.description && /* @__PURE__ */ (0,
|
|
1221
|
+
alternative.description && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
|
|
1080
1222
|
] })
|
|
1081
1223
|
] }),
|
|
1082
|
-
statusBadge && /* @__PURE__ */ (0,
|
|
1224
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
1083
1225
|
] })
|
|
1084
1226
|
},
|
|
1085
1227
|
alternativeId
|
|
1086
1228
|
);
|
|
1087
1229
|
}
|
|
1088
|
-
return /* @__PURE__ */ (0,
|
|
1230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1089
1231
|
"div",
|
|
1090
1232
|
{
|
|
1091
1233
|
className: cn(
|
|
@@ -1094,9 +1236,9 @@ var AlternativesList = ({
|
|
|
1094
1236
|
alternative.disabled ? "opacity-50" : ""
|
|
1095
1237
|
),
|
|
1096
1238
|
children: [
|
|
1097
|
-
/* @__PURE__ */ (0,
|
|
1239
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
1098
1240
|
renderRadio(),
|
|
1099
|
-
/* @__PURE__ */ (0,
|
|
1241
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1100
1242
|
"span",
|
|
1101
1243
|
{
|
|
1102
1244
|
className: cn(
|
|
@@ -1107,14 +1249,14 @@ var AlternativesList = ({
|
|
|
1107
1249
|
}
|
|
1108
1250
|
)
|
|
1109
1251
|
] }),
|
|
1110
|
-
statusBadge && /* @__PURE__ */ (0,
|
|
1252
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
1111
1253
|
]
|
|
1112
1254
|
},
|
|
1113
1255
|
alternativeId
|
|
1114
1256
|
);
|
|
1115
1257
|
};
|
|
1116
1258
|
if (isReadonly) {
|
|
1117
|
-
return /* @__PURE__ */ (0,
|
|
1259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1118
1260
|
"div",
|
|
1119
1261
|
{
|
|
1120
1262
|
className: cn("flex flex-col", getLayoutClasses(), "w-full", className),
|
|
@@ -1124,7 +1266,7 @@ var AlternativesList = ({
|
|
|
1124
1266
|
}
|
|
1125
1267
|
);
|
|
1126
1268
|
}
|
|
1127
|
-
return /* @__PURE__ */ (0,
|
|
1269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1128
1270
|
RadioGroup,
|
|
1129
1271
|
{
|
|
1130
1272
|
name: groupName,
|
|
@@ -1138,10 +1280,10 @@ var AlternativesList = ({
|
|
|
1138
1280
|
className: cn("flex flex-col", getLayoutClasses(), className),
|
|
1139
1281
|
children: alternatives.map((alternative, index) => {
|
|
1140
1282
|
const alternativeId = alternative.value || `alt-${index}`;
|
|
1141
|
-
const statusStyles =
|
|
1142
|
-
const statusBadge =
|
|
1283
|
+
const statusStyles = getStatusStyles2(alternative.status, false);
|
|
1284
|
+
const statusBadge = getStatusBadge2(alternative.status);
|
|
1143
1285
|
if (layout === "detailed") {
|
|
1144
|
-
return /* @__PURE__ */ (0,
|
|
1286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1145
1287
|
"div",
|
|
1146
1288
|
{
|
|
1147
1289
|
className: cn(
|
|
@@ -1149,9 +1291,9 @@ var AlternativesList = ({
|
|
|
1149
1291
|
statusStyles,
|
|
1150
1292
|
alternative.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
1151
1293
|
),
|
|
1152
|
-
children: /* @__PURE__ */ (0,
|
|
1153
|
-
/* @__PURE__ */ (0,
|
|
1154
|
-
/* @__PURE__ */ (0,
|
|
1294
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
1295
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
1296
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1155
1297
|
RadioGroupItem,
|
|
1156
1298
|
{
|
|
1157
1299
|
value: alternative.value,
|
|
@@ -1160,8 +1302,8 @@ var AlternativesList = ({
|
|
|
1160
1302
|
className: "mt-1"
|
|
1161
1303
|
}
|
|
1162
1304
|
),
|
|
1163
|
-
/* @__PURE__ */ (0,
|
|
1164
|
-
/* @__PURE__ */ (0,
|
|
1305
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex-1", children: [
|
|
1306
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1165
1307
|
"label",
|
|
1166
1308
|
{
|
|
1167
1309
|
htmlFor: alternativeId,
|
|
@@ -1173,16 +1315,16 @@ var AlternativesList = ({
|
|
|
1173
1315
|
children: alternative.label
|
|
1174
1316
|
}
|
|
1175
1317
|
),
|
|
1176
|
-
alternative.description && /* @__PURE__ */ (0,
|
|
1318
|
+
alternative.description && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
|
|
1177
1319
|
] })
|
|
1178
1320
|
] }),
|
|
1179
|
-
statusBadge && /* @__PURE__ */ (0,
|
|
1321
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
1180
1322
|
] })
|
|
1181
1323
|
},
|
|
1182
1324
|
alternativeId
|
|
1183
1325
|
);
|
|
1184
1326
|
}
|
|
1185
|
-
return /* @__PURE__ */ (0,
|
|
1327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1186
1328
|
"div",
|
|
1187
1329
|
{
|
|
1188
1330
|
className: cn(
|
|
@@ -1191,8 +1333,8 @@ var AlternativesList = ({
|
|
|
1191
1333
|
alternative.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
1192
1334
|
),
|
|
1193
1335
|
children: [
|
|
1194
|
-
/* @__PURE__ */ (0,
|
|
1195
|
-
/* @__PURE__ */ (0,
|
|
1336
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
1337
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1196
1338
|
RadioGroupItem,
|
|
1197
1339
|
{
|
|
1198
1340
|
value: alternative.value,
|
|
@@ -1200,7 +1342,7 @@ var AlternativesList = ({
|
|
|
1200
1342
|
disabled: alternative.disabled
|
|
1201
1343
|
}
|
|
1202
1344
|
),
|
|
1203
|
-
/* @__PURE__ */ (0,
|
|
1345
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1204
1346
|
"label",
|
|
1205
1347
|
{
|
|
1206
1348
|
htmlFor: alternativeId,
|
|
@@ -1213,7 +1355,7 @@ var AlternativesList = ({
|
|
|
1213
1355
|
}
|
|
1214
1356
|
)
|
|
1215
1357
|
] }),
|
|
1216
|
-
statusBadge && /* @__PURE__ */ (0,
|
|
1358
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
1217
1359
|
]
|
|
1218
1360
|
},
|
|
1219
1361
|
alternativeId
|
|
@@ -1222,9 +1364,9 @@ var AlternativesList = ({
|
|
|
1222
1364
|
}
|
|
1223
1365
|
);
|
|
1224
1366
|
};
|
|
1225
|
-
var HeaderAlternative = (0,
|
|
1367
|
+
var HeaderAlternative = (0, import_react5.forwardRef)(
|
|
1226
1368
|
({ className, title, subTitle, content, ...props }, ref) => {
|
|
1227
|
-
return /* @__PURE__ */ (0,
|
|
1369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1228
1370
|
"div",
|
|
1229
1371
|
{
|
|
1230
1372
|
ref,
|
|
@@ -1234,174 +1376,67 @@ var HeaderAlternative = (0, import_react4.forwardRef)(
|
|
|
1234
1376
|
),
|
|
1235
1377
|
...props,
|
|
1236
1378
|
children: [
|
|
1237
|
-
/* @__PURE__ */ (0,
|
|
1238
|
-
/* @__PURE__ */ (0,
|
|
1239
|
-
/* @__PURE__ */ (0,
|
|
1379
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "flex flex-col", children: [
|
|
1380
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-text-950 font-bold text-lg", children: title }),
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-text-700 text-sm ", children: subTitle })
|
|
1240
1382
|
] }),
|
|
1241
|
-
/* @__PURE__ */ (0,
|
|
1383
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-text-950 text-md", children: content })
|
|
1242
1384
|
]
|
|
1243
1385
|
}
|
|
1244
1386
|
);
|
|
1245
1387
|
}
|
|
1246
1388
|
);
|
|
1247
1389
|
|
|
1248
|
-
// src/
|
|
1249
|
-
var
|
|
1250
|
-
var
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1254
|
-
var ChatPT = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1255
|
-
"svg",
|
|
1256
|
-
{
|
|
1257
|
-
width: size,
|
|
1258
|
-
height: size,
|
|
1259
|
-
viewBox: "0 0 32 32",
|
|
1260
|
-
fill: "none",
|
|
1261
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1262
|
-
children: [
|
|
1263
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1264
|
-
"path",
|
|
1265
|
-
{
|
|
1266
|
-
d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
|
|
1267
|
-
fill: color
|
|
1268
|
-
}
|
|
1269
|
-
),
|
|
1270
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1271
|
-
"path",
|
|
1272
|
-
{
|
|
1273
|
-
d: "M21.1758 12V20.5312H19.7168V12H21.1758ZM23.8535 12V13.1719H17.0625V12H23.8535Z",
|
|
1274
|
-
fill: color
|
|
1275
|
-
}
|
|
1276
|
-
),
|
|
1277
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1278
|
-
"path",
|
|
1279
|
-
{
|
|
1280
|
-
d: "M13.2402 17.3496H11.0195V16.1836H13.2402C13.627 16.1836 13.9395 16.1211 14.1777 15.9961C14.416 15.8711 14.5898 15.6992 14.6992 15.4805C14.8125 15.2578 14.8691 15.0039 14.8691 14.7188C14.8691 14.4492 14.8125 14.1973 14.6992 13.9629C14.5898 13.7246 14.416 13.5332 14.1777 13.3887C13.9395 13.2441 13.627 13.1719 13.2402 13.1719H11.4707V20.5312H10V12H13.2402C13.9004 12 14.4609 12.1172 14.9219 12.3516C15.3867 12.582 15.7402 12.9023 15.9824 13.3125C16.2246 13.7188 16.3457 14.1836 16.3457 14.707C16.3457 15.2578 16.2246 15.7305 15.9824 16.125C15.7402 16.5195 15.3867 16.8223 14.9219 17.0332C14.4609 17.2441 13.9004 17.3496 13.2402 17.3496Z",
|
|
1281
|
-
fill: color
|
|
1282
|
-
}
|
|
1283
|
-
)
|
|
1284
|
-
]
|
|
1285
|
-
}
|
|
1286
|
-
);
|
|
1287
|
-
|
|
1288
|
-
// src/assets/icons/subjects/ChatEN.tsx
|
|
1289
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1290
|
-
var ChatEN = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1291
|
-
"svg",
|
|
1292
|
-
{
|
|
1293
|
-
width: size,
|
|
1294
|
-
height: size,
|
|
1295
|
-
viewBox: "0 0 32 32",
|
|
1296
|
-
fill: "none",
|
|
1297
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1298
|
-
children: [
|
|
1299
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1300
|
-
"path",
|
|
1301
|
-
{
|
|
1302
|
-
d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
|
|
1303
|
-
fill: color
|
|
1304
|
-
}
|
|
1305
|
-
),
|
|
1306
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1307
|
-
"path",
|
|
1308
|
-
{
|
|
1309
|
-
d: "M22.5488 12V20.5312H21.0781L17.252 14.4199V20.5312H15.7812V12H17.252L21.0898 18.123V12H22.5488Z",
|
|
1310
|
-
fill: color
|
|
1311
|
-
}
|
|
1312
|
-
),
|
|
1313
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1314
|
-
"path",
|
|
1315
|
-
{
|
|
1316
|
-
d: "M14.584 19.3652V20.5312H10.0547V19.3652H14.584ZM10.4707 12V20.5312H9V12H10.4707ZM13.9922 15.5625V16.7109H10.0547V15.5625H13.9922ZM14.5547 12V13.1719H10.0547V12H14.5547Z",
|
|
1317
|
-
fill: color
|
|
1318
|
-
}
|
|
1319
|
-
)
|
|
1320
|
-
]
|
|
1321
|
-
}
|
|
1322
|
-
);
|
|
1323
|
-
|
|
1324
|
-
// src/assets/icons/subjects/ChatES.tsx
|
|
1325
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1326
|
-
var ChatES = ({ size, color }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1327
|
-
"svg",
|
|
1328
|
-
{
|
|
1329
|
-
width: size,
|
|
1330
|
-
height: size,
|
|
1331
|
-
viewBox: "0 0 32 32",
|
|
1332
|
-
fill: "none",
|
|
1333
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1334
|
-
children: [
|
|
1335
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1336
|
-
"path",
|
|
1337
|
-
{
|
|
1338
|
-
d: "M27 6H5.00004C4.4696 6 3.9609 6.21071 3.58582 6.58579C3.21075 6.96086 3.00004 7.46957 3.00004 8V28C2.99773 28.3814 3.10562 28.7553 3.31074 29.0768C3.51585 29.3984 3.80947 29.6538 4.15629 29.8125C4.42057 29.9356 4.7085 29.9995 5.00004 30C5.46954 29.9989 5.92347 29.8315 6.28129 29.5275L6.29254 29.5187L10.375 26H27C27.5305 26 28.0392 25.7893 28.4142 25.4142C28.7893 25.0391 29 24.5304 29 24V8C29 7.46957 28.7893 6.96086 28.4142 6.58579C28.0392 6.21071 27.5305 6 27 6ZM27 24H10C9.75992 24.0001 9.52787 24.0866 9.34629 24.2437L5.00004 28V8H27V24Z",
|
|
1339
|
-
fill: color
|
|
1340
|
-
}
|
|
1341
|
-
),
|
|
1342
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1343
|
-
"path",
|
|
1344
|
-
{
|
|
1345
|
-
d: "M21.1426 17.8027C21.1426 17.627 21.1152 17.4707 21.0605 17.334C21.0098 17.1973 20.918 17.0723 20.7852 16.959C20.6523 16.8457 20.4648 16.7363 20.2227 16.6309C19.9844 16.5215 19.6797 16.4102 19.3086 16.2969C18.9023 16.1719 18.5273 16.0332 18.1836 15.8809C17.8438 15.7246 17.5469 15.5449 17.293 15.3418C17.0391 15.1348 16.8418 14.8984 16.7012 14.6328C16.5605 14.3633 16.4902 14.0527 16.4902 13.7012C16.4902 13.3535 16.5625 13.0371 16.707 12.752C16.8555 12.4668 17.0645 12.2207 17.334 12.0137C17.6074 11.8027 17.9297 11.6406 18.3008 11.5273C18.6719 11.4102 19.082 11.3516 19.5312 11.3516C20.1641 11.3516 20.709 11.4688 21.166 11.7031C21.627 11.9375 21.9805 12.252 22.2266 12.6465C22.4766 13.041 22.6016 13.4766 22.6016 13.9531H21.1426C21.1426 13.6719 21.082 13.4238 20.9609 13.209C20.8438 12.9902 20.6641 12.8184 20.4219 12.6934C20.1836 12.5684 19.8809 12.5059 19.5137 12.5059C19.166 12.5059 18.877 12.5586 18.6465 12.6641C18.416 12.7695 18.2441 12.9121 18.1309 13.0918C18.0176 13.2715 17.9609 13.4746 17.9609 13.7012C17.9609 13.8613 17.998 14.0078 18.0723 14.1406C18.1465 14.2695 18.2598 14.3906 18.4121 14.5039C18.5645 14.6133 18.7559 14.7168 18.9863 14.8145C19.2168 14.9121 19.4883 15.0059 19.8008 15.0957C20.2734 15.2363 20.6855 15.3926 21.0371 15.5645C21.3887 15.7324 21.6816 15.9238 21.916 16.1387C22.1504 16.3535 22.3262 16.5977 22.4434 16.8711C22.5605 17.1406 22.6191 17.4473 22.6191 17.791C22.6191 18.1504 22.5469 18.4746 22.4023 18.7637C22.2578 19.0488 22.0508 19.293 21.7812 19.4961C21.5156 19.6953 21.1953 19.8496 20.8203 19.959C20.4492 20.0645 20.0352 20.1172 19.5781 20.1172C19.168 20.1172 18.7637 20.0625 18.3652 19.9531C17.9707 19.8438 17.6113 19.6777 17.2871 19.4551C16.9629 19.2285 16.7051 18.9473 16.5137 18.6113C16.3223 18.2715 16.2266 17.875 16.2266 17.4219H17.6973C17.6973 17.6992 17.7441 17.9355 17.8379 18.1309C17.9355 18.3262 18.0703 18.4863 18.2422 18.6113C18.4141 18.7324 18.6133 18.8223 18.8398 18.8809C19.0703 18.9395 19.3164 18.9688 19.5781 18.9688C19.9219 18.9688 20.209 18.9199 20.4395 18.8223C20.6738 18.7246 20.8496 18.5879 20.9668 18.4121C21.084 18.2363 21.1426 18.0332 21.1426 17.8027Z",
|
|
1346
|
-
fill: color
|
|
1347
|
-
}
|
|
1348
|
-
),
|
|
1349
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1350
|
-
"path",
|
|
1351
|
-
{
|
|
1352
|
-
d: "M15.4512 18.834V20H10.9219V18.834H15.4512ZM11.3379 11.4688V20H9.86719V11.4688H11.3379ZM14.8594 15.0312V16.1797H10.9219V15.0312H14.8594ZM15.4219 11.4688V12.6406H10.9219V11.4688H15.4219Z",
|
|
1353
|
-
fill: color
|
|
1354
|
-
}
|
|
1355
|
-
)
|
|
1356
|
-
]
|
|
1357
|
-
}
|
|
1358
|
-
);
|
|
1359
|
-
|
|
1360
|
-
// src/components/IconRender/IconRender.tsx
|
|
1361
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1362
|
-
var IconRender = ({
|
|
1363
|
-
iconName,
|
|
1364
|
-
color = "#000000",
|
|
1365
|
-
size = 24,
|
|
1366
|
-
weight = "regular"
|
|
1390
|
+
// src/utils/questionRenderer/alternative/index.tsx
|
|
1391
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1392
|
+
var renderQuestionAlternative = ({
|
|
1393
|
+
question,
|
|
1394
|
+
result
|
|
1367
1395
|
}) => {
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1396
|
+
const alternatives = question.options?.map((option) => {
|
|
1397
|
+
const isCorrectOption = result?.options?.find((op) => op.id === option.id)?.isCorrect || false;
|
|
1398
|
+
const isSelected = result?.selectedOptions?.some(
|
|
1399
|
+
(selectedOption) => selectedOption.optionId === option.id
|
|
1400
|
+
) || false;
|
|
1401
|
+
const shouldShowCorrectAnswers = result?.answerStatus !== "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */;
|
|
1402
|
+
let status;
|
|
1403
|
+
if (shouldShowCorrectAnswers) {
|
|
1404
|
+
if (isCorrectOption) {
|
|
1405
|
+
status = "correct" /* CORRECT */;
|
|
1406
|
+
} else if (isSelected && !isCorrectOption) {
|
|
1407
|
+
status = "incorrect" /* INCORRECT */;
|
|
1408
|
+
} else {
|
|
1409
|
+
status = "neutral" /* NEUTRAL */;
|
|
1379
1410
|
}
|
|
1411
|
+
} else {
|
|
1412
|
+
status = "neutral" /* NEUTRAL */;
|
|
1380
1413
|
}
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
}
|
|
1414
|
+
return {
|
|
1415
|
+
label: option.option,
|
|
1416
|
+
value: option.id,
|
|
1417
|
+
status
|
|
1418
|
+
};
|
|
1419
|
+
});
|
|
1420
|
+
if (!alternatives || alternatives.length === 0) {
|
|
1421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text_default, { size: "sm", weight: "normal", children: "N\xE3o h\xE1 Alternativas" }) });
|
|
1386
1422
|
}
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
["PREENCHER" /* PREENCHER */]: "Preencher Lacunas"
|
|
1423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1424
|
+
AlternativesList,
|
|
1425
|
+
{
|
|
1426
|
+
mode: "readonly",
|
|
1427
|
+
name: `question-${question.id}`,
|
|
1428
|
+
layout: "compact",
|
|
1429
|
+
alternatives,
|
|
1430
|
+
selectedValue: result?.selectedOptions?.[0]?.optionId || ""
|
|
1431
|
+
},
|
|
1432
|
+
`question-${question.id}`
|
|
1433
|
+
) });
|
|
1399
1434
|
};
|
|
1400
1435
|
|
|
1401
1436
|
// src/components/MultipleChoice/MultipleChoice.tsx
|
|
1402
1437
|
var import_react6 = require("react");
|
|
1403
1438
|
var import_phosphor_react4 = require("phosphor-react");
|
|
1404
|
-
var
|
|
1439
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1405
1440
|
var MultipleChoiceList = ({
|
|
1406
1441
|
disabled = false,
|
|
1407
1442
|
className = "",
|
|
@@ -1415,17 +1450,17 @@ var MultipleChoiceList = ({
|
|
|
1415
1450
|
(0, import_react6.useEffect)(() => {
|
|
1416
1451
|
setActualValue(selectedValues);
|
|
1417
1452
|
}, [selectedValues]);
|
|
1418
|
-
const
|
|
1453
|
+
const getStatusBadge2 = (status) => {
|
|
1419
1454
|
switch (status) {
|
|
1420
1455
|
case "correct":
|
|
1421
|
-
return /* @__PURE__ */ (0,
|
|
1456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_phosphor_react4.CheckCircle, {}), children: "Resposta correta" });
|
|
1422
1457
|
case "incorrect":
|
|
1423
|
-
return /* @__PURE__ */ (0,
|
|
1458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_phosphor_react4.XCircle, {}), children: "Resposta incorreta" });
|
|
1424
1459
|
default:
|
|
1425
1460
|
return null;
|
|
1426
1461
|
}
|
|
1427
1462
|
};
|
|
1428
|
-
const
|
|
1463
|
+
const getStatusStyles2 = (status) => {
|
|
1429
1464
|
switch (status) {
|
|
1430
1465
|
case "correct":
|
|
1431
1466
|
return "bg-success-background border-success-300";
|
|
@@ -1441,14 +1476,14 @@ var MultipleChoiceList = ({
|
|
|
1441
1476
|
isSelected ? "border-primary-950 bg-primary-950 text-text" : "border-border-400 bg-background",
|
|
1442
1477
|
isDisabled && "opacity-40 cursor-not-allowed"
|
|
1443
1478
|
);
|
|
1444
|
-
return /* @__PURE__ */ (0,
|
|
1479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: checkboxClasses, children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_phosphor_react4.Check, { size: 16, weight: "bold" }) });
|
|
1445
1480
|
};
|
|
1446
1481
|
if (mode === "readonly") {
|
|
1447
|
-
return /* @__PURE__ */ (0,
|
|
1482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: cn("flex flex-col gap-2", className), children: choices.map((choice, i) => {
|
|
1448
1483
|
const isSelected = actualValue?.includes(choice.value) || false;
|
|
1449
|
-
const statusStyles =
|
|
1450
|
-
const statusBadge =
|
|
1451
|
-
return /* @__PURE__ */ (0,
|
|
1484
|
+
const statusStyles = getStatusStyles2(choice.status);
|
|
1485
|
+
const statusBadge = getStatusBadge2(choice.status);
|
|
1486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1452
1487
|
"div",
|
|
1453
1488
|
{
|
|
1454
1489
|
className: cn(
|
|
@@ -1457,9 +1492,9 @@ var MultipleChoiceList = ({
|
|
|
1457
1492
|
choice.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
1458
1493
|
),
|
|
1459
1494
|
children: [
|
|
1460
|
-
/* @__PURE__ */ (0,
|
|
1495
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
1461
1496
|
renderVisualCheckbox(isSelected, choice.disabled || disabled),
|
|
1462
|
-
/* @__PURE__ */ (0,
|
|
1497
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1463
1498
|
"span",
|
|
1464
1499
|
{
|
|
1465
1500
|
className: cn(
|
|
@@ -1471,14 +1506,14 @@ var MultipleChoiceList = ({
|
|
|
1471
1506
|
}
|
|
1472
1507
|
)
|
|
1473
1508
|
] }),
|
|
1474
|
-
statusBadge && /* @__PURE__ */ (0,
|
|
1509
|
+
statusBadge && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex-shrink-0", children: statusBadge })
|
|
1475
1510
|
]
|
|
1476
1511
|
},
|
|
1477
1512
|
`readonly-${choice.value}-${i}`
|
|
1478
1513
|
);
|
|
1479
1514
|
}) });
|
|
1480
1515
|
}
|
|
1481
|
-
return /* @__PURE__ */ (0,
|
|
1516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1482
1517
|
"div",
|
|
1483
1518
|
{
|
|
1484
1519
|
className: cn(
|
|
@@ -1486,7 +1521,7 @@ var MultipleChoiceList = ({
|
|
|
1486
1521
|
disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
1487
1522
|
className
|
|
1488
1523
|
),
|
|
1489
|
-
children: /* @__PURE__ */ (0,
|
|
1524
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1490
1525
|
CheckboxList_default,
|
|
1491
1526
|
{
|
|
1492
1527
|
name,
|
|
@@ -1496,12 +1531,12 @@ var MultipleChoiceList = ({
|
|
|
1496
1531
|
onHandleSelectedValues?.(v);
|
|
1497
1532
|
},
|
|
1498
1533
|
disabled,
|
|
1499
|
-
children: choices.map((choice, i) => /* @__PURE__ */ (0,
|
|
1534
|
+
children: choices.map((choice, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1500
1535
|
"div",
|
|
1501
1536
|
{
|
|
1502
1537
|
className: "flex flex-row gap-2 items-center",
|
|
1503
1538
|
children: [
|
|
1504
|
-
/* @__PURE__ */ (0,
|
|
1539
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1505
1540
|
CheckboxListItem,
|
|
1506
1541
|
{
|
|
1507
1542
|
value: choice.value,
|
|
@@ -1509,7 +1544,7 @@ var MultipleChoiceList = ({
|
|
|
1509
1544
|
disabled: choice.disabled || disabled
|
|
1510
1545
|
}
|
|
1511
1546
|
),
|
|
1512
|
-
/* @__PURE__ */ (0,
|
|
1547
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1513
1548
|
"label",
|
|
1514
1549
|
{
|
|
1515
1550
|
htmlFor: `interactive-${choice.value}-${i}`,
|
|
@@ -1531,17 +1566,565 @@ var MultipleChoiceList = ({
|
|
|
1531
1566
|
);
|
|
1532
1567
|
};
|
|
1533
1568
|
|
|
1534
|
-
// src/utils/questionRenderer.
|
|
1569
|
+
// src/utils/questionRenderer/multipleChoice/index.tsx
|
|
1570
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1571
|
+
var renderQuestionMultipleChoice = ({
|
|
1572
|
+
question,
|
|
1573
|
+
result
|
|
1574
|
+
}) => {
|
|
1575
|
+
const choices = question.options?.map((option) => {
|
|
1576
|
+
const isCorrectOption = result?.options?.find((op) => op.id === option.id)?.isCorrect || false;
|
|
1577
|
+
const isSelected = result?.selectedOptions?.some(
|
|
1578
|
+
(op) => op.optionId === option.id
|
|
1579
|
+
);
|
|
1580
|
+
const shouldShowCorrectAnswers = result?.answerStatus !== "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */ && result?.answerStatus !== "NAO_RESPONDIDO" /* NAO_RESPONDIDO */;
|
|
1581
|
+
let status;
|
|
1582
|
+
if (shouldShowCorrectAnswers) {
|
|
1583
|
+
if (isCorrectOption) {
|
|
1584
|
+
status = "correct" /* CORRECT */;
|
|
1585
|
+
} else if (isSelected && !isCorrectOption) {
|
|
1586
|
+
status = "incorrect" /* INCORRECT */;
|
|
1587
|
+
} else {
|
|
1588
|
+
status = "neutral" /* NEUTRAL */;
|
|
1589
|
+
}
|
|
1590
|
+
} else {
|
|
1591
|
+
status = "neutral" /* NEUTRAL */;
|
|
1592
|
+
}
|
|
1593
|
+
return {
|
|
1594
|
+
label: option.option,
|
|
1595
|
+
value: option.id,
|
|
1596
|
+
status
|
|
1597
|
+
};
|
|
1598
|
+
});
|
|
1599
|
+
if (!choices || choices.length === 0) {
|
|
1600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text_default, { size: "sm", weight: "normal", children: "N\xE3o h\xE1 Escolhas M\xFAltiplas" }) });
|
|
1601
|
+
}
|
|
1602
|
+
const selectedValues = result?.selectedOptions?.map((op) => op.optionId) || [];
|
|
1603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1604
|
+
MultipleChoiceList,
|
|
1605
|
+
{
|
|
1606
|
+
mode: "readonly",
|
|
1607
|
+
name: `question-${question.id}`,
|
|
1608
|
+
choices,
|
|
1609
|
+
selectedValues
|
|
1610
|
+
},
|
|
1611
|
+
`question-${question.id}`
|
|
1612
|
+
) });
|
|
1613
|
+
};
|
|
1614
|
+
|
|
1615
|
+
// src/components/Quiz/QuizContent.tsx
|
|
1616
|
+
var import_react7 = require("react");
|
|
1617
|
+
var import_phosphor_react5 = require("phosphor-react");
|
|
1618
|
+
|
|
1619
|
+
// src/assets/img/mock-image-question.png
|
|
1620
|
+
var mock_image_question_default = "../mock-image-question-HEZCLFDL.png";
|
|
1621
|
+
|
|
1622
|
+
// src/components/Quiz/QuizContent.tsx
|
|
1623
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1624
|
+
var getStatusStyles = (variantCorrect) => {
|
|
1625
|
+
switch (variantCorrect) {
|
|
1626
|
+
case "correct":
|
|
1627
|
+
return "bg-success-background border-success-300";
|
|
1628
|
+
case "incorrect":
|
|
1629
|
+
return "bg-error-background border-error-300";
|
|
1630
|
+
default:
|
|
1631
|
+
return "";
|
|
1632
|
+
}
|
|
1633
|
+
};
|
|
1634
|
+
var QuizSubTitle = (0, import_react7.forwardRef)(
|
|
1635
|
+
({ subTitle, ...props }, ref) => {
|
|
1636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "px-4 pb-2 pt-6", ...props, ref, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "font-bold text-lg text-text-950", children: subTitle }) });
|
|
1637
|
+
}
|
|
1638
|
+
);
|
|
1639
|
+
var QuizContainer = (0, import_react7.forwardRef)(({ children, className, ...props }, ref) => {
|
|
1640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1641
|
+
"div",
|
|
1642
|
+
{
|
|
1643
|
+
ref,
|
|
1644
|
+
className: cn(
|
|
1645
|
+
"bg-background rounded-t-xl px-4 pt-4 pb-[80px] h-auto flex flex-col gap-4 mb-auto",
|
|
1646
|
+
className
|
|
1647
|
+
),
|
|
1648
|
+
...props,
|
|
1649
|
+
children
|
|
1650
|
+
}
|
|
1651
|
+
);
|
|
1652
|
+
});
|
|
1653
|
+
|
|
1654
|
+
// src/utils/questionRenderer/components/index.tsx
|
|
1655
|
+
var import_react8 = require("react");
|
|
1656
|
+
var import_phosphor_react6 = require("phosphor-react");
|
|
1657
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1658
|
+
var getStatusBadge = (status) => {
|
|
1659
|
+
switch (status) {
|
|
1660
|
+
case "correct":
|
|
1661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_phosphor_react6.CheckCircle, {}), children: "Resposta correta" });
|
|
1662
|
+
case "incorrect":
|
|
1663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_phosphor_react6.XCircle, {}), children: "Resposta incorreta" });
|
|
1664
|
+
default:
|
|
1665
|
+
return null;
|
|
1666
|
+
}
|
|
1667
|
+
};
|
|
1668
|
+
var QuestionContainer = ({
|
|
1669
|
+
children,
|
|
1670
|
+
className
|
|
1671
|
+
}) => {
|
|
1672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1673
|
+
"div",
|
|
1674
|
+
{
|
|
1675
|
+
className: cn(
|
|
1676
|
+
"bg-background rounded-t-xl px-4 pt-4 pb-[80px] h-auto flex flex-col gap-4 mb-auto",
|
|
1677
|
+
className
|
|
1678
|
+
),
|
|
1679
|
+
children
|
|
1680
|
+
}
|
|
1681
|
+
);
|
|
1682
|
+
};
|
|
1683
|
+
var QuestionSubTitle = ({ subTitle }) => {
|
|
1684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "px-4 pb-2 pt-6", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text_default, { size: "md", weight: "bold", color: "text-text-950", children: subTitle }) });
|
|
1685
|
+
};
|
|
1686
|
+
var FillQuestionContent = ({
|
|
1687
|
+
question,
|
|
1688
|
+
result
|
|
1689
|
+
}) => {
|
|
1690
|
+
const text = question.statement || "";
|
|
1691
|
+
const baseId = (0, import_react8.useId)();
|
|
1692
|
+
const studentAnswers = {};
|
|
1693
|
+
try {
|
|
1694
|
+
if (result?.answer) {
|
|
1695
|
+
const parsed = typeof result.answer === "string" ? JSON.parse(result.answer) : result.answer;
|
|
1696
|
+
if (typeof parsed === "object") {
|
|
1697
|
+
Object.assign(studentAnswers, parsed);
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
} catch (error) {
|
|
1701
|
+
console.error("Error parsing answer:", error);
|
|
1702
|
+
}
|
|
1703
|
+
const regex = /\{\{([\p{L}\p{M}\d_]+)\}\}/gu;
|
|
1704
|
+
const placeholders = [];
|
|
1705
|
+
let match;
|
|
1706
|
+
while ((match = regex.exec(text)) !== null) {
|
|
1707
|
+
placeholders.push(match[1]);
|
|
1708
|
+
}
|
|
1709
|
+
const correctAnswers = {};
|
|
1710
|
+
placeholders.forEach((placeholder) => {
|
|
1711
|
+
correctAnswers[placeholder] = studentAnswers[placeholder]?.correctAnswer || `[${placeholder}]`;
|
|
1712
|
+
});
|
|
1713
|
+
const addTextElement = (elements, textContent, elementCounter) => {
|
|
1714
|
+
if (textContent) {
|
|
1715
|
+
elements.push({
|
|
1716
|
+
element: textContent,
|
|
1717
|
+
id: `${baseId}-text-${++elementCounter.current}`
|
|
1718
|
+
});
|
|
1719
|
+
}
|
|
1720
|
+
};
|
|
1721
|
+
const renderGabaritoPlaceholder = (selectId, elementCounter) => {
|
|
1722
|
+
const correctAnswer = correctAnswers[selectId] || `[${selectId}]`;
|
|
1723
|
+
return {
|
|
1724
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1725
|
+
Text_default,
|
|
1726
|
+
{
|
|
1727
|
+
size: "md",
|
|
1728
|
+
weight: "semibold",
|
|
1729
|
+
color: "text-success-600",
|
|
1730
|
+
className: "inline-flex mb-2.5 border-b-2 border-success-600",
|
|
1731
|
+
children: correctAnswer
|
|
1732
|
+
},
|
|
1733
|
+
`${baseId}-gabarito-${selectId}`
|
|
1734
|
+
),
|
|
1735
|
+
id: `${baseId}-gabarito-${++elementCounter.current}`
|
|
1736
|
+
};
|
|
1737
|
+
};
|
|
1738
|
+
const renderStudentPlaceholder = (selectId, elementCounter) => {
|
|
1739
|
+
const studentAnswer = studentAnswers[selectId];
|
|
1740
|
+
if (!studentAnswer) {
|
|
1741
|
+
return {
|
|
1742
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1743
|
+
Text_default,
|
|
1744
|
+
{
|
|
1745
|
+
size: "md",
|
|
1746
|
+
weight: "normal",
|
|
1747
|
+
color: "text-text-400",
|
|
1748
|
+
className: "inline-flex mb-2.5 border-b-2 border-text-300",
|
|
1749
|
+
children: "[N\xE3o respondido]"
|
|
1750
|
+
},
|
|
1751
|
+
`${baseId}-no-answer-${selectId}`
|
|
1752
|
+
),
|
|
1753
|
+
id: `${baseId}-no-answer-${++elementCounter.current}`
|
|
1754
|
+
};
|
|
1755
|
+
}
|
|
1756
|
+
const isCorrect = studentAnswer.isCorrect;
|
|
1757
|
+
const colorClass = isCorrect ? "text-success-600 border-success-600" : "text-error-600 border-error-600";
|
|
1758
|
+
return {
|
|
1759
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1760
|
+
Badge_default,
|
|
1761
|
+
{
|
|
1762
|
+
variant: "solid",
|
|
1763
|
+
action: isCorrect ? "success" : "error",
|
|
1764
|
+
iconRight: isCorrect ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_phosphor_react6.CheckCircle, {}) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_phosphor_react6.XCircle, {}),
|
|
1765
|
+
size: "large",
|
|
1766
|
+
className: `py-3 w-[180px] justify-between mb-2.5 ${colorClass}`,
|
|
1767
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-text-900", children: studentAnswer.answer })
|
|
1768
|
+
},
|
|
1769
|
+
`${baseId}-answer-${selectId}`
|
|
1770
|
+
),
|
|
1771
|
+
id: `${baseId}-answer-${++elementCounter.current}`
|
|
1772
|
+
};
|
|
1773
|
+
};
|
|
1774
|
+
const renderTextWithAnswers = (isGabarito = false) => {
|
|
1775
|
+
const elements = [];
|
|
1776
|
+
let lastIndex = 0;
|
|
1777
|
+
const elementCounter = { current: 0 };
|
|
1778
|
+
regex.lastIndex = 0;
|
|
1779
|
+
while ((match = regex.exec(text)) !== null) {
|
|
1780
|
+
const [fullMatch, selectId] = match;
|
|
1781
|
+
const startIndex = match.index;
|
|
1782
|
+
if (startIndex > lastIndex) {
|
|
1783
|
+
addTextElement(
|
|
1784
|
+
elements,
|
|
1785
|
+
text.slice(lastIndex, startIndex),
|
|
1786
|
+
elementCounter
|
|
1787
|
+
);
|
|
1788
|
+
}
|
|
1789
|
+
const placeholderElement = isGabarito ? renderGabaritoPlaceholder(selectId, elementCounter) : renderStudentPlaceholder(selectId, elementCounter);
|
|
1790
|
+
elements.push(placeholderElement);
|
|
1791
|
+
lastIndex = match.index + fullMatch.length;
|
|
1792
|
+
}
|
|
1793
|
+
if (lastIndex < text.length) {
|
|
1794
|
+
addTextElement(elements, text.slice(lastIndex), elementCounter);
|
|
1795
|
+
}
|
|
1796
|
+
return elements;
|
|
1797
|
+
};
|
|
1798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "pt-2 space-y-4", children: [
|
|
1799
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "space-y-2", children: [
|
|
1800
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text_default, { size: "xs", weight: "normal", color: "text-text-500", children: "Resposta do aluno:" }),
|
|
1801
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "p-3 bg-background-50 rounded-lg border border-border-100", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "leading-8", children: renderTextWithAnswers(false).map((element) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1802
|
+
Text_default,
|
|
1803
|
+
{
|
|
1804
|
+
size: "md",
|
|
1805
|
+
weight: "normal",
|
|
1806
|
+
color: "text-text-900",
|
|
1807
|
+
children: element.element
|
|
1808
|
+
},
|
|
1809
|
+
element.id
|
|
1810
|
+
)) }) })
|
|
1811
|
+
] }),
|
|
1812
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "space-y-2", children: [
|
|
1813
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text_default, { size: "xs", weight: "normal", color: "text-text-500", children: "Gabarito:" }),
|
|
1814
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "p-3 bg-background-50 rounded-lg border border-border-100", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "leading-8", children: renderTextWithAnswers(true).map((element) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1815
|
+
Text_default,
|
|
1816
|
+
{
|
|
1817
|
+
size: "md",
|
|
1818
|
+
weight: "normal",
|
|
1819
|
+
color: "text-text-900",
|
|
1820
|
+
children: element.element
|
|
1821
|
+
},
|
|
1822
|
+
element.id
|
|
1823
|
+
)) }) })
|
|
1824
|
+
] })
|
|
1825
|
+
] });
|
|
1826
|
+
};
|
|
1827
|
+
|
|
1828
|
+
// src/utils/questionRenderer/trueOrFalse/index.tsx
|
|
1829
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1830
|
+
var renderQuestionTrueOrFalse = ({
|
|
1831
|
+
question,
|
|
1832
|
+
result
|
|
1833
|
+
}) => {
|
|
1834
|
+
const options = question.options || [];
|
|
1835
|
+
const getLetterByIndex = (index) => String.fromCodePoint(97 + index);
|
|
1836
|
+
const shouldShowStatus = result?.answerStatus !== "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */ && result?.answerStatus !== "NAO_RESPONDIDO" /* NAO_RESPONDIDO */;
|
|
1837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
1838
|
+
const statementIsTrue = result?.options?.find((op) => op.id === option.id)?.isCorrect || false;
|
|
1839
|
+
const isSelected = result?.selectedOptions?.some(
|
|
1840
|
+
(op) => op.optionId === option.id
|
|
1841
|
+
);
|
|
1842
|
+
const isStudentCorrect = statementIsTrue === isSelected;
|
|
1843
|
+
const variantCorrect = statementIsTrue ? "correct" : "incorrect";
|
|
1844
|
+
const studentAnswer = isSelected ? "V" : "F";
|
|
1845
|
+
const correctAnswer = statementIsTrue ? "V" : "F";
|
|
1846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1847
|
+
"section",
|
|
1848
|
+
{
|
|
1849
|
+
className: "flex flex-col gap-2",
|
|
1850
|
+
children: [
|
|
1851
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1852
|
+
"div",
|
|
1853
|
+
{
|
|
1854
|
+
className: cn(
|
|
1855
|
+
"flex flex-row justify-between items-center gap-2 p-2 rounded-md border",
|
|
1856
|
+
shouldShowStatus ? getStatusStyles(variantCorrect) : ""
|
|
1857
|
+
),
|
|
1858
|
+
children: [
|
|
1859
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text_default, { size: "sm", weight: "normal", color: "text-text-900", children: getLetterByIndex(index).concat(") ").concat(option.option) }),
|
|
1860
|
+
shouldShowStatus && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex-shrink-0", children: getStatusBadge(isStudentCorrect ? "correct" : "incorrect") })
|
|
1861
|
+
]
|
|
1862
|
+
}
|
|
1863
|
+
),
|
|
1864
|
+
shouldShowStatus && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
1865
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text_default, { size: "2xs", weight: "normal", color: "text-text-800", children: [
|
|
1866
|
+
"Resposta selecionada: ",
|
|
1867
|
+
studentAnswer
|
|
1868
|
+
] }),
|
|
1869
|
+
!isStudentCorrect && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Text_default, { size: "2xs", weight: "normal", color: "text-text-800", children: [
|
|
1870
|
+
"Resposta correta: ",
|
|
1871
|
+
correctAnswer
|
|
1872
|
+
] })
|
|
1873
|
+
] })
|
|
1874
|
+
]
|
|
1875
|
+
},
|
|
1876
|
+
option.id || `option-${index}`
|
|
1877
|
+
);
|
|
1878
|
+
}) }) });
|
|
1879
|
+
};
|
|
1880
|
+
|
|
1881
|
+
// src/utils/questionRenderer/dissertative/index.tsx
|
|
1882
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1883
|
+
var renderQuestionDissertative = ({
|
|
1884
|
+
result
|
|
1885
|
+
}) => {
|
|
1886
|
+
const localAnswer = result?.answer || "";
|
|
1887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "pt-2 space-y-4", children: [
|
|
1888
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "space-y-2", children: [
|
|
1889
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text_default, { size: "sm", weight: "normal", color: "text-text-950", children: "Resposta do aluno" }),
|
|
1890
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "p-3 bg-background-50 rounded-lg border border-border-100", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text_default, { size: "sm", weight: "normal", color: "text-text-700", children: localAnswer || "Nenhuma resposta fornecida" }) })
|
|
1891
|
+
] }),
|
|
1892
|
+
result?.answerStatus === "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && result?.teacherFeedback && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "space-y-2", children: [
|
|
1893
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text_default, { size: "xs", weight: "normal", color: "text-text-500", children: "Observa\xE7\xE3o do professor:" }),
|
|
1894
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "p-3 bg-background-50 rounded-lg border border-border-100", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text_default, { size: "sm", weight: "normal", color: "text-text-700", children: result.teacherFeedback }) })
|
|
1895
|
+
] })
|
|
1896
|
+
] });
|
|
1897
|
+
};
|
|
1898
|
+
|
|
1899
|
+
// src/utils/questionRenderer/fill/index.tsx
|
|
1900
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1901
|
+
var renderQuestionFill = ({
|
|
1902
|
+
question,
|
|
1903
|
+
result
|
|
1904
|
+
}) => {
|
|
1905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FillQuestionContent, { question, result });
|
|
1906
|
+
};
|
|
1907
|
+
|
|
1908
|
+
// src/utils/questionRenderer/image/index.tsx
|
|
1909
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1910
|
+
var renderQuestionImage = ({
|
|
1911
|
+
result
|
|
1912
|
+
}) => {
|
|
1913
|
+
const correctPositionRelative = { x: 0.48, y: 0.45 };
|
|
1914
|
+
const correctRadiusRelative = 0.1;
|
|
1915
|
+
let userPositionRelative = null;
|
|
1916
|
+
try {
|
|
1917
|
+
if (result?.answer) {
|
|
1918
|
+
const parsed = typeof result.answer === "string" ? JSON.parse(result.answer) : result.answer;
|
|
1919
|
+
if (parsed && typeof parsed.x === "number" && typeof parsed.y === "number") {
|
|
1920
|
+
userPositionRelative = { x: parsed.x, y: parsed.y };
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
} catch {
|
|
1924
|
+
userPositionRelative = null;
|
|
1925
|
+
}
|
|
1926
|
+
const isCorrect = userPositionRelative ? Math.sqrt(
|
|
1927
|
+
Math.pow(userPositionRelative.x - correctPositionRelative.x, 2) + Math.pow(userPositionRelative.y - correctPositionRelative.y, 2)
|
|
1928
|
+
) <= correctRadiusRelative : false;
|
|
1929
|
+
const getUserCircleColorClasses = () => {
|
|
1930
|
+
if (!userPositionRelative) return "";
|
|
1931
|
+
return isCorrect ? "bg-success-600/70 border-white" : "bg-indicator-error/70 border-white";
|
|
1932
|
+
};
|
|
1933
|
+
const getPositionDescription = (x, y) => {
|
|
1934
|
+
const xPercent = Math.round(x * 100);
|
|
1935
|
+
const yPercent = Math.round(y * 100);
|
|
1936
|
+
return `${xPercent}% da esquerda, ${yPercent}% do topo`;
|
|
1937
|
+
};
|
|
1938
|
+
const getSpatialRelationship = () => {
|
|
1939
|
+
if (!userPositionRelative) {
|
|
1940
|
+
return `\xC1rea correta localizada em ${getPositionDescription(
|
|
1941
|
+
correctPositionRelative.x,
|
|
1942
|
+
correctPositionRelative.y
|
|
1943
|
+
)}. Nenhuma resposta do aluno fornecida.`;
|
|
1944
|
+
}
|
|
1945
|
+
const deltaX = userPositionRelative.x - correctPositionRelative.x;
|
|
1946
|
+
const deltaY = userPositionRelative.y - correctPositionRelative.y;
|
|
1947
|
+
const distance = Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));
|
|
1948
|
+
const distancePercent = Math.round(distance * 100);
|
|
1949
|
+
let direction = "";
|
|
1950
|
+
if (Math.abs(deltaX) > Math.abs(deltaY)) {
|
|
1951
|
+
direction = deltaX > 0 ? "\xE0 direita" : "\xE0 esquerda";
|
|
1952
|
+
} else {
|
|
1953
|
+
direction = deltaY > 0 ? "abaixo" : "acima";
|
|
1954
|
+
}
|
|
1955
|
+
const correctPos = getPositionDescription(
|
|
1956
|
+
correctPositionRelative.x,
|
|
1957
|
+
correctPositionRelative.y
|
|
1958
|
+
);
|
|
1959
|
+
const userPos = getPositionDescription(
|
|
1960
|
+
userPositionRelative.x,
|
|
1961
|
+
userPositionRelative.y
|
|
1962
|
+
);
|
|
1963
|
+
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."}`;
|
|
1964
|
+
};
|
|
1965
|
+
const correctPositionDescription = getPositionDescription(
|
|
1966
|
+
correctPositionRelative.x,
|
|
1967
|
+
correctPositionRelative.y
|
|
1968
|
+
);
|
|
1969
|
+
const imageAltText = `Quest\xE3o de imagem com \xE1rea correta localizada em ${correctPositionDescription}`;
|
|
1970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "pt-2 space-y-4", children: [
|
|
1971
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-4 text-xs", children: [
|
|
1972
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1973
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w-3 h-3 rounded-full bg-indicator-primary/70 border border-[#F8CC2E]" }),
|
|
1974
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text_default, { size: "sm", weight: "normal", color: "text-text-600", children: "\xC1rea correta" })
|
|
1975
|
+
] }),
|
|
1976
|
+
userPositionRelative && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
1977
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1978
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w-3 h-3 rounded-full bg-success-600/70 border border-white" }),
|
|
1979
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text_default, { size: "sm", weight: "normal", color: "text-text-600", children: "Resposta correta" })
|
|
1980
|
+
] }),
|
|
1981
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1982
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w-3 h-3 rounded-full bg-indicator-error/70 border border-white" }),
|
|
1983
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text_default, { size: "sm", weight: "normal", color: "text-text-600", children: "Resposta incorreta" })
|
|
1984
|
+
] })
|
|
1985
|
+
] })
|
|
1986
|
+
] }),
|
|
1987
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "relative w-full", children: [
|
|
1988
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "sr-only", children: getSpatialRelationship() }),
|
|
1989
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1990
|
+
"img",
|
|
1991
|
+
{
|
|
1992
|
+
src: mock_image_question_default,
|
|
1993
|
+
alt: imageAltText,
|
|
1994
|
+
className: "w-full h-auto rounded-md"
|
|
1995
|
+
}
|
|
1996
|
+
),
|
|
1997
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1998
|
+
"div",
|
|
1999
|
+
{
|
|
2000
|
+
role: "img",
|
|
2001
|
+
"aria-label": `\xC1rea correta marcada em ${correctPositionDescription}`,
|
|
2002
|
+
className: "absolute rounded-full bg-indicator-primary/70 border-4 border-[#F8CC2E] pointer-events-none",
|
|
2003
|
+
style: {
|
|
2004
|
+
minWidth: "50px",
|
|
2005
|
+
maxWidth: "160px",
|
|
2006
|
+
width: "15%",
|
|
2007
|
+
aspectRatio: "1 / 1",
|
|
2008
|
+
left: `calc(${correctPositionRelative.x * 100}% - 7.5%)`,
|
|
2009
|
+
top: `calc(${correctPositionRelative.y * 100}% - 15%)`
|
|
2010
|
+
},
|
|
2011
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2012
|
+
Text_default,
|
|
2013
|
+
{
|
|
2014
|
+
size: "sm",
|
|
2015
|
+
weight: "normal",
|
|
2016
|
+
color: "text-text-600",
|
|
2017
|
+
className: "sr-only",
|
|
2018
|
+
children: [
|
|
2019
|
+
"C\xEDrculo amarelo indicando a \xE1rea correta da resposta, posicionado em",
|
|
2020
|
+
" ",
|
|
2021
|
+
correctPositionDescription
|
|
2022
|
+
]
|
|
2023
|
+
}
|
|
2024
|
+
)
|
|
2025
|
+
}
|
|
2026
|
+
),
|
|
2027
|
+
userPositionRelative && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2028
|
+
"div",
|
|
2029
|
+
{
|
|
2030
|
+
role: "img",
|
|
2031
|
+
"aria-label": `Resposta do aluno marcada em ${getPositionDescription(
|
|
2032
|
+
userPositionRelative.x,
|
|
2033
|
+
userPositionRelative.y
|
|
2034
|
+
)}, ${isCorrect ? "correta" : "incorreta"}`,
|
|
2035
|
+
className: `absolute rounded-full border-4 pointer-events-none ${getUserCircleColorClasses()}`,
|
|
2036
|
+
style: {
|
|
2037
|
+
minWidth: "30px",
|
|
2038
|
+
maxWidth: "52px",
|
|
2039
|
+
width: "5%",
|
|
2040
|
+
aspectRatio: "1 / 1",
|
|
2041
|
+
left: `calc(${userPositionRelative.x * 100}% - 2.5%)`,
|
|
2042
|
+
top: `calc(${userPositionRelative.y * 100}% - 2.5%)`
|
|
2043
|
+
},
|
|
2044
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
2045
|
+
Text_default,
|
|
2046
|
+
{
|
|
2047
|
+
size: "sm",
|
|
2048
|
+
weight: "normal",
|
|
2049
|
+
color: "text-text-600",
|
|
2050
|
+
className: "sr-only",
|
|
2051
|
+
children: [
|
|
2052
|
+
"C\xEDrculo ",
|
|
2053
|
+
isCorrect ? "verde" : "vermelho",
|
|
2054
|
+
" indicando a resposta do aluno, posicionado em",
|
|
2055
|
+
" ",
|
|
2056
|
+
getPositionDescription(
|
|
2057
|
+
userPositionRelative.x,
|
|
2058
|
+
userPositionRelative.y
|
|
2059
|
+
),
|
|
2060
|
+
". A resposta est\xE1",
|
|
2061
|
+
" ",
|
|
2062
|
+
Math.round(
|
|
2063
|
+
Math.sqrt(
|
|
2064
|
+
Math.pow(
|
|
2065
|
+
userPositionRelative.x - correctPositionRelative.x,
|
|
2066
|
+
2
|
|
2067
|
+
) + Math.pow(
|
|
2068
|
+
userPositionRelative.y - correctPositionRelative.y,
|
|
2069
|
+
2
|
|
2070
|
+
)
|
|
2071
|
+
) * 100
|
|
2072
|
+
),
|
|
2073
|
+
"% de dist\xE2ncia da \xE1rea correta e \xE9 considerada",
|
|
2074
|
+
" ",
|
|
2075
|
+
isCorrect ? "correta" : "incorreta",
|
|
2076
|
+
"."
|
|
2077
|
+
]
|
|
2078
|
+
}
|
|
2079
|
+
)
|
|
2080
|
+
}
|
|
2081
|
+
)
|
|
2082
|
+
] })
|
|
2083
|
+
] });
|
|
2084
|
+
};
|
|
2085
|
+
|
|
2086
|
+
// src/utils/questionRenderer/connectDots/index.tsx
|
|
2087
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2088
|
+
var renderQuestionConnectDots = ({
|
|
2089
|
+
paddingBottom
|
|
2090
|
+
} = {}) => {
|
|
2091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
2092
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(QuestionSubTitle, { subTitle: "Tipo de quest\xE3o: Ligar Pontos" }),
|
|
2093
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(QuestionContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text_default, { size: "md", weight: "normal", color: "text-text-600", children: "Tipo de quest\xE3o: Ligar Pontos (n\xE3o implementado)" }) }) })
|
|
2094
|
+
] });
|
|
2095
|
+
};
|
|
2096
|
+
|
|
2097
|
+
// src/utils/questionRenderer/index.tsx
|
|
2098
|
+
var questionRendererMap = {
|
|
2099
|
+
["ALTERNATIVA" /* ALTERNATIVA */]: renderQuestionAlternative,
|
|
2100
|
+
["MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */]: renderQuestionMultipleChoice,
|
|
2101
|
+
["VERDADEIRO_FALSO" /* VERDADEIRO_FALSO */]: renderQuestionTrueOrFalse,
|
|
2102
|
+
["DISSERTATIVA" /* DISSERTATIVA */]: renderQuestionDissertative,
|
|
2103
|
+
["PREENCHER" /* PREENCHER */]: renderQuestionFill,
|
|
2104
|
+
["IMAGEM" /* IMAGEM */]: renderQuestionImage,
|
|
2105
|
+
["LIGAR_PONTOS" /* LIGAR_PONTOS */]: renderQuestionConnectDots
|
|
2106
|
+
};
|
|
1535
2107
|
var renderFromMap = (renderers, questionType) => {
|
|
1536
2108
|
if (!questionType) return null;
|
|
1537
2109
|
const renderer = renderers[questionType];
|
|
1538
2110
|
return renderer ? renderer() : null;
|
|
1539
2111
|
};
|
|
1540
2112
|
|
|
2113
|
+
// src/types/questionTypes.ts
|
|
2114
|
+
var questionTypeLabels = {
|
|
2115
|
+
["ALTERNATIVA" /* ALTERNATIVA */]: "Alternativa",
|
|
2116
|
+
["VERDADEIRO_FALSO" /* VERDADEIRO_FALSO */]: "Verdadeiro ou Falso",
|
|
2117
|
+
["DISSERTATIVA" /* DISSERTATIVA */]: "Discursiva",
|
|
2118
|
+
["IMAGEM" /* IMAGEM */]: "Imagem",
|
|
2119
|
+
["MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */]: "M\xFAltipla Escolha",
|
|
2120
|
+
["LIGAR_PONTOS" /* LIGAR_PONTOS */]: "Ligar Pontos",
|
|
2121
|
+
["PREENCHER" /* PREENCHER */]: "Preencher Lacunas"
|
|
2122
|
+
};
|
|
2123
|
+
|
|
1541
2124
|
// src/components/ActivityCardQuestionBanks/ActivityCardQuestionBanks.tsx
|
|
1542
|
-
var
|
|
1543
|
-
var
|
|
1544
|
-
var
|
|
2125
|
+
var import_phosphor_react7 = require("phosphor-react");
|
|
2126
|
+
var import_react9 = require("react");
|
|
2127
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1545
2128
|
var ActivityCardQuestionBanks = ({
|
|
1546
2129
|
question,
|
|
1547
2130
|
questionType,
|
|
@@ -1552,7 +2135,7 @@ var ActivityCardQuestionBanks = ({
|
|
|
1552
2135
|
assunto,
|
|
1553
2136
|
enunciado
|
|
1554
2137
|
} = {}) => {
|
|
1555
|
-
const alternatives = (0,
|
|
2138
|
+
const alternatives = (0, import_react9.useMemo)(() => {
|
|
1556
2139
|
if (!question?.options || questionType !== "ALTERNATIVA" /* ALTERNATIVA */)
|
|
1557
2140
|
return [];
|
|
1558
2141
|
const correctOptionIds2 = question.correctOptionIds || [];
|
|
@@ -1566,13 +2149,13 @@ var ActivityCardQuestionBanks = ({
|
|
|
1566
2149
|
};
|
|
1567
2150
|
});
|
|
1568
2151
|
}, [question, questionType]);
|
|
1569
|
-
const correctOptionId = (0,
|
|
2152
|
+
const correctOptionId = (0, import_react9.useMemo)(() => {
|
|
1570
2153
|
if (!question?.correctOptionIds || question.correctOptionIds.length === 0) {
|
|
1571
2154
|
return void 0;
|
|
1572
2155
|
}
|
|
1573
2156
|
return question.correctOptionIds[0];
|
|
1574
2157
|
}, [question]);
|
|
1575
|
-
const multipleChoices = (0,
|
|
2158
|
+
const multipleChoices = (0, import_react9.useMemo)(() => {
|
|
1576
2159
|
if (!question?.options || questionType !== "MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */)
|
|
1577
2160
|
return [];
|
|
1578
2161
|
const correctOptionIds2 = question.correctOptionIds || [];
|
|
@@ -1586,18 +2169,18 @@ var ActivityCardQuestionBanks = ({
|
|
|
1586
2169
|
};
|
|
1587
2170
|
});
|
|
1588
2171
|
}, [question, questionType]);
|
|
1589
|
-
const correctOptionIds = (0,
|
|
2172
|
+
const correctOptionIds = (0, import_react9.useMemo)(() => {
|
|
1590
2173
|
return question?.correctOptionIds || [];
|
|
1591
2174
|
}, [question]);
|
|
1592
|
-
const
|
|
2175
|
+
const getStatusBadge2 = (status) => {
|
|
1593
2176
|
switch (status) {
|
|
1594
2177
|
case "correct":
|
|
1595
|
-
return /* @__PURE__ */ (0,
|
|
2178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_phosphor_react7.CheckCircle, {}), children: "Resposta correta" });
|
|
1596
2179
|
case "incorrect":
|
|
1597
|
-
return /* @__PURE__ */ (0,
|
|
2180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_phosphor_react7.XCircle, {}), children: "Resposta incorreta" });
|
|
1598
2181
|
}
|
|
1599
2182
|
};
|
|
1600
|
-
const
|
|
2183
|
+
const getStatusStyles2 = (status) => {
|
|
1601
2184
|
switch (status) {
|
|
1602
2185
|
case "correct":
|
|
1603
2186
|
return "bg-success-background border-success-300";
|
|
@@ -1608,7 +2191,7 @@ var ActivityCardQuestionBanks = ({
|
|
|
1608
2191
|
const getLetterByIndex = (index) => String.fromCodePoint(97 + index);
|
|
1609
2192
|
const renderAlternative = () => {
|
|
1610
2193
|
if (!question || alternatives.length === 0) return null;
|
|
1611
|
-
return /* @__PURE__ */ (0,
|
|
2194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1612
2195
|
AlternativesList,
|
|
1613
2196
|
{
|
|
1614
2197
|
alternatives,
|
|
@@ -1621,7 +2204,7 @@ var ActivityCardQuestionBanks = ({
|
|
|
1621
2204
|
};
|
|
1622
2205
|
const renderMultipleChoice = () => {
|
|
1623
2206
|
if (!question || multipleChoices.length === 0) return null;
|
|
1624
|
-
return /* @__PURE__ */ (0,
|
|
2207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1625
2208
|
MultipleChoiceList,
|
|
1626
2209
|
{
|
|
1627
2210
|
choices: multipleChoices,
|
|
@@ -1632,29 +2215,29 @@ var ActivityCardQuestionBanks = ({
|
|
|
1632
2215
|
) });
|
|
1633
2216
|
};
|
|
1634
2217
|
const renderDissertative = () => {
|
|
1635
|
-
return /* @__PURE__ */ (0,
|
|
2218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "mt-4 px-2 py-4", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text_default, { size: "sm", className: "text-text-600 italic", children: "Resposta do aluno" }) });
|
|
1636
2219
|
};
|
|
1637
2220
|
const renderTrueOrFalse = () => {
|
|
1638
2221
|
if (!question || question.options.length === 0) return null;
|
|
1639
|
-
return /* @__PURE__ */ (0,
|
|
2222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex flex-col gap-3.5", children: question.options.map((option, index) => {
|
|
1640
2223
|
const isCorrect = correctOptionIds.includes(option.id);
|
|
1641
2224
|
const correctAnswer = isCorrect ? "Verdadeiro" : "Falso";
|
|
1642
2225
|
const variantCorrect = "correct";
|
|
1643
|
-
return /* @__PURE__ */ (0,
|
|
2226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("section", { className: "flex flex-col gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1644
2227
|
"div",
|
|
1645
2228
|
{
|
|
1646
2229
|
className: cn(
|
|
1647
2230
|
"flex flex-row justify-between items-center gap-2 p-2 rounded-md border",
|
|
1648
|
-
|
|
2231
|
+
getStatusStyles2(variantCorrect)
|
|
1649
2232
|
),
|
|
1650
2233
|
children: [
|
|
1651
|
-
/* @__PURE__ */ (0,
|
|
1652
|
-
/* @__PURE__ */ (0,
|
|
1653
|
-
/* @__PURE__ */ (0,
|
|
2234
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text_default, { size: "sm", className: "text-text-900", children: getLetterByIndex(index).concat(") ").concat(option.option) }),
|
|
2235
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-row items-center gap-2 flex-shrink-0", children: [
|
|
2236
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text_default, { size: "sm", className: "text-text-700", children: [
|
|
1654
2237
|
"Resposta correta: ",
|
|
1655
2238
|
correctAnswer
|
|
1656
2239
|
] }),
|
|
1657
|
-
|
|
2240
|
+
getStatusBadge2(variantCorrect)
|
|
1658
2241
|
] })
|
|
1659
2242
|
]
|
|
1660
2243
|
}
|
|
@@ -1679,32 +2262,32 @@ var ActivityCardQuestionBanks = ({
|
|
|
1679
2262
|
["PREENCHER" /* PREENCHER */]: renderFill,
|
|
1680
2263
|
["IMAGEM" /* IMAGEM */]: renderImage
|
|
1681
2264
|
};
|
|
1682
|
-
return /* @__PURE__ */ (0,
|
|
1683
|
-
/* @__PURE__ */ (0,
|
|
1684
|
-
/* @__PURE__ */ (0,
|
|
1685
|
-
/* @__PURE__ */ (0,
|
|
2265
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "w-full flex flex-col gap-2 px-4 py-6", children: [
|
|
2266
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("section", { className: "flex flex-row gap-2 text-text-650", children: [
|
|
2267
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "py-1 px-2 flex flex-row items-center gap-1", children: [
|
|
2268
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1686
2269
|
"span",
|
|
1687
2270
|
{
|
|
1688
2271
|
className: "size-4 rounded-sm flex items-center justify-center shrink-0 text-text-950",
|
|
1689
2272
|
style: {
|
|
1690
2273
|
backgroundColor: getSubjectColorWithOpacity(subjectColor, isDark)
|
|
1691
2274
|
},
|
|
1692
|
-
children: /* @__PURE__ */ (0,
|
|
2275
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(IconRender_default, { iconName, size: 14, color: "currentColor" })
|
|
1693
2276
|
}
|
|
1694
2277
|
),
|
|
1695
|
-
/* @__PURE__ */ (0,
|
|
2278
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text_default, { size: "sm", children: assunto || "Assunto n\xE3o informado" })
|
|
1696
2279
|
] }),
|
|
1697
|
-
/* @__PURE__ */ (0,
|
|
2280
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "py-1 px-2 flex flex-row items-center gap-1", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text_default, { size: "sm", className: "", children: questionType ? questionTypeLabels[questionType] : "Tipo de quest\xE3o" }) })
|
|
1698
2281
|
] }),
|
|
1699
|
-
/* @__PURE__ */ (0,
|
|
1700
|
-
/* @__PURE__ */ (0,
|
|
2282
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("section", { className: "flex flex-col gap-1", children: [
|
|
2283
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text_default, { size: "md", weight: "medium", className: "text-text-950 text-md", children: enunciado || "Enunciado n\xE3o informado" }),
|
|
1701
2284
|
renderFromMap(questionRenderers, questionType)
|
|
1702
2285
|
] }),
|
|
1703
|
-
/* @__PURE__ */ (0,
|
|
2286
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("section", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1704
2287
|
Button_default,
|
|
1705
2288
|
{
|
|
1706
2289
|
size: "small",
|
|
1707
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
2290
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_phosphor_react7.Plus, {}),
|
|
1708
2291
|
className: "w-full",
|
|
1709
2292
|
onClick: () => {
|
|
1710
2293
|
if (onAddToActivity) {
|