analytica-frontend-lib 1.1.4 → 1.1.6
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/Menu/index.d.mts +1 -27
- package/dist/Menu/index.d.ts +1 -27
- package/dist/Menu/index.js +0 -43
- package/dist/Menu/index.js.map +1 -1
- package/dist/Menu/index.mjs +1 -44
- package/dist/Menu/index.mjs.map +1 -1
- package/dist/Quiz/index.d.mts +1 -2
- package/dist/Quiz/index.d.ts +1 -2
- package/dist/Quiz/index.js +31 -5
- package/dist/Quiz/index.js.map +1 -1
- package/dist/Quiz/index.mjs +31 -5
- package/dist/Quiz/index.mjs.map +1 -1
- package/dist/Quiz/useQuizStore/index.d.mts +2 -0
- package/dist/Quiz/useQuizStore/index.d.ts +2 -0
- package/dist/Quiz/useQuizStore/index.js +2 -0
- package/dist/Quiz/useQuizStore/index.js.map +1 -1
- package/dist/Quiz/useQuizStore/index.mjs +2 -0
- package/dist/Quiz/useQuizStore/index.mjs.map +1 -1
- package/dist/VideoPlayer/index.d.mts +41 -0
- package/dist/VideoPlayer/index.d.ts +41 -0
- package/dist/VideoPlayer/index.js +562 -0
- package/dist/VideoPlayer/index.js.map +1 -0
- package/dist/VideoPlayer/index.mjs +550 -0
- package/dist/VideoPlayer/index.mjs.map +1 -0
- package/dist/index.css +124 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +679 -269
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +667 -249
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +124 -0
- package/dist/styles.css.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -35,7 +35,6 @@ __export(src_exports, {
|
|
|
35
35
|
AlternativesList: () => AlternativesList,
|
|
36
36
|
AuthProvider: () => AuthProvider,
|
|
37
37
|
Badge: () => Badge_default,
|
|
38
|
-
Breadcrumb: () => Breadcrumb,
|
|
39
38
|
Button: () => Button_default,
|
|
40
39
|
Calendar: () => Calendar_default,
|
|
41
40
|
CardAccordation: () => CardAccordation,
|
|
@@ -122,6 +121,7 @@ __export(src_exports, {
|
|
|
122
121
|
TextArea: () => TextArea_default,
|
|
123
122
|
Toast: () => Toast_default,
|
|
124
123
|
Toaster: () => Toaster_default,
|
|
124
|
+
VideoPlayer: () => VideoPlayer_default,
|
|
125
125
|
createZustandAuthAdapter: () => createZustandAuthAdapter,
|
|
126
126
|
getRootDomain: () => getRootDomain,
|
|
127
127
|
getStatusBadge: () => getStatusBadge,
|
|
@@ -4724,7 +4724,7 @@ var CardAudio = (0, import_react14.forwardRef)(
|
|
|
4724
4724
|
const [volume, setVolume] = (0, import_react14.useState)(1);
|
|
4725
4725
|
const [showVolumeControl, setShowVolumeControl] = (0, import_react14.useState)(false);
|
|
4726
4726
|
const audioRef = (0, import_react14.useRef)(null);
|
|
4727
|
-
const
|
|
4727
|
+
const formatTime2 = (time) => {
|
|
4728
4728
|
const minutes = Math.floor(time / 60);
|
|
4729
4729
|
const seconds = Math.floor(time % 60);
|
|
4730
4730
|
return `${minutes}:${seconds.toString().padStart(2, "0")}`;
|
|
@@ -4842,7 +4842,7 @@ var CardAudio = (0, import_react14.forwardRef)(
|
|
|
4842
4842
|
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_phosphor_react12.Play, { size: 24 })
|
|
4843
4843
|
}
|
|
4844
4844
|
),
|
|
4845
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children:
|
|
4845
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children: formatTime2(currentTime) }),
|
|
4846
4846
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex-1 relative", "data-testid": "progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4847
4847
|
"button",
|
|
4848
4848
|
{
|
|
@@ -4869,7 +4869,7 @@ var CardAudio = (0, import_react14.forwardRef)(
|
|
|
4869
4869
|
)
|
|
4870
4870
|
}
|
|
4871
4871
|
) }),
|
|
4872
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children:
|
|
4872
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-text-800 text-sm font-medium min-w-[2.5rem]", children: formatTime2(duration) }),
|
|
4873
4873
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "relative", children: [
|
|
4874
4874
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4875
4875
|
"button",
|
|
@@ -6565,47 +6565,6 @@ var injectStore5 = (children, store) => import_react20.Children.map(children, (c
|
|
|
6565
6565
|
...typedChild.props.children ? { children: injectStore5(typedChild.props.children, store) } : {}
|
|
6566
6566
|
});
|
|
6567
6567
|
});
|
|
6568
|
-
var Breadcrumb = (0, import_react20.forwardRef)(
|
|
6569
|
-
({ currentPage, parentPageName, onBackClick, className, ...props }, ref) => {
|
|
6570
|
-
const handleBackToParent = (0, import_react20.useCallback)(() => {
|
|
6571
|
-
onBackClick();
|
|
6572
|
-
}, [onBackClick]);
|
|
6573
|
-
const breadcrumbClassName = `py-4 ${typeof className === "string" ? className : ""}`;
|
|
6574
|
-
const { defaultValue: _unused, ...menuProps } = props;
|
|
6575
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6576
|
-
Menu,
|
|
6577
|
-
{
|
|
6578
|
-
ref,
|
|
6579
|
-
variant: "breadcrumb",
|
|
6580
|
-
defaultValue: currentPage.toLowerCase(),
|
|
6581
|
-
className: breadcrumbClassName,
|
|
6582
|
-
...menuProps,
|
|
6583
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(MenuContent, { variant: "breadcrumb", children: [
|
|
6584
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6585
|
-
MenuItem,
|
|
6586
|
-
{
|
|
6587
|
-
variant: "breadcrumb",
|
|
6588
|
-
value: parentPageName.toLowerCase(),
|
|
6589
|
-
onClick: handleBackToParent,
|
|
6590
|
-
separator: true,
|
|
6591
|
-
children: parentPageName
|
|
6592
|
-
}
|
|
6593
|
-
),
|
|
6594
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
6595
|
-
MenuItem,
|
|
6596
|
-
{
|
|
6597
|
-
variant: "breadcrumb",
|
|
6598
|
-
value: currentPage.toLowerCase(),
|
|
6599
|
-
disabled: true,
|
|
6600
|
-
children: currentPage
|
|
6601
|
-
}
|
|
6602
|
-
)
|
|
6603
|
-
] })
|
|
6604
|
-
}
|
|
6605
|
-
);
|
|
6606
|
-
}
|
|
6607
|
-
);
|
|
6608
|
-
Breadcrumb.displayName = "Breadcrumb";
|
|
6609
6568
|
var Menu_default = Menu;
|
|
6610
6569
|
|
|
6611
6570
|
// src/components/Skeleton/Skeleton.tsx
|
|
@@ -6861,11 +6820,436 @@ var NotFound = ({
|
|
|
6861
6820
|
};
|
|
6862
6821
|
var NotFound_default = NotFound;
|
|
6863
6822
|
|
|
6864
|
-
// src/components/
|
|
6823
|
+
// src/components/VideoPlayer/VideoPlayer.tsx
|
|
6865
6824
|
var import_react22 = require("react");
|
|
6866
|
-
var
|
|
6825
|
+
var import_phosphor_react18 = require("phosphor-react");
|
|
6867
6826
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
6868
|
-
var
|
|
6827
|
+
var formatTime = (seconds) => {
|
|
6828
|
+
if (!seconds || isNaN(seconds)) return "0:00";
|
|
6829
|
+
const mins = Math.floor(seconds / 60);
|
|
6830
|
+
const secs = Math.floor(seconds % 60);
|
|
6831
|
+
return `${mins}:${secs.toString().padStart(2, "0")}`;
|
|
6832
|
+
};
|
|
6833
|
+
var VideoPlayer = ({
|
|
6834
|
+
src,
|
|
6835
|
+
poster,
|
|
6836
|
+
subtitles,
|
|
6837
|
+
title,
|
|
6838
|
+
subtitle: subtitleText,
|
|
6839
|
+
initialTime = 0,
|
|
6840
|
+
onTimeUpdate,
|
|
6841
|
+
onProgress,
|
|
6842
|
+
onVideoComplete,
|
|
6843
|
+
className,
|
|
6844
|
+
autoSave = true,
|
|
6845
|
+
storageKey = "video-progress"
|
|
6846
|
+
}) => {
|
|
6847
|
+
const videoRef = (0, import_react22.useRef)(null);
|
|
6848
|
+
const [isPlaying, setIsPlaying] = (0, import_react22.useState)(false);
|
|
6849
|
+
const [currentTime, setCurrentTime] = (0, import_react22.useState)(0);
|
|
6850
|
+
const [duration, setDuration] = (0, import_react22.useState)(0);
|
|
6851
|
+
const [isMuted, setIsMuted] = (0, import_react22.useState)(false);
|
|
6852
|
+
const [volume, setVolume] = (0, import_react22.useState)(1);
|
|
6853
|
+
const [isFullscreen, setIsFullscreen] = (0, import_react22.useState)(false);
|
|
6854
|
+
const [showControls, setShowControls] = (0, import_react22.useState)(true);
|
|
6855
|
+
const [hasCompleted, setHasCompleted] = (0, import_react22.useState)(false);
|
|
6856
|
+
const [showCaptions, setShowCaptions] = (0, import_react22.useState)(false);
|
|
6857
|
+
const [playbackRate, setPlaybackRate] = (0, import_react22.useState)(1);
|
|
6858
|
+
const [showSpeedMenu, setShowSpeedMenu] = (0, import_react22.useState)(false);
|
|
6859
|
+
const lastSaveTimeRef = (0, import_react22.useRef)(0);
|
|
6860
|
+
const trackRef = (0, import_react22.useRef)(null);
|
|
6861
|
+
(0, import_react22.useEffect)(() => {
|
|
6862
|
+
if (videoRef.current) {
|
|
6863
|
+
videoRef.current.volume = volume;
|
|
6864
|
+
videoRef.current.muted = isMuted;
|
|
6865
|
+
}
|
|
6866
|
+
}, [volume, isMuted]);
|
|
6867
|
+
(0, import_react22.useEffect)(() => {
|
|
6868
|
+
if (!autoSave || !storageKey) return;
|
|
6869
|
+
const raw = localStorage.getItem(`${storageKey}-${src}`);
|
|
6870
|
+
const saved = raw !== null ? Number(raw) : NaN;
|
|
6871
|
+
const hasValidSaved = Number.isFinite(saved) && saved >= 0;
|
|
6872
|
+
const hasValidInitial = Number.isFinite(initialTime) && initialTime >= 0;
|
|
6873
|
+
let start;
|
|
6874
|
+
if (hasValidInitial) {
|
|
6875
|
+
start = initialTime;
|
|
6876
|
+
} else if (hasValidSaved) {
|
|
6877
|
+
start = saved;
|
|
6878
|
+
} else {
|
|
6879
|
+
start = void 0;
|
|
6880
|
+
}
|
|
6881
|
+
if (start !== void 0 && videoRef.current) {
|
|
6882
|
+
videoRef.current.currentTime = start;
|
|
6883
|
+
setCurrentTime(start);
|
|
6884
|
+
}
|
|
6885
|
+
}, [src, storageKey, autoSave, initialTime]);
|
|
6886
|
+
const saveProgress = (0, import_react22.useCallback)(() => {
|
|
6887
|
+
if (!autoSave || !storageKey) return;
|
|
6888
|
+
const now = Date.now();
|
|
6889
|
+
if (now - lastSaveTimeRef.current > 5e3) {
|
|
6890
|
+
localStorage.setItem(`${storageKey}-${src}`, currentTime.toString());
|
|
6891
|
+
lastSaveTimeRef.current = now;
|
|
6892
|
+
}
|
|
6893
|
+
}, [autoSave, storageKey, src, currentTime]);
|
|
6894
|
+
const togglePlayPause = (0, import_react22.useCallback)(() => {
|
|
6895
|
+
if (videoRef.current) {
|
|
6896
|
+
if (isPlaying) {
|
|
6897
|
+
videoRef.current.pause();
|
|
6898
|
+
} else {
|
|
6899
|
+
videoRef.current.play();
|
|
6900
|
+
}
|
|
6901
|
+
setIsPlaying(!isPlaying);
|
|
6902
|
+
}
|
|
6903
|
+
}, [isPlaying]);
|
|
6904
|
+
const handleVolumeChange = (0, import_react22.useCallback)(
|
|
6905
|
+
(newVolume) => {
|
|
6906
|
+
if (videoRef.current) {
|
|
6907
|
+
const volumeValue = newVolume / 100;
|
|
6908
|
+
videoRef.current.volume = volumeValue;
|
|
6909
|
+
setVolume(volumeValue);
|
|
6910
|
+
if (volumeValue === 0) {
|
|
6911
|
+
videoRef.current.muted = true;
|
|
6912
|
+
setIsMuted(true);
|
|
6913
|
+
} else if (isMuted) {
|
|
6914
|
+
videoRef.current.muted = false;
|
|
6915
|
+
setIsMuted(false);
|
|
6916
|
+
}
|
|
6917
|
+
}
|
|
6918
|
+
},
|
|
6919
|
+
[isMuted]
|
|
6920
|
+
);
|
|
6921
|
+
const toggleMute = (0, import_react22.useCallback)(() => {
|
|
6922
|
+
if (videoRef.current) {
|
|
6923
|
+
if (isMuted) {
|
|
6924
|
+
const restoreVolume = volume > 0 ? volume : 0.5;
|
|
6925
|
+
videoRef.current.volume = restoreVolume;
|
|
6926
|
+
videoRef.current.muted = false;
|
|
6927
|
+
setVolume(restoreVolume);
|
|
6928
|
+
setIsMuted(false);
|
|
6929
|
+
} else {
|
|
6930
|
+
videoRef.current.muted = true;
|
|
6931
|
+
setIsMuted(true);
|
|
6932
|
+
}
|
|
6933
|
+
}
|
|
6934
|
+
}, [isMuted, volume]);
|
|
6935
|
+
const toggleFullscreen = (0, import_react22.useCallback)(() => {
|
|
6936
|
+
const container = videoRef.current?.parentElement;
|
|
6937
|
+
if (!container) return;
|
|
6938
|
+
if (!isFullscreen) {
|
|
6939
|
+
if (container.requestFullscreen) {
|
|
6940
|
+
container.requestFullscreen();
|
|
6941
|
+
}
|
|
6942
|
+
} else if (document.exitFullscreen) {
|
|
6943
|
+
document.exitFullscreen();
|
|
6944
|
+
}
|
|
6945
|
+
setIsFullscreen(!isFullscreen);
|
|
6946
|
+
}, [isFullscreen]);
|
|
6947
|
+
const handleSpeedChange = (0, import_react22.useCallback)((speed) => {
|
|
6948
|
+
if (videoRef.current) {
|
|
6949
|
+
videoRef.current.playbackRate = speed;
|
|
6950
|
+
setPlaybackRate(speed);
|
|
6951
|
+
setShowSpeedMenu(false);
|
|
6952
|
+
}
|
|
6953
|
+
}, []);
|
|
6954
|
+
const toggleSpeedMenu = (0, import_react22.useCallback)(() => {
|
|
6955
|
+
setShowSpeedMenu(!showSpeedMenu);
|
|
6956
|
+
}, [showSpeedMenu]);
|
|
6957
|
+
const toggleCaptions = (0, import_react22.useCallback)(() => {
|
|
6958
|
+
if (!trackRef.current?.track) return;
|
|
6959
|
+
const newShowCaptions = !showCaptions;
|
|
6960
|
+
setShowCaptions(newShowCaptions);
|
|
6961
|
+
trackRef.current.track.mode = newShowCaptions ? "showing" : "hidden";
|
|
6962
|
+
}, [showCaptions]);
|
|
6963
|
+
const handleTimeUpdate = (0, import_react22.useCallback)(() => {
|
|
6964
|
+
if (videoRef.current) {
|
|
6965
|
+
const current = videoRef.current.currentTime;
|
|
6966
|
+
setCurrentTime(current);
|
|
6967
|
+
saveProgress();
|
|
6968
|
+
onTimeUpdate?.(current);
|
|
6969
|
+
if (duration > 0) {
|
|
6970
|
+
const progressPercent = current / duration * 100;
|
|
6971
|
+
onProgress?.(progressPercent);
|
|
6972
|
+
if (progressPercent >= 95 && !hasCompleted) {
|
|
6973
|
+
setHasCompleted(true);
|
|
6974
|
+
onVideoComplete?.();
|
|
6975
|
+
}
|
|
6976
|
+
}
|
|
6977
|
+
}
|
|
6978
|
+
}, [
|
|
6979
|
+
duration,
|
|
6980
|
+
saveProgress,
|
|
6981
|
+
onTimeUpdate,
|
|
6982
|
+
onProgress,
|
|
6983
|
+
onVideoComplete,
|
|
6984
|
+
hasCompleted
|
|
6985
|
+
]);
|
|
6986
|
+
const handleLoadedMetadata = (0, import_react22.useCallback)(() => {
|
|
6987
|
+
if (videoRef.current) {
|
|
6988
|
+
setDuration(videoRef.current.duration);
|
|
6989
|
+
}
|
|
6990
|
+
}, []);
|
|
6991
|
+
(0, import_react22.useEffect)(() => {
|
|
6992
|
+
const handleVisibilityChange = () => {
|
|
6993
|
+
if (document.hidden && isPlaying && videoRef.current) {
|
|
6994
|
+
videoRef.current.pause();
|
|
6995
|
+
setIsPlaying(false);
|
|
6996
|
+
}
|
|
6997
|
+
};
|
|
6998
|
+
const handleBlur = () => {
|
|
6999
|
+
if (isPlaying && videoRef.current) {
|
|
7000
|
+
videoRef.current.pause();
|
|
7001
|
+
setIsPlaying(false);
|
|
7002
|
+
}
|
|
7003
|
+
};
|
|
7004
|
+
document.addEventListener("visibilitychange", handleVisibilityChange);
|
|
7005
|
+
window.addEventListener("blur", handleBlur);
|
|
7006
|
+
return () => {
|
|
7007
|
+
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
7008
|
+
window.removeEventListener("blur", handleBlur);
|
|
7009
|
+
};
|
|
7010
|
+
}, [isPlaying]);
|
|
7011
|
+
const progressPercentage = duration > 0 ? currentTime / duration * 100 : 0;
|
|
7012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: cn("flex flex-col", className), children: [
|
|
7013
|
+
(title || subtitleText) && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "bg-subject-1 rounded-t-xl px-8 py-4 flex items-end justify-between min-h-20", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
7014
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7015
|
+
Text_default,
|
|
7016
|
+
{
|
|
7017
|
+
as: "h2",
|
|
7018
|
+
size: "lg",
|
|
7019
|
+
weight: "bold",
|
|
7020
|
+
color: "text-text-900",
|
|
7021
|
+
className: "leading-5 tracking-wide",
|
|
7022
|
+
children: title
|
|
7023
|
+
}
|
|
7024
|
+
),
|
|
7025
|
+
subtitleText && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7026
|
+
Text_default,
|
|
7027
|
+
{
|
|
7028
|
+
as: "p",
|
|
7029
|
+
size: "sm",
|
|
7030
|
+
weight: "normal",
|
|
7031
|
+
color: "text-text-600",
|
|
7032
|
+
className: "leading-5",
|
|
7033
|
+
children: subtitleText
|
|
7034
|
+
}
|
|
7035
|
+
)
|
|
7036
|
+
] }) }),
|
|
7037
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
7038
|
+
"div",
|
|
7039
|
+
{
|
|
7040
|
+
className: cn(
|
|
7041
|
+
"relative w-full bg-background overflow-hidden group",
|
|
7042
|
+
title || subtitleText ? "rounded-b-xl" : "rounded-xl"
|
|
7043
|
+
),
|
|
7044
|
+
children: [
|
|
7045
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7046
|
+
"video",
|
|
7047
|
+
{
|
|
7048
|
+
ref: videoRef,
|
|
7049
|
+
src,
|
|
7050
|
+
poster,
|
|
7051
|
+
className: "w-full h-full object-contain",
|
|
7052
|
+
controlsList: "nodownload",
|
|
7053
|
+
onTimeUpdate: handleTimeUpdate,
|
|
7054
|
+
onLoadedMetadata: handleLoadedMetadata,
|
|
7055
|
+
onClick: togglePlayPause,
|
|
7056
|
+
onKeyDown: (e) => {
|
|
7057
|
+
if (e.key) {
|
|
7058
|
+
setShowControls(true);
|
|
7059
|
+
}
|
|
7060
|
+
if (e.key === " " || e.key === "Enter") {
|
|
7061
|
+
e.preventDefault();
|
|
7062
|
+
togglePlayPause();
|
|
7063
|
+
}
|
|
7064
|
+
if (e.key === "ArrowLeft" && videoRef.current) {
|
|
7065
|
+
e.preventDefault();
|
|
7066
|
+
videoRef.current.currentTime -= 10;
|
|
7067
|
+
}
|
|
7068
|
+
if (e.key === "ArrowRight" && videoRef.current) {
|
|
7069
|
+
e.preventDefault();
|
|
7070
|
+
videoRef.current.currentTime += 10;
|
|
7071
|
+
}
|
|
7072
|
+
if (e.key === "ArrowUp") {
|
|
7073
|
+
e.preventDefault();
|
|
7074
|
+
handleVolumeChange(Math.min(100, volume * 100 + 10));
|
|
7075
|
+
}
|
|
7076
|
+
if (e.key === "ArrowDown") {
|
|
7077
|
+
e.preventDefault();
|
|
7078
|
+
handleVolumeChange(Math.max(0, volume * 100 - 10));
|
|
7079
|
+
}
|
|
7080
|
+
if (e.key === "m" || e.key === "M") {
|
|
7081
|
+
e.preventDefault();
|
|
7082
|
+
toggleMute();
|
|
7083
|
+
}
|
|
7084
|
+
if (e.key === "f" || e.key === "F") {
|
|
7085
|
+
e.preventDefault();
|
|
7086
|
+
toggleFullscreen();
|
|
7087
|
+
}
|
|
7088
|
+
},
|
|
7089
|
+
tabIndex: 0,
|
|
7090
|
+
"aria-label": title ? `Video: ${title}` : "Video player",
|
|
7091
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7092
|
+
"track",
|
|
7093
|
+
{
|
|
7094
|
+
ref: trackRef,
|
|
7095
|
+
kind: "captions",
|
|
7096
|
+
src: subtitles || "data:text/vtt;charset=utf-8,WEBVTT%0A%0ANOTE%20No%20captions%20available",
|
|
7097
|
+
srcLang: "en",
|
|
7098
|
+
label: subtitles ? "Subtitles" : "No captions available",
|
|
7099
|
+
default: false
|
|
7100
|
+
}
|
|
7101
|
+
)
|
|
7102
|
+
}
|
|
7103
|
+
),
|
|
7104
|
+
!isPlaying && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "absolute inset-0 flex items-center justify-center bg-black/30 transition-opacity", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7105
|
+
IconButton_default,
|
|
7106
|
+
{
|
|
7107
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react18.Play, { size: 32, weight: "regular", className: "ml-1" }),
|
|
7108
|
+
onClick: togglePlayPause,
|
|
7109
|
+
"aria-label": "Play video",
|
|
7110
|
+
className: "!bg-transparent !text-white !w-auto !h-auto hover:!bg-transparent hover:!text-gray-200"
|
|
7111
|
+
}
|
|
7112
|
+
) }),
|
|
7113
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7114
|
+
"div",
|
|
7115
|
+
{
|
|
7116
|
+
className: cn(
|
|
7117
|
+
"absolute top-0 left-0 right-0 p-4 bg-gradient-to-b from-black/70 to-transparent transition-opacity",
|
|
7118
|
+
!isPlaying || showControls ? "opacity-100" : "opacity-0 group-hover:opacity-100"
|
|
7119
|
+
),
|
|
7120
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "ml-auto block", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7121
|
+
IconButton_default,
|
|
7122
|
+
{
|
|
7123
|
+
icon: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react18.ArrowsInSimple, { size: 24 }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react18.ArrowsOutSimple, { size: 24 }),
|
|
7124
|
+
onClick: toggleFullscreen,
|
|
7125
|
+
"aria-label": isFullscreen ? "Exit fullscreen" : "Enter fullscreen",
|
|
7126
|
+
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
7127
|
+
}
|
|
7128
|
+
) })
|
|
7129
|
+
}
|
|
7130
|
+
),
|
|
7131
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
7132
|
+
"div",
|
|
7133
|
+
{
|
|
7134
|
+
className: cn(
|
|
7135
|
+
"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/90 to-transparent transition-opacity",
|
|
7136
|
+
!isPlaying || showControls ? "opacity-100" : "opacity-0 group-hover:opacity-100"
|
|
7137
|
+
),
|
|
7138
|
+
children: [
|
|
7139
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "px-4 pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7140
|
+
"input",
|
|
7141
|
+
{
|
|
7142
|
+
type: "range",
|
|
7143
|
+
min: 0,
|
|
7144
|
+
max: duration || 100,
|
|
7145
|
+
value: currentTime,
|
|
7146
|
+
onChange: (e) => {
|
|
7147
|
+
const newTime = parseFloat(e.target.value);
|
|
7148
|
+
if (videoRef.current) {
|
|
7149
|
+
videoRef.current.currentTime = newTime;
|
|
7150
|
+
}
|
|
7151
|
+
},
|
|
7152
|
+
className: "w-full h-1 bg-neutral-600 rounded-full appearance-none cursor-pointer slider:bg-primary-600 focus:outline-none focus:ring-2 focus:ring-primary-500",
|
|
7153
|
+
"aria-label": "Video progress",
|
|
7154
|
+
style: {
|
|
7155
|
+
background: `linear-gradient(to right, #2271C4 ${progressPercentage}%, #D5D4D4 ${progressPercentage}%)`
|
|
7156
|
+
}
|
|
7157
|
+
}
|
|
7158
|
+
) }),
|
|
7159
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-between px-4 pb-4", children: [
|
|
7160
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
7161
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7162
|
+
IconButton_default,
|
|
7163
|
+
{
|
|
7164
|
+
icon: isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react18.Pause, { size: 24 }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react18.Play, { size: 24 }),
|
|
7165
|
+
onClick: togglePlayPause,
|
|
7166
|
+
"aria-label": isPlaying ? "Pause" : "Play",
|
|
7167
|
+
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
7168
|
+
}
|
|
7169
|
+
),
|
|
7170
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
7171
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7172
|
+
IconButton_default,
|
|
7173
|
+
{
|
|
7174
|
+
icon: isMuted ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react18.SpeakerSlash, { size: 24 }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react18.SpeakerHigh, { size: 24 }),
|
|
7175
|
+
onClick: toggleMute,
|
|
7176
|
+
"aria-label": isMuted ? "Unmute" : "Mute",
|
|
7177
|
+
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
7178
|
+
}
|
|
7179
|
+
),
|
|
7180
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7181
|
+
"input",
|
|
7182
|
+
{
|
|
7183
|
+
type: "range",
|
|
7184
|
+
min: 0,
|
|
7185
|
+
max: 100,
|
|
7186
|
+
value: Math.round(volume * 100),
|
|
7187
|
+
onChange: (e) => handleVolumeChange(parseInt(e.target.value)),
|
|
7188
|
+
className: "w-20 h-1 bg-neutral-600 rounded-full appearance-none cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary-500",
|
|
7189
|
+
"aria-label": "Volume control",
|
|
7190
|
+
style: {
|
|
7191
|
+
background: `linear-gradient(to right, #2271C4 ${volume * 100}%, #D5D4D4 ${volume * 100}%)`
|
|
7192
|
+
}
|
|
7193
|
+
}
|
|
7194
|
+
)
|
|
7195
|
+
] }),
|
|
7196
|
+
subtitles && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7197
|
+
IconButton_default,
|
|
7198
|
+
{
|
|
7199
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react18.ClosedCaptioning, { size: 24 }),
|
|
7200
|
+
onClick: toggleCaptions,
|
|
7201
|
+
"aria-label": showCaptions ? "Hide captions" : "Show captions",
|
|
7202
|
+
className: cn(
|
|
7203
|
+
"!bg-transparent hover:!bg-white/20",
|
|
7204
|
+
showCaptions ? "!text-primary-400" : "!text-white"
|
|
7205
|
+
)
|
|
7206
|
+
}
|
|
7207
|
+
),
|
|
7208
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Text_default, { size: "sm", weight: "medium", color: "text-white", children: [
|
|
7209
|
+
formatTime(currentTime),
|
|
7210
|
+
" / ",
|
|
7211
|
+
formatTime(duration)
|
|
7212
|
+
] })
|
|
7213
|
+
] }),
|
|
7214
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "relative", children: [
|
|
7215
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7216
|
+
IconButton_default,
|
|
7217
|
+
{
|
|
7218
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react18.DotsThreeVertical, { size: 24 }),
|
|
7219
|
+
onClick: toggleSpeedMenu,
|
|
7220
|
+
"aria-label": "Playback speed",
|
|
7221
|
+
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
7222
|
+
}
|
|
7223
|
+
),
|
|
7224
|
+
showSpeedMenu && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "absolute bottom-12 right-0 bg-black/90 rounded-lg p-2 min-w-20", children: [0.5, 0.75, 1, 1.25, 1.5, 2].map((speed) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
7225
|
+
"button",
|
|
7226
|
+
{
|
|
7227
|
+
onClick: () => handleSpeedChange(speed),
|
|
7228
|
+
className: `block w-full text-left px-3 py-1 text-sm rounded hover:bg-white/20 transition-colors ${playbackRate === speed ? "text-primary-400" : "text-white"}`,
|
|
7229
|
+
children: [
|
|
7230
|
+
speed,
|
|
7231
|
+
"x"
|
|
7232
|
+
]
|
|
7233
|
+
},
|
|
7234
|
+
speed
|
|
7235
|
+
)) })
|
|
7236
|
+
] }) })
|
|
7237
|
+
] })
|
|
7238
|
+
]
|
|
7239
|
+
}
|
|
7240
|
+
)
|
|
7241
|
+
]
|
|
7242
|
+
}
|
|
7243
|
+
)
|
|
7244
|
+
] });
|
|
7245
|
+
};
|
|
7246
|
+
var VideoPlayer_default = VideoPlayer;
|
|
7247
|
+
|
|
7248
|
+
// src/components/Auth/Auth.tsx
|
|
7249
|
+
var import_react23 = require("react");
|
|
7250
|
+
var import_react_router_dom = require("react-router-dom");
|
|
7251
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
7252
|
+
var AuthContext = (0, import_react23.createContext)(void 0);
|
|
6869
7253
|
var AuthProvider = ({
|
|
6870
7254
|
children,
|
|
6871
7255
|
checkAuthFn,
|
|
@@ -6875,12 +7259,12 @@ var AuthProvider = ({
|
|
|
6875
7259
|
getSessionFn,
|
|
6876
7260
|
getTokensFn
|
|
6877
7261
|
}) => {
|
|
6878
|
-
const [authState, setAuthState] = (0,
|
|
7262
|
+
const [authState, setAuthState] = (0, import_react23.useState)({
|
|
6879
7263
|
isAuthenticated: false,
|
|
6880
7264
|
isLoading: true,
|
|
6881
7265
|
...initialAuthState
|
|
6882
7266
|
});
|
|
6883
|
-
const checkAuth = (0,
|
|
7267
|
+
const checkAuth = (0, import_react23.useCallback)(async () => {
|
|
6884
7268
|
try {
|
|
6885
7269
|
setAuthState((prev) => ({ ...prev, isLoading: true }));
|
|
6886
7270
|
if (!checkAuthFn) {
|
|
@@ -6911,7 +7295,7 @@ var AuthProvider = ({
|
|
|
6911
7295
|
return false;
|
|
6912
7296
|
}
|
|
6913
7297
|
}, [checkAuthFn, getUserFn, getSessionFn, getTokensFn]);
|
|
6914
|
-
const signOut = (0,
|
|
7298
|
+
const signOut = (0, import_react23.useCallback)(() => {
|
|
6915
7299
|
if (signOutFn) {
|
|
6916
7300
|
signOutFn();
|
|
6917
7301
|
}
|
|
@@ -6923,10 +7307,10 @@ var AuthProvider = ({
|
|
|
6923
7307
|
tokens: void 0
|
|
6924
7308
|
}));
|
|
6925
7309
|
}, [signOutFn]);
|
|
6926
|
-
(0,
|
|
7310
|
+
(0, import_react23.useEffect)(() => {
|
|
6927
7311
|
checkAuth();
|
|
6928
7312
|
}, [checkAuth]);
|
|
6929
|
-
const contextValue = (0,
|
|
7313
|
+
const contextValue = (0, import_react23.useMemo)(
|
|
6930
7314
|
() => ({
|
|
6931
7315
|
...authState,
|
|
6932
7316
|
checkAuth,
|
|
@@ -6934,10 +7318,10 @@ var AuthProvider = ({
|
|
|
6934
7318
|
}),
|
|
6935
7319
|
[authState, checkAuth, signOut]
|
|
6936
7320
|
);
|
|
6937
|
-
return /* @__PURE__ */ (0,
|
|
7321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AuthContext.Provider, { value: contextValue, children });
|
|
6938
7322
|
};
|
|
6939
7323
|
var useAuth = () => {
|
|
6940
|
-
const context = (0,
|
|
7324
|
+
const context = (0, import_react23.useContext)(AuthContext);
|
|
6941
7325
|
if (context === void 0) {
|
|
6942
7326
|
throw new Error("useAuth deve ser usado dentro de um AuthProvider");
|
|
6943
7327
|
}
|
|
@@ -6950,9 +7334,9 @@ var ProtectedRoute = ({
|
|
|
6950
7334
|
additionalCheck
|
|
6951
7335
|
}) => {
|
|
6952
7336
|
const { isAuthenticated, isLoading, ...authState } = useAuth();
|
|
6953
|
-
const defaultLoadingComponent = /* @__PURE__ */ (0,
|
|
7337
|
+
const defaultLoadingComponent = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "text-text-950 text-lg", children: "Carregando..." }) });
|
|
6954
7338
|
if (isLoading) {
|
|
6955
|
-
return /* @__PURE__ */ (0,
|
|
7339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children: loadingComponent || defaultLoadingComponent });
|
|
6956
7340
|
}
|
|
6957
7341
|
if (!isAuthenticated) {
|
|
6958
7342
|
if (typeof window !== "undefined") {
|
|
@@ -6963,12 +7347,12 @@ var ProtectedRoute = ({
|
|
|
6963
7347
|
return null;
|
|
6964
7348
|
}
|
|
6965
7349
|
}
|
|
6966
|
-
return /* @__PURE__ */ (0,
|
|
7350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_router_dom.Navigate, { to: redirectTo, replace: true });
|
|
6967
7351
|
}
|
|
6968
7352
|
if (additionalCheck && !additionalCheck({ isAuthenticated, isLoading, ...authState })) {
|
|
6969
|
-
return /* @__PURE__ */ (0,
|
|
7353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_router_dom.Navigate, { to: redirectTo, replace: true });
|
|
6970
7354
|
}
|
|
6971
|
-
return /* @__PURE__ */ (0,
|
|
7355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children });
|
|
6972
7356
|
};
|
|
6973
7357
|
var PublicRoute = ({
|
|
6974
7358
|
children,
|
|
@@ -6978,15 +7362,15 @@ var PublicRoute = ({
|
|
|
6978
7362
|
}) => {
|
|
6979
7363
|
const { isAuthenticated, isLoading } = useAuth();
|
|
6980
7364
|
if (checkAuthBeforeRender && isLoading) {
|
|
6981
|
-
return /* @__PURE__ */ (0,
|
|
7365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "text-text-950 text-lg", children: "Carregando..." }) });
|
|
6982
7366
|
}
|
|
6983
7367
|
if (isAuthenticated && redirectIfAuthenticated) {
|
|
6984
|
-
return /* @__PURE__ */ (0,
|
|
7368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_router_dom.Navigate, { to: redirectTo, replace: true });
|
|
6985
7369
|
}
|
|
6986
|
-
return /* @__PURE__ */ (0,
|
|
7370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_jsx_runtime37.Fragment, { children });
|
|
6987
7371
|
};
|
|
6988
7372
|
var withAuth = (Component, options = {}) => {
|
|
6989
|
-
return (props) => /* @__PURE__ */ (0,
|
|
7373
|
+
return (props) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ProtectedRoute, { ...options, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Component, { ...props }) });
|
|
6990
7374
|
};
|
|
6991
7375
|
var useAuthGuard = (options = {}) => {
|
|
6992
7376
|
const authState = useAuth();
|
|
@@ -7001,7 +7385,7 @@ var useAuthGuard = (options = {}) => {
|
|
|
7001
7385
|
var useRouteAuth = (fallbackPath = "/") => {
|
|
7002
7386
|
const { isAuthenticated, isLoading } = useAuth();
|
|
7003
7387
|
const location = (0, import_react_router_dom.useLocation)();
|
|
7004
|
-
const redirectToLogin = () => /* @__PURE__ */ (0,
|
|
7388
|
+
const redirectToLogin = () => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_router_dom.Navigate, { to: fallbackPath, state: { from: location }, replace: true });
|
|
7005
7389
|
return {
|
|
7006
7390
|
isAuthenticated,
|
|
7007
7391
|
isLoading,
|
|
@@ -7065,7 +7449,7 @@ function createZustandAuthAdapter(useAuthStore) {
|
|
|
7065
7449
|
}
|
|
7066
7450
|
|
|
7067
7451
|
// src/components/Auth/useUrlAuthentication.ts
|
|
7068
|
-
var
|
|
7452
|
+
var import_react24 = require("react");
|
|
7069
7453
|
var import_react_router_dom2 = require("react-router-dom");
|
|
7070
7454
|
var getAuthParams = (location, extractParams) => {
|
|
7071
7455
|
const searchParams = new URLSearchParams(location.search);
|
|
@@ -7113,7 +7497,7 @@ var handleUserData = (responseData, setUser) => {
|
|
|
7113
7497
|
};
|
|
7114
7498
|
function useUrlAuthentication(options) {
|
|
7115
7499
|
const location = (0, import_react_router_dom2.useLocation)();
|
|
7116
|
-
(0,
|
|
7500
|
+
(0, import_react24.useEffect)(() => {
|
|
7117
7501
|
const handleAuthentication = async () => {
|
|
7118
7502
|
const authParams = getAuthParams(location, options.extractParams);
|
|
7119
7503
|
if (!hasValidAuthParams(authParams)) {
|
|
@@ -7152,9 +7536,9 @@ function useUrlAuthentication(options) {
|
|
|
7152
7536
|
}
|
|
7153
7537
|
|
|
7154
7538
|
// src/components/Auth/useApiConfig.ts
|
|
7155
|
-
var
|
|
7539
|
+
var import_react25 = require("react");
|
|
7156
7540
|
function useApiConfig(api) {
|
|
7157
|
-
return (0,
|
|
7541
|
+
return (0, import_react25.useMemo)(
|
|
7158
7542
|
() => ({
|
|
7159
7543
|
get: (endpoint, config) => api.get(endpoint, config)
|
|
7160
7544
|
}),
|
|
@@ -7163,8 +7547,8 @@ function useApiConfig(api) {
|
|
|
7163
7547
|
}
|
|
7164
7548
|
|
|
7165
7549
|
// src/components/Quiz/Quiz.tsx
|
|
7166
|
-
var
|
|
7167
|
-
var
|
|
7550
|
+
var import_phosphor_react19 = require("phosphor-react");
|
|
7551
|
+
var import_react26 = require("react");
|
|
7168
7552
|
|
|
7169
7553
|
// src/components/Quiz/useQuizStore.ts
|
|
7170
7554
|
var import_zustand7 = require("zustand");
|
|
@@ -7200,6 +7584,7 @@ var useQuizStore = (0, import_zustand7.create)()(
|
|
|
7200
7584
|
isStarted: false,
|
|
7201
7585
|
isFinished: false,
|
|
7202
7586
|
userId: "",
|
|
7587
|
+
variant: "default",
|
|
7203
7588
|
// Setters
|
|
7204
7589
|
setBySimulated: (simulado) => set({ bySimulated: simulado }),
|
|
7205
7590
|
setByActivity: (atividade) => set({ byActivity: atividade }),
|
|
@@ -7207,6 +7592,7 @@ var useQuizStore = (0, import_zustand7.create)()(
|
|
|
7207
7592
|
setUserId: (userId) => set({ userId }),
|
|
7208
7593
|
setUserAnswers: (userAnswers) => set({ userAnswers }),
|
|
7209
7594
|
getUserId: () => get().userId,
|
|
7595
|
+
setVariant: (variant) => set({ variant }),
|
|
7210
7596
|
// Navigation
|
|
7211
7597
|
goToNextQuestion: () => {
|
|
7212
7598
|
const { currentQuestionIndex, getTotalQuestions } = get();
|
|
@@ -7662,13 +8048,13 @@ var simulated_result_default = "./simulated-result-QN5HCUY5.png";
|
|
|
7662
8048
|
var mock_image_question_default = "./mock-image-question-HEZCLFDL.png";
|
|
7663
8049
|
|
|
7664
8050
|
// src/components/Quiz/Quiz.tsx
|
|
7665
|
-
var
|
|
8051
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
7666
8052
|
var getStatusBadge = (status) => {
|
|
7667
8053
|
switch (status) {
|
|
7668
8054
|
case "correct":
|
|
7669
|
-
return /* @__PURE__ */ (0,
|
|
8055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_phosphor_react19.CheckCircle, {}), children: "Resposta correta" });
|
|
7670
8056
|
case "incorrect":
|
|
7671
|
-
return /* @__PURE__ */ (0,
|
|
8057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_phosphor_react19.XCircle, {}), children: "Resposta incorreta" });
|
|
7672
8058
|
default:
|
|
7673
8059
|
return null;
|
|
7674
8060
|
}
|
|
@@ -7681,8 +8067,12 @@ var getStatusStyles = (variantCorrect) => {
|
|
|
7681
8067
|
return "bg-error-background border-error-300";
|
|
7682
8068
|
}
|
|
7683
8069
|
};
|
|
7684
|
-
var Quiz = (0,
|
|
7685
|
-
|
|
8070
|
+
var Quiz = (0, import_react26.forwardRef)(({ children, className, variant = "default", ...props }, ref) => {
|
|
8071
|
+
const { setVariant } = useQuizStore();
|
|
8072
|
+
(0, import_react26.useEffect)(() => {
|
|
8073
|
+
setVariant(variant);
|
|
8074
|
+
}, [variant, setVariant]);
|
|
8075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7686
8076
|
"div",
|
|
7687
8077
|
{
|
|
7688
8078
|
ref,
|
|
@@ -7695,12 +8085,12 @@ var Quiz = (0, import_react25.forwardRef)(({ children, className, ...props }, re
|
|
|
7695
8085
|
}
|
|
7696
8086
|
);
|
|
7697
8087
|
});
|
|
7698
|
-
var QuizHeaderResult = (0,
|
|
8088
|
+
var QuizHeaderResult = (0, import_react26.forwardRef)(
|
|
7699
8089
|
({ className, ...props }, ref) => {
|
|
7700
8090
|
const { getAllCurrentAnswer } = useQuizStore();
|
|
7701
8091
|
const usersAnswer = getAllCurrentAnswer();
|
|
7702
|
-
const [isCorrect, setIsCorrect] = (0,
|
|
7703
|
-
(0,
|
|
8092
|
+
const [isCorrect, setIsCorrect] = (0, import_react26.useState)(false);
|
|
8093
|
+
(0, import_react26.useEffect)(() => {
|
|
7704
8094
|
if (usersAnswer) {
|
|
7705
8095
|
setIsCorrect(
|
|
7706
8096
|
usersAnswer.length > 0 ? usersAnswer.map(
|
|
@@ -7709,7 +8099,7 @@ var QuizHeaderResult = (0, import_react25.forwardRef)(
|
|
|
7709
8099
|
);
|
|
7710
8100
|
}
|
|
7711
8101
|
}, [usersAnswer]);
|
|
7712
|
-
return /* @__PURE__ */ (0,
|
|
8102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
7713
8103
|
"div",
|
|
7714
8104
|
{
|
|
7715
8105
|
ref,
|
|
@@ -7720,26 +8110,26 @@ var QuizHeaderResult = (0, import_react25.forwardRef)(
|
|
|
7720
8110
|
),
|
|
7721
8111
|
...props,
|
|
7722
8112
|
children: [
|
|
7723
|
-
/* @__PURE__ */ (0,
|
|
7724
|
-
/* @__PURE__ */ (0,
|
|
8113
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-text-950 font-bold text-lg", children: "Resultado" }),
|
|
8114
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-text-700 text-md", children: isCorrect ? "\u{1F389} Parab\xE9ns!!" : "N\xE3o foi dessa vez..." })
|
|
7725
8115
|
]
|
|
7726
8116
|
}
|
|
7727
8117
|
);
|
|
7728
8118
|
}
|
|
7729
8119
|
);
|
|
7730
|
-
var QuizTitle = (0,
|
|
8120
|
+
var QuizTitle = (0, import_react26.forwardRef)(
|
|
7731
8121
|
({ className, ...props }, ref) => {
|
|
7732
8122
|
const {
|
|
7733
8123
|
currentQuestionIndex,
|
|
7734
8124
|
getTotalQuestions,
|
|
7735
8125
|
getQuizTitle,
|
|
7736
8126
|
timeElapsed,
|
|
7737
|
-
formatTime,
|
|
8127
|
+
formatTime: formatTime2,
|
|
7738
8128
|
isStarted
|
|
7739
8129
|
} = useQuizStore();
|
|
7740
8130
|
const totalQuestions = getTotalQuestions();
|
|
7741
8131
|
const quizTitle = getQuizTitle();
|
|
7742
|
-
return /* @__PURE__ */ (0,
|
|
8132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
7743
8133
|
"div",
|
|
7744
8134
|
{
|
|
7745
8135
|
ref,
|
|
@@ -7749,25 +8139,25 @@ var QuizTitle = (0, import_react25.forwardRef)(
|
|
|
7749
8139
|
),
|
|
7750
8140
|
...props,
|
|
7751
8141
|
children: [
|
|
7752
|
-
/* @__PURE__ */ (0,
|
|
7753
|
-
/* @__PURE__ */ (0,
|
|
7754
|
-
/* @__PURE__ */ (0,
|
|
8142
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "flex flex-col gap-2 text-center", children: [
|
|
8143
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
|
|
8144
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
|
|
7755
8145
|
] }),
|
|
7756
|
-
/* @__PURE__ */ (0,
|
|
8146
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "absolute right-2", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Badge_default, { variant: "outlined", action: "info", iconLeft: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_phosphor_react19.Clock, {}), children: isStarted ? formatTime2(timeElapsed) : "00:00" }) })
|
|
7757
8147
|
]
|
|
7758
8148
|
}
|
|
7759
8149
|
);
|
|
7760
8150
|
}
|
|
7761
8151
|
);
|
|
7762
|
-
var QuizSubTitle = (0,
|
|
8152
|
+
var QuizSubTitle = (0, import_react26.forwardRef)(
|
|
7763
8153
|
({ subTitle, ...props }, ref) => {
|
|
7764
|
-
return /* @__PURE__ */ (0,
|
|
8154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "px-4 pb-2 pt-6", ...props, ref, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "font-bold text-lg text-text-950", children: subTitle }) });
|
|
7765
8155
|
}
|
|
7766
8156
|
);
|
|
7767
8157
|
var QuizHeader = () => {
|
|
7768
8158
|
const { getCurrentQuestion, currentQuestionIndex } = useQuizStore();
|
|
7769
8159
|
const currentQuestion = getCurrentQuestion();
|
|
7770
|
-
return /* @__PURE__ */ (0,
|
|
8160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7771
8161
|
HeaderAlternative,
|
|
7772
8162
|
{
|
|
7773
8163
|
title: currentQuestion ? `Quest\xE3o ${currentQuestionIndex + 1}` : "Quest\xE3o",
|
|
@@ -7776,8 +8166,8 @@ var QuizHeader = () => {
|
|
|
7776
8166
|
}
|
|
7777
8167
|
);
|
|
7778
8168
|
};
|
|
7779
|
-
var QuizContainer = (0,
|
|
7780
|
-
return /* @__PURE__ */ (0,
|
|
8169
|
+
var QuizContainer = (0, import_react26.forwardRef)(({ children, className, ...props }, ref) => {
|
|
8170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7781
8171
|
"div",
|
|
7782
8172
|
{
|
|
7783
8173
|
ref,
|
|
@@ -7790,8 +8180,8 @@ var QuizContainer = (0, import_react25.forwardRef)(({ children, className, ...pr
|
|
|
7790
8180
|
}
|
|
7791
8181
|
);
|
|
7792
8182
|
});
|
|
7793
|
-
var QuizContent = (0,
|
|
7794
|
-
const { getCurrentQuestion } = useQuizStore();
|
|
8183
|
+
var QuizContent = (0, import_react26.forwardRef)(({ paddingBottom }) => {
|
|
8184
|
+
const { getCurrentQuestion, variant } = useQuizStore();
|
|
7795
8185
|
const currentQuestion = getCurrentQuestion();
|
|
7796
8186
|
const questionComponents = {
|
|
7797
8187
|
["ALTERNATIVA" /* ALTERNATIVA */]: QuizAlternative,
|
|
@@ -7803,7 +8193,7 @@ var QuizContent = (0, import_react25.forwardRef)(({ variant, paddingBottom }) =>
|
|
|
7803
8193
|
["IMAGEM" /* IMAGEM */]: QuizImageQuestion
|
|
7804
8194
|
};
|
|
7805
8195
|
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.type] : null;
|
|
7806
|
-
return QuestionComponent ? /* @__PURE__ */ (0,
|
|
8196
|
+
return QuestionComponent ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuestionComponent, { variant, paddingBottom }) : null;
|
|
7807
8197
|
});
|
|
7808
8198
|
var QuizAlternative = ({
|
|
7809
8199
|
variant = "default",
|
|
@@ -7831,10 +8221,10 @@ var QuizAlternative = ({
|
|
|
7831
8221
|
};
|
|
7832
8222
|
});
|
|
7833
8223
|
if (!alternatives)
|
|
7834
|
-
return /* @__PURE__ */ (0,
|
|
7835
|
-
return /* @__PURE__ */ (0,
|
|
7836
|
-
/* @__PURE__ */ (0,
|
|
7837
|
-
/* @__PURE__ */ (0,
|
|
8224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: "N\xE3o h\xE1 Alternativas" }) });
|
|
8225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
8226
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
8227
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7838
8228
|
AlternativesList,
|
|
7839
8229
|
{
|
|
7840
8230
|
mode: variant === "default" ? "interactive" : "readonly",
|
|
@@ -7860,15 +8250,15 @@ var QuizMultipleChoice = ({
|
|
|
7860
8250
|
const { getCurrentQuestion, selectMultipleAnswer, getAllCurrentAnswer } = useQuizStore();
|
|
7861
8251
|
const currentQuestion = getCurrentQuestion();
|
|
7862
8252
|
const allCurrentAnswers = getAllCurrentAnswer();
|
|
7863
|
-
const prevSelectedValuesRef = (0,
|
|
7864
|
-
const prevQuestionIdRef = (0,
|
|
7865
|
-
const allCurrentAnswerIds = (0,
|
|
8253
|
+
const prevSelectedValuesRef = (0, import_react26.useRef)([]);
|
|
8254
|
+
const prevQuestionIdRef = (0, import_react26.useRef)("");
|
|
8255
|
+
const allCurrentAnswerIds = (0, import_react26.useMemo)(() => {
|
|
7866
8256
|
return allCurrentAnswers?.map((answer) => answer.optionId) || [];
|
|
7867
8257
|
}, [allCurrentAnswers]);
|
|
7868
|
-
const selectedValues = (0,
|
|
8258
|
+
const selectedValues = (0, import_react26.useMemo)(() => {
|
|
7869
8259
|
return allCurrentAnswerIds?.filter((id) => id !== null) || [];
|
|
7870
8260
|
}, [allCurrentAnswerIds]);
|
|
7871
|
-
const stableSelectedValues = (0,
|
|
8261
|
+
const stableSelectedValues = (0, import_react26.useMemo)(() => {
|
|
7872
8262
|
const currentQuestionId = currentQuestion?.id || "";
|
|
7873
8263
|
const hasQuestionChanged = prevQuestionIdRef.current !== currentQuestionId;
|
|
7874
8264
|
if (hasQuestionChanged) {
|
|
@@ -7883,7 +8273,7 @@ var QuizMultipleChoice = ({
|
|
|
7883
8273
|
}
|
|
7884
8274
|
return prevSelectedValuesRef.current;
|
|
7885
8275
|
}, [selectedValues, currentQuestion?.id]);
|
|
7886
|
-
const handleSelectedValues = (0,
|
|
8276
|
+
const handleSelectedValues = (0, import_react26.useCallback)(
|
|
7887
8277
|
(values) => {
|
|
7888
8278
|
if (currentQuestion) {
|
|
7889
8279
|
selectMultipleAnswer(currentQuestion.id, values);
|
|
@@ -7891,7 +8281,7 @@ var QuizMultipleChoice = ({
|
|
|
7891
8281
|
},
|
|
7892
8282
|
[currentQuestion, selectMultipleAnswer]
|
|
7893
8283
|
);
|
|
7894
|
-
const questionKey = (0,
|
|
8284
|
+
const questionKey = (0, import_react26.useMemo)(
|
|
7895
8285
|
() => `question-${currentQuestion?.id || "1"}`,
|
|
7896
8286
|
[currentQuestion?.id]
|
|
7897
8287
|
);
|
|
@@ -7912,10 +8302,10 @@ var QuizMultipleChoice = ({
|
|
|
7912
8302
|
};
|
|
7913
8303
|
});
|
|
7914
8304
|
if (!choices)
|
|
7915
|
-
return /* @__PURE__ */ (0,
|
|
7916
|
-
return /* @__PURE__ */ (0,
|
|
7917
|
-
/* @__PURE__ */ (0,
|
|
7918
|
-
/* @__PURE__ */ (0,
|
|
8305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: "N\xE3o h\xE1 Escolhas Multiplas" }) });
|
|
8306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
8307
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
8308
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7919
8309
|
MultipleChoiceList,
|
|
7920
8310
|
{
|
|
7921
8311
|
choices,
|
|
@@ -7935,13 +8325,13 @@ var QuizDissertative = ({
|
|
|
7935
8325
|
const { getCurrentQuestion, getCurrentAnswer, selectDissertativeAnswer } = useQuizStore();
|
|
7936
8326
|
const currentQuestion = getCurrentQuestion();
|
|
7937
8327
|
const currentAnswer = getCurrentAnswer();
|
|
7938
|
-
const textareaRef = (0,
|
|
8328
|
+
const textareaRef = (0, import_react26.useRef)(null);
|
|
7939
8329
|
const handleAnswerChange = (value) => {
|
|
7940
8330
|
if (currentQuestion) {
|
|
7941
8331
|
selectDissertativeAnswer(currentQuestion.id, value);
|
|
7942
8332
|
}
|
|
7943
8333
|
};
|
|
7944
|
-
const adjustTextareaHeight = (0,
|
|
8334
|
+
const adjustTextareaHeight = (0, import_react26.useCallback)(() => {
|
|
7945
8335
|
if (textareaRef.current) {
|
|
7946
8336
|
textareaRef.current.style.height = "auto";
|
|
7947
8337
|
const scrollHeight = textareaRef.current.scrollHeight;
|
|
@@ -7951,15 +8341,15 @@ var QuizDissertative = ({
|
|
|
7951
8341
|
textareaRef.current.style.height = `${newHeight}px`;
|
|
7952
8342
|
}
|
|
7953
8343
|
}, []);
|
|
7954
|
-
(0,
|
|
8344
|
+
(0, import_react26.useEffect)(() => {
|
|
7955
8345
|
adjustTextareaHeight();
|
|
7956
8346
|
}, [currentAnswer, adjustTextareaHeight]);
|
|
7957
8347
|
if (!currentQuestion) {
|
|
7958
|
-
return /* @__PURE__ */ (0,
|
|
8348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-text-600 text-md", children: "Nenhuma quest\xE3o dispon\xEDvel" }) });
|
|
7959
8349
|
}
|
|
7960
|
-
return /* @__PURE__ */ (0,
|
|
7961
|
-
/* @__PURE__ */ (0,
|
|
7962
|
-
/* @__PURE__ */ (0,
|
|
8350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
8351
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizSubTitle, { subTitle: "Resposta" }),
|
|
8352
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizContainer, { className: cn(variant != "result" && paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "space-y-4 max-h-[600px] overflow-y-auto", children: variant === "default" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7963
8353
|
TextArea_default,
|
|
7964
8354
|
{
|
|
7965
8355
|
ref: textareaRef,
|
|
@@ -7969,10 +8359,10 @@ var QuizDissertative = ({
|
|
|
7969
8359
|
rows: 4,
|
|
7970
8360
|
className: "min-h-[120px] max-h-[400px] resize-none overflow-y-auto"
|
|
7971
8361
|
}
|
|
7972
|
-
) }) : /* @__PURE__ */ (0,
|
|
7973
|
-
variant === "result" && currentAnswer?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ (0,
|
|
7974
|
-
/* @__PURE__ */ (0,
|
|
7975
|
-
/* @__PURE__ */ (0,
|
|
8362
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: currentAnswer?.answer || "Nenhuma resposta fornecida" }) }) }) }),
|
|
8363
|
+
variant === "result" && currentAnswer?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
8364
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizSubTitle, { subTitle: "Observa\xE7\xE3o do professor" }),
|
|
8365
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Integer euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Nullam ac urna eu felis dapibus condimentum sit amet a augue. Sed non neque elit. Sed ut imperdiet nisi. Proin condimentum fermentum nunc. Etiam pharetra, erat sed fermentum feugiat, velit mauris egestas quam, ut aliquam massa nisl quis neque. Suspendisse in orci enim. Mauris euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Integer euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Nullam ac urna eu felis dapibus condimentum sit amet a augue. Sed non neque elit. Sed ut imperdiet nisi. Proin condimentum fermentum nunc. Etiam pharetra, erat sed fermentum feugiat, velit mauris egestas quam, ut aliquam massa nisl quis neque. Suspendisse in orci enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Integer euismod, urna eu tincidunt consectetur, nisi nisl aliquam nunc, eget aliquam massa nisl quis neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Suspendisse potenti. Nullam ac urna eu felis dapibus condimentum sit amet a augue. Sed non neque elit. Sed ut imperdiet nisi. Proin condimentum fermentum nunc. Etiam pharetra, erat sed fermentum feugiat, velit mauris egestas quam, ut aliquam massa nisl quis neque. Suspendisse in orci enim." }) })
|
|
7976
8366
|
] })
|
|
7977
8367
|
] });
|
|
7978
8368
|
};
|
|
@@ -8000,16 +8390,16 @@ var QuizTrueOrFalse = ({
|
|
|
8000
8390
|
];
|
|
8001
8391
|
const getLetterByIndex = (index) => String.fromCharCode(97 + index);
|
|
8002
8392
|
const isDefaultVariant = variant == "default";
|
|
8003
|
-
return /* @__PURE__ */ (0,
|
|
8004
|
-
/* @__PURE__ */ (0,
|
|
8005
|
-
/* @__PURE__ */ (0,
|
|
8393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
8394
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
8395
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
8006
8396
|
const variantCorrect = option.isCorrect ? "correct" : "incorrect";
|
|
8007
|
-
return /* @__PURE__ */ (0,
|
|
8397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
8008
8398
|
"section",
|
|
8009
8399
|
{
|
|
8010
8400
|
className: "flex flex-col gap-2",
|
|
8011
8401
|
children: [
|
|
8012
|
-
/* @__PURE__ */ (0,
|
|
8402
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
8013
8403
|
"div",
|
|
8014
8404
|
{
|
|
8015
8405
|
className: cn(
|
|
@@ -8017,20 +8407,20 @@ var QuizTrueOrFalse = ({
|
|
|
8017
8407
|
!isDefaultVariant ? getStatusStyles(variantCorrect) : ""
|
|
8018
8408
|
),
|
|
8019
8409
|
children: [
|
|
8020
|
-
/* @__PURE__ */ (0,
|
|
8021
|
-
isDefaultVariant ? /* @__PURE__ */ (0,
|
|
8022
|
-
/* @__PURE__ */ (0,
|
|
8023
|
-
/* @__PURE__ */ (0,
|
|
8024
|
-
/* @__PURE__ */ (0,
|
|
8025
|
-
/* @__PURE__ */ (0,
|
|
8410
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index).concat(") ").concat(option.label) }),
|
|
8411
|
+
isDefaultVariant ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Select_default, { size: "medium", children: [
|
|
8412
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectTrigger, { className: "w-[180px]", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectValue, { placeholder: "Selecione opc\xE3o" }) }),
|
|
8413
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(SelectContent, { children: [
|
|
8414
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectItem, { value: "V", children: "Verdadeiro" }),
|
|
8415
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectItem, { value: "F", children: "Falso" })
|
|
8026
8416
|
] })
|
|
8027
|
-
] }) : /* @__PURE__ */ (0,
|
|
8417
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex-shrink-0", children: getStatusBadge(variantCorrect) })
|
|
8028
8418
|
]
|
|
8029
8419
|
}
|
|
8030
8420
|
),
|
|
8031
|
-
!isDefaultVariant && /* @__PURE__ */ (0,
|
|
8032
|
-
/* @__PURE__ */ (0,
|
|
8033
|
-
!option.isCorrect && /* @__PURE__ */ (0,
|
|
8421
|
+
!isDefaultVariant && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
8422
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-text-800 text-2xs", children: "Resposta selecionada: V" }),
|
|
8423
|
+
!option.isCorrect && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-text-800 text-2xs", children: "Resposta correta: F" })
|
|
8034
8424
|
] })
|
|
8035
8425
|
]
|
|
8036
8426
|
},
|
|
@@ -8093,7 +8483,7 @@ var QuizConnectDots = ({
|
|
|
8093
8483
|
isCorrect: false
|
|
8094
8484
|
}
|
|
8095
8485
|
];
|
|
8096
|
-
const [userAnswers, setUserAnswers] = (0,
|
|
8486
|
+
const [userAnswers, setUserAnswers] = (0, import_react26.useState)(() => {
|
|
8097
8487
|
if (variant === "result") {
|
|
8098
8488
|
return mockUserAnswers;
|
|
8099
8489
|
}
|
|
@@ -8122,13 +8512,13 @@ var QuizConnectDots = ({
|
|
|
8122
8512
|
const assignedDots = new Set(
|
|
8123
8513
|
userAnswers.map((a) => a.dotOption).filter(Boolean)
|
|
8124
8514
|
);
|
|
8125
|
-
return /* @__PURE__ */ (0,
|
|
8126
|
-
/* @__PURE__ */ (0,
|
|
8127
|
-
/* @__PURE__ */ (0,
|
|
8515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
8516
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
8517
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
8128
8518
|
const answer = userAnswers[index];
|
|
8129
8519
|
const variantCorrect = answer.isCorrect ? "correct" : "incorrect";
|
|
8130
|
-
return /* @__PURE__ */ (0,
|
|
8131
|
-
/* @__PURE__ */ (0,
|
|
8520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("section", { className: "flex flex-col gap-2", children: [
|
|
8521
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
8132
8522
|
"div",
|
|
8133
8523
|
{
|
|
8134
8524
|
className: cn(
|
|
@@ -8136,30 +8526,30 @@ var QuizConnectDots = ({
|
|
|
8136
8526
|
!isDefaultVariant ? getStatusStyles(variantCorrect) : ""
|
|
8137
8527
|
),
|
|
8138
8528
|
children: [
|
|
8139
|
-
/* @__PURE__ */ (0,
|
|
8140
|
-
isDefaultVariant ? /* @__PURE__ */ (0,
|
|
8529
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index) + ") " + option.label }),
|
|
8530
|
+
isDefaultVariant ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
8141
8531
|
Select_default,
|
|
8142
8532
|
{
|
|
8143
8533
|
size: "medium",
|
|
8144
8534
|
value: answer.dotOption || void 0,
|
|
8145
8535
|
onValueChange: (value) => handleSelectDot(index, value),
|
|
8146
8536
|
children: [
|
|
8147
|
-
/* @__PURE__ */ (0,
|
|
8148
|
-
/* @__PURE__ */ (0,
|
|
8537
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectTrigger, { className: "w-[180px]", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectValue, { placeholder: "Selecione op\xE7\xE3o" }) }),
|
|
8538
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectContent, { children: dotsOptions.filter(
|
|
8149
8539
|
(dot) => !assignedDots.has(dot.label) || answer.dotOption === dot.label
|
|
8150
|
-
).map((dot) => /* @__PURE__ */ (0,
|
|
8540
|
+
).map((dot) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectItem, { value: dot.label, children: dot.label }, dot.label)) })
|
|
8151
8541
|
]
|
|
8152
8542
|
}
|
|
8153
|
-
) : /* @__PURE__ */ (0,
|
|
8543
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex-shrink-0", children: answer.isCorrect === null ? null : getStatusBadge(variantCorrect) })
|
|
8154
8544
|
]
|
|
8155
8545
|
}
|
|
8156
8546
|
),
|
|
8157
|
-
!isDefaultVariant && /* @__PURE__ */ (0,
|
|
8158
|
-
/* @__PURE__ */ (0,
|
|
8547
|
+
!isDefaultVariant && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
8548
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("p", { className: "text-text-800 text-2xs", children: [
|
|
8159
8549
|
"Resposta selecionada: ",
|
|
8160
8550
|
answer.dotOption || "Nenhuma"
|
|
8161
8551
|
] }),
|
|
8162
|
-
!answer.isCorrect && /* @__PURE__ */ (0,
|
|
8552
|
+
!answer.isCorrect && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("p", { className: "text-text-800 text-2xs", children: [
|
|
8163
8553
|
"Resposta correta: ",
|
|
8164
8554
|
answer.correctOption
|
|
8165
8555
|
] })
|
|
@@ -8214,8 +8604,8 @@ var QuizFill = ({
|
|
|
8214
8604
|
isCorrect: true
|
|
8215
8605
|
}
|
|
8216
8606
|
];
|
|
8217
|
-
const [answers, setAnswers] = (0,
|
|
8218
|
-
const baseId = (0,
|
|
8607
|
+
const [answers, setAnswers] = (0, import_react26.useState)({});
|
|
8608
|
+
const baseId = (0, import_react26.useId)();
|
|
8219
8609
|
const getAvailableOptionsForSelect = (selectId) => {
|
|
8220
8610
|
const usedOptions = Object.entries(answers).filter(([key]) => key !== selectId).map(([, value]) => value);
|
|
8221
8611
|
return options.filter((option) => !usedOptions.includes(option));
|
|
@@ -8228,18 +8618,18 @@ var QuizFill = ({
|
|
|
8228
8618
|
const mockAnswer = mockUserAnswers.find(
|
|
8229
8619
|
(answer) => answer.selectId === selectId
|
|
8230
8620
|
);
|
|
8231
|
-
return /* @__PURE__ */ (0,
|
|
8621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "inline-flex mb-2.5 text-success-600 font-semibold text-md border-b-2 border-success-600", children: mockAnswer?.correctAnswer });
|
|
8232
8622
|
};
|
|
8233
8623
|
const renderDefaultElement = (selectId, startIndex, selectedValue, availableOptionsForThisSelect) => {
|
|
8234
|
-
return /* @__PURE__ */ (0,
|
|
8624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
8235
8625
|
Select_default,
|
|
8236
8626
|
{
|
|
8237
8627
|
value: selectedValue,
|
|
8238
8628
|
onValueChange: (value) => handleSelectChange(selectId, value),
|
|
8239
8629
|
className: "inline-flex mb-2.5",
|
|
8240
8630
|
children: [
|
|
8241
|
-
/* @__PURE__ */ (0,
|
|
8242
|
-
/* @__PURE__ */ (0,
|
|
8631
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectTrigger, { className: "inline-flex w-auto min-w-[140px] h-8 mx-1 bg-white border-gray-300", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectValue, { placeholder: "Selecione op\xE7\xE3o" }) }),
|
|
8632
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectContent, { children: availableOptionsForThisSelect.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectItem, { value: option, children: option }, `${option}-${index}`)) })
|
|
8243
8633
|
]
|
|
8244
8634
|
},
|
|
8245
8635
|
`${selectId}-${startIndex}`
|
|
@@ -8251,8 +8641,8 @@ var QuizFill = ({
|
|
|
8251
8641
|
);
|
|
8252
8642
|
if (!mockAnswer) return null;
|
|
8253
8643
|
const action = mockAnswer.isCorrect ? "success" : "error";
|
|
8254
|
-
const icon = mockAnswer.isCorrect ? /* @__PURE__ */ (0,
|
|
8255
|
-
return /* @__PURE__ */ (0,
|
|
8644
|
+
const icon = mockAnswer.isCorrect ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_phosphor_react19.CheckCircle, {}) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_phosphor_react19.XCircle, {});
|
|
8645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8256
8646
|
Badge_default,
|
|
8257
8647
|
{
|
|
8258
8648
|
variant: "solid",
|
|
@@ -8260,7 +8650,7 @@ var QuizFill = ({
|
|
|
8260
8650
|
iconRight: icon,
|
|
8261
8651
|
size: "large",
|
|
8262
8652
|
className: "py-3 w-[180px] justify-between mb-2.5",
|
|
8263
|
-
children: /* @__PURE__ */ (0,
|
|
8653
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-text-900", children: mockAnswer.userAnswer })
|
|
8264
8654
|
},
|
|
8265
8655
|
selectId
|
|
8266
8656
|
);
|
|
@@ -8316,25 +8706,25 @@ var QuizFill = ({
|
|
|
8316
8706
|
}
|
|
8317
8707
|
return elements;
|
|
8318
8708
|
};
|
|
8319
|
-
return /* @__PURE__ */ (0,
|
|
8320
|
-
/* @__PURE__ */ (0,
|
|
8321
|
-
/* @__PURE__ */ (0,
|
|
8709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
8710
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
8711
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizContainer, { className: "h-auto pb-0", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "space-y-6 px-4 h-auto", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8322
8712
|
"div",
|
|
8323
8713
|
{
|
|
8324
8714
|
className: cn(
|
|
8325
8715
|
"text-lg text-text-900 leading-8 h-auto",
|
|
8326
8716
|
variant != "result" && paddingBottom
|
|
8327
8717
|
),
|
|
8328
|
-
children: renderTextWithSelects(exampleText).map((element) => /* @__PURE__ */ (0,
|
|
8718
|
+
children: renderTextWithSelects(exampleText).map((element) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: element.element }, element.id))
|
|
8329
8719
|
}
|
|
8330
8720
|
) }) }),
|
|
8331
|
-
variant === "result" && /* @__PURE__ */ (0,
|
|
8332
|
-
/* @__PURE__ */ (0,
|
|
8333
|
-
/* @__PURE__ */ (0,
|
|
8721
|
+
variant === "result" && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
8722
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizSubTitle, { subTitle: "Resultado" }),
|
|
8723
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizContainer, { className: "h-auto pb-0", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "space-y-6 px-4", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8334
8724
|
"div",
|
|
8335
8725
|
{
|
|
8336
8726
|
className: cn("text-lg text-text-900 leading-8", paddingBottom),
|
|
8337
|
-
children: renderTextWithSelects(exampleText, true).map((element) => /* @__PURE__ */ (0,
|
|
8727
|
+
children: renderTextWithSelects(exampleText, true).map((element) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { children: element.element }, element.id))
|
|
8338
8728
|
}
|
|
8339
8729
|
) }) })
|
|
8340
8730
|
] })
|
|
@@ -8354,7 +8744,7 @@ var QuizImageQuestion = ({
|
|
|
8354
8744
|
};
|
|
8355
8745
|
const correctRadiusRelative = calculateCorrectRadiusRelative();
|
|
8356
8746
|
const mockUserAnswerRelative = { x: 0.72, y: 0.348 };
|
|
8357
|
-
const [clickPositionRelative, setClickPositionRelative] = (0,
|
|
8747
|
+
const [clickPositionRelative, setClickPositionRelative] = (0, import_react26.useState)(variant == "result" ? mockUserAnswerRelative : null);
|
|
8358
8748
|
const convertToRelativeCoordinates = (x, y, rect) => {
|
|
8359
8749
|
const safeWidth = Math.max(rect.width, 1e-3);
|
|
8360
8750
|
const safeHeight = Math.max(rect.height, 1e-3);
|
|
@@ -8390,36 +8780,36 @@ var QuizImageQuestion = ({
|
|
|
8390
8780
|
}
|
|
8391
8781
|
return "bg-success-600/70 border-white";
|
|
8392
8782
|
};
|
|
8393
|
-
return /* @__PURE__ */ (0,
|
|
8394
|
-
/* @__PURE__ */ (0,
|
|
8395
|
-
/* @__PURE__ */ (0,
|
|
8783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
8784
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizSubTitle, { subTitle: "Clique na \xE1rea correta" }),
|
|
8785
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
8396
8786
|
"div",
|
|
8397
8787
|
{
|
|
8398
8788
|
"data-testid": "quiz-image-container",
|
|
8399
8789
|
className: "space-y-6 p-3 relative inline-block",
|
|
8400
8790
|
children: [
|
|
8401
|
-
variant == "result" && /* @__PURE__ */ (0,
|
|
8791
|
+
variant == "result" && /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
8402
8792
|
"div",
|
|
8403
8793
|
{
|
|
8404
8794
|
"data-testid": "quiz-legend",
|
|
8405
8795
|
className: "flex items-center gap-4 text-xs",
|
|
8406
8796
|
children: [
|
|
8407
|
-
/* @__PURE__ */ (0,
|
|
8408
|
-
/* @__PURE__ */ (0,
|
|
8409
|
-
/* @__PURE__ */ (0,
|
|
8797
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
8798
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "w-3 h-3 rounded-full bg-indicator-primary/70 border border-[#F8CC2E]" }),
|
|
8799
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-text-600 font-medium text-sm", children: "\xC1rea correta" })
|
|
8410
8800
|
] }),
|
|
8411
|
-
/* @__PURE__ */ (0,
|
|
8412
|
-
/* @__PURE__ */ (0,
|
|
8413
|
-
/* @__PURE__ */ (0,
|
|
8801
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
8802
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "w-3 h-3 rounded-full bg-success-600/70 border border-white" }),
|
|
8803
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-text-600 font-medium text-sm", children: "Resposta correta" })
|
|
8414
8804
|
] }),
|
|
8415
|
-
/* @__PURE__ */ (0,
|
|
8416
|
-
/* @__PURE__ */ (0,
|
|
8417
|
-
/* @__PURE__ */ (0,
|
|
8805
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
8806
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "w-3 h-3 rounded-full bg-indicator-error/70 border border-white" }),
|
|
8807
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-text-600 font-medium text-sm", children: "Resposta incorreta" })
|
|
8418
8808
|
] })
|
|
8419
8809
|
]
|
|
8420
8810
|
}
|
|
8421
8811
|
),
|
|
8422
|
-
/* @__PURE__ */ (0,
|
|
8812
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
8423
8813
|
"button",
|
|
8424
8814
|
{
|
|
8425
8815
|
"data-testid": "quiz-image-button",
|
|
@@ -8434,7 +8824,7 @@ var QuizImageQuestion = ({
|
|
|
8434
8824
|
},
|
|
8435
8825
|
"aria-label": "\xC1rea da imagem interativa",
|
|
8436
8826
|
children: [
|
|
8437
|
-
/* @__PURE__ */ (0,
|
|
8827
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8438
8828
|
"img",
|
|
8439
8829
|
{
|
|
8440
8830
|
"data-testid": "quiz-image",
|
|
@@ -8443,7 +8833,7 @@ var QuizImageQuestion = ({
|
|
|
8443
8833
|
className: "w-full h-auto rounded-md"
|
|
8444
8834
|
}
|
|
8445
8835
|
),
|
|
8446
|
-
variant === "result" && /* @__PURE__ */ (0,
|
|
8836
|
+
variant === "result" && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8447
8837
|
"div",
|
|
8448
8838
|
{
|
|
8449
8839
|
"data-testid": "quiz-correct-circle",
|
|
@@ -8458,7 +8848,7 @@ var QuizImageQuestion = ({
|
|
|
8458
8848
|
}
|
|
8459
8849
|
}
|
|
8460
8850
|
),
|
|
8461
|
-
clickPositionRelative && /* @__PURE__ */ (0,
|
|
8851
|
+
clickPositionRelative && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8462
8852
|
"div",
|
|
8463
8853
|
{
|
|
8464
8854
|
"data-testid": "quiz-user-circle",
|
|
@@ -8526,16 +8916,16 @@ var QuizQuestionList = ({
|
|
|
8526
8916
|
return "Em branco";
|
|
8527
8917
|
}
|
|
8528
8918
|
};
|
|
8529
|
-
return /* @__PURE__ */ (0,
|
|
8530
|
-
([subjectId, questions]) => /* @__PURE__ */ (0,
|
|
8531
|
-
/* @__PURE__ */ (0,
|
|
8532
|
-
/* @__PURE__ */ (0,
|
|
8533
|
-
/* @__PURE__ */ (0,
|
|
8919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "space-y-6 px-4", children: Object.entries(filteredGroupedQuestions).map(
|
|
8920
|
+
([subjectId, questions]) => /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("section", { className: "flex flex-col gap-2", children: [
|
|
8921
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { className: "pt-6 pb-4 flex flex-row gap-2", children: [
|
|
8922
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "bg-primary-500 p-1 rounded-sm flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_phosphor_react19.BookOpen, { size: 17, className: "text-white" }) }),
|
|
8923
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-text-800 font-bold text-lg", children: subjectId })
|
|
8534
8924
|
] }),
|
|
8535
|
-
/* @__PURE__ */ (0,
|
|
8925
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("ul", { className: "flex flex-col gap-2", children: questions.map((question) => {
|
|
8536
8926
|
const status = getQuestionStatus(question.id);
|
|
8537
8927
|
const questionNumber = getQuestionIndex(question.id);
|
|
8538
|
-
return /* @__PURE__ */ (0,
|
|
8928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8539
8929
|
CardStatus,
|
|
8540
8930
|
{
|
|
8541
8931
|
header: `Quest\xE3o ${questionNumber.toString().padStart(2, "0")}`,
|
|
@@ -8551,13 +8941,12 @@ var QuizQuestionList = ({
|
|
|
8551
8941
|
] }, subjectId)
|
|
8552
8942
|
) });
|
|
8553
8943
|
};
|
|
8554
|
-
var QuizFooter = (0,
|
|
8944
|
+
var QuizFooter = (0, import_react26.forwardRef)(
|
|
8555
8945
|
({
|
|
8556
8946
|
className,
|
|
8557
8947
|
onGoToSimulated,
|
|
8558
8948
|
onDetailResult,
|
|
8559
8949
|
handleFinishSimulated,
|
|
8560
|
-
variant = "default",
|
|
8561
8950
|
...props
|
|
8562
8951
|
}, ref) => {
|
|
8563
8952
|
const {
|
|
@@ -8571,6 +8960,7 @@ var QuizFooter = (0, import_react25.forwardRef)(
|
|
|
8571
8960
|
skipQuestion,
|
|
8572
8961
|
getCurrentQuestion,
|
|
8573
8962
|
getQuestionStatusFromUserAnswers,
|
|
8963
|
+
variant,
|
|
8574
8964
|
getActiveQuiz
|
|
8575
8965
|
} = useQuizStore();
|
|
8576
8966
|
const totalQuestions = getTotalQuestions();
|
|
@@ -8579,10 +8969,11 @@ var QuizFooter = (0, import_react25.forwardRef)(
|
|
|
8579
8969
|
const currentAnswer = getCurrentAnswer();
|
|
8580
8970
|
const currentQuestion = getCurrentQuestion();
|
|
8581
8971
|
const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false;
|
|
8582
|
-
const [alertDialogOpen, setAlertDialogOpen] = (0,
|
|
8583
|
-
const [modalResultOpen, setModalResultOpen] = (0,
|
|
8584
|
-
const [modalNavigateOpen, setModalNavigateOpen] = (0,
|
|
8585
|
-
const [
|
|
8972
|
+
const [alertDialogOpen, setAlertDialogOpen] = (0, import_react26.useState)(false);
|
|
8973
|
+
const [modalResultOpen, setModalResultOpen] = (0, import_react26.useState)(false);
|
|
8974
|
+
const [modalNavigateOpen, setModalNavigateOpen] = (0, import_react26.useState)(false);
|
|
8975
|
+
const [modalResolutionOpen, setModalResolutionOpen] = (0, import_react26.useState)(false);
|
|
8976
|
+
const [filterType, setFilterType] = (0, import_react26.useState)("all");
|
|
8586
8977
|
const unansweredQuestions = getUnansweredQuestionsFromUserAnswers();
|
|
8587
8978
|
const userAnswers = getUserAnswers();
|
|
8588
8979
|
const allQuestions = getTotalQuestions();
|
|
@@ -8614,8 +9005,8 @@ var QuizFooter = (0, import_react25.forwardRef)(
|
|
|
8614
9005
|
setAlertDialogOpen(false);
|
|
8615
9006
|
}
|
|
8616
9007
|
};
|
|
8617
|
-
return /* @__PURE__ */ (0,
|
|
8618
|
-
/* @__PURE__ */ (0,
|
|
9008
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
9009
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8619
9010
|
"footer",
|
|
8620
9011
|
{
|
|
8621
9012
|
ref,
|
|
@@ -8624,17 +9015,17 @@ var QuizFooter = (0, import_react25.forwardRef)(
|
|
|
8624
9015
|
className
|
|
8625
9016
|
),
|
|
8626
9017
|
...props,
|
|
8627
|
-
children: variant === "default" ? /* @__PURE__ */ (0,
|
|
8628
|
-
/* @__PURE__ */ (0,
|
|
8629
|
-
/* @__PURE__ */ (0,
|
|
9018
|
+
children: variant === "default" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
9019
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-row items-center gap-1", children: [
|
|
9020
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8630
9021
|
IconButton_default,
|
|
8631
9022
|
{
|
|
8632
|
-
icon: /* @__PURE__ */ (0,
|
|
9023
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_phosphor_react19.SquaresFour, { size: 24, className: "text-text-950" }),
|
|
8633
9024
|
size: "md",
|
|
8634
9025
|
onClick: () => setModalNavigateOpen(true)
|
|
8635
9026
|
}
|
|
8636
9027
|
),
|
|
8637
|
-
isFirstQuestion ? /* @__PURE__ */ (0,
|
|
9028
|
+
isFirstQuestion ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8638
9029
|
Button_default,
|
|
8639
9030
|
{
|
|
8640
9031
|
variant: "outline",
|
|
@@ -8645,13 +9036,13 @@ var QuizFooter = (0, import_react25.forwardRef)(
|
|
|
8645
9036
|
},
|
|
8646
9037
|
children: "Pular"
|
|
8647
9038
|
}
|
|
8648
|
-
) : /* @__PURE__ */ (0,
|
|
9039
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8649
9040
|
Button_default,
|
|
8650
9041
|
{
|
|
8651
9042
|
size: "medium",
|
|
8652
9043
|
variant: "link",
|
|
8653
9044
|
action: "primary",
|
|
8654
|
-
iconLeft: /* @__PURE__ */ (0,
|
|
9045
|
+
iconLeft: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_phosphor_react19.CaretLeft, { size: 18 }),
|
|
8655
9046
|
onClick: () => {
|
|
8656
9047
|
goToPreviousQuestion();
|
|
8657
9048
|
},
|
|
@@ -8659,7 +9050,7 @@ var QuizFooter = (0, import_react25.forwardRef)(
|
|
|
8659
9050
|
}
|
|
8660
9051
|
)
|
|
8661
9052
|
] }),
|
|
8662
|
-
!isFirstQuestion && /* @__PURE__ */ (0,
|
|
9053
|
+
!isFirstQuestion && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8663
9054
|
Button_default,
|
|
8664
9055
|
{
|
|
8665
9056
|
size: "small",
|
|
@@ -8672,7 +9063,7 @@ var QuizFooter = (0, import_react25.forwardRef)(
|
|
|
8672
9063
|
children: "Pular"
|
|
8673
9064
|
}
|
|
8674
9065
|
),
|
|
8675
|
-
isLastQuestion ? /* @__PURE__ */ (0,
|
|
9066
|
+
isLastQuestion ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8676
9067
|
Button_default,
|
|
8677
9068
|
{
|
|
8678
9069
|
size: "medium",
|
|
@@ -8682,13 +9073,13 @@ var QuizFooter = (0, import_react25.forwardRef)(
|
|
|
8682
9073
|
onClick: handleFinishQuiz,
|
|
8683
9074
|
children: "Finalizar"
|
|
8684
9075
|
}
|
|
8685
|
-
) : /* @__PURE__ */ (0,
|
|
9076
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8686
9077
|
Button_default,
|
|
8687
9078
|
{
|
|
8688
9079
|
size: "medium",
|
|
8689
9080
|
variant: "link",
|
|
8690
9081
|
action: "primary",
|
|
8691
|
-
iconRight: /* @__PURE__ */ (0,
|
|
9082
|
+
iconRight: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_phosphor_react19.CaretRight, { size: 18 }),
|
|
8692
9083
|
disabled: !currentAnswer && !isCurrentQuestionSkipped,
|
|
8693
9084
|
onClick: () => {
|
|
8694
9085
|
goToNextQuestion();
|
|
@@ -8696,10 +9087,19 @@ var QuizFooter = (0, import_react25.forwardRef)(
|
|
|
8696
9087
|
children: "Avan\xE7ar"
|
|
8697
9088
|
}
|
|
8698
9089
|
)
|
|
8699
|
-
] }) : /* @__PURE__ */ (0,
|
|
9090
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex flex-row items-center justify-end w-full", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
9091
|
+
Button_default,
|
|
9092
|
+
{
|
|
9093
|
+
variant: "solid",
|
|
9094
|
+
action: "primary",
|
|
9095
|
+
size: "medium",
|
|
9096
|
+
onClick: () => setModalResolutionOpen(true),
|
|
9097
|
+
children: "Ver Resolu\xE7\xE3o"
|
|
9098
|
+
}
|
|
9099
|
+
) })
|
|
8700
9100
|
}
|
|
8701
9101
|
),
|
|
8702
|
-
/* @__PURE__ */ (0,
|
|
9102
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8703
9103
|
AlertDialog,
|
|
8704
9104
|
{
|
|
8705
9105
|
isOpen: alertDialogOpen,
|
|
@@ -8711,7 +9111,7 @@ var QuizFooter = (0, import_react25.forwardRef)(
|
|
|
8711
9111
|
onSubmit: handleAlertSubmit
|
|
8712
9112
|
}
|
|
8713
9113
|
),
|
|
8714
|
-
/* @__PURE__ */ (0,
|
|
9114
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8715
9115
|
Modal_default,
|
|
8716
9116
|
{
|
|
8717
9117
|
isOpen: modalResultOpen,
|
|
@@ -8721,8 +9121,8 @@ var QuizFooter = (0, import_react25.forwardRef)(
|
|
|
8721
9121
|
closeOnEscape: false,
|
|
8722
9122
|
hideCloseButton: true,
|
|
8723
9123
|
size: "md",
|
|
8724
|
-
children: /* @__PURE__ */ (0,
|
|
8725
|
-
/* @__PURE__ */ (0,
|
|
9124
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
9125
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8726
9126
|
"img",
|
|
8727
9127
|
{
|
|
8728
9128
|
src: simulated_result_default,
|
|
@@ -8730,9 +9130,9 @@ var QuizFooter = (0, import_react25.forwardRef)(
|
|
|
8730
9130
|
className: "w-[282px] h-auto object-cover"
|
|
8731
9131
|
}
|
|
8732
9132
|
),
|
|
8733
|
-
/* @__PURE__ */ (0,
|
|
8734
|
-
/* @__PURE__ */ (0,
|
|
8735
|
-
/* @__PURE__ */ (0,
|
|
9133
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
9134
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h2", { className: "text-text-950 font-bold text-lg", children: "Voc\xEA concluiu o simulado!" }),
|
|
9135
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("p", { className: "text-text-500 font-sm", children: [
|
|
8736
9136
|
"Voc\xEA acertou",
|
|
8737
9137
|
" ",
|
|
8738
9138
|
(() => {
|
|
@@ -8754,8 +9154,8 @@ var QuizFooter = (0, import_react25.forwardRef)(
|
|
|
8754
9154
|
" quest\xF5es."
|
|
8755
9155
|
] })
|
|
8756
9156
|
] }),
|
|
8757
|
-
/* @__PURE__ */ (0,
|
|
8758
|
-
/* @__PURE__ */ (0,
|
|
9157
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: [
|
|
9158
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8759
9159
|
Button_default,
|
|
8760
9160
|
{
|
|
8761
9161
|
variant: "outline",
|
|
@@ -8765,31 +9165,31 @@ var QuizFooter = (0, import_react25.forwardRef)(
|
|
|
8765
9165
|
children: "Ir para simulados"
|
|
8766
9166
|
}
|
|
8767
9167
|
),
|
|
8768
|
-
/* @__PURE__ */ (0,
|
|
9168
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Button_default, { className: "w-full", onClick: onDetailResult, children: "Detalhar resultado" })
|
|
8769
9169
|
] })
|
|
8770
9170
|
] })
|
|
8771
9171
|
}
|
|
8772
9172
|
),
|
|
8773
|
-
/* @__PURE__ */ (0,
|
|
9173
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8774
9174
|
Modal_default,
|
|
8775
9175
|
{
|
|
8776
9176
|
isOpen: modalNavigateOpen,
|
|
8777
9177
|
onClose: () => setModalNavigateOpen(false),
|
|
8778
9178
|
title: "Quest\xF5es",
|
|
8779
9179
|
size: "lg",
|
|
8780
|
-
children: /* @__PURE__ */ (0,
|
|
8781
|
-
/* @__PURE__ */ (0,
|
|
8782
|
-
/* @__PURE__ */ (0,
|
|
8783
|
-
/* @__PURE__ */ (0,
|
|
8784
|
-
/* @__PURE__ */ (0,
|
|
8785
|
-
/* @__PURE__ */ (0,
|
|
8786
|
-
/* @__PURE__ */ (0,
|
|
8787
|
-
/* @__PURE__ */ (0,
|
|
8788
|
-
/* @__PURE__ */ (0,
|
|
9180
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-col w-full h-full", children: [
|
|
9181
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-row justify-between items-center py-6 pt-6 pb-4 border-b border-border-200", children: [
|
|
9182
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-text-950 font-bold text-lg", children: "Filtrar por" }),
|
|
9183
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "max-w-[266px]", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Select_default, { value: filterType, onValueChange: setFilterType, children: [
|
|
9184
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectTrigger, { variant: "rounded", className: "max-w-[266px]", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectValue, { placeholder: "Selecione uma op\xE7\xE3o" }) }),
|
|
9185
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(SelectContent, { children: [
|
|
9186
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectItem, { value: "all", children: "Todas" }),
|
|
9187
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectItem, { value: "unanswered", children: "Em branco" }),
|
|
9188
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectItem, { value: "answered", children: "Respondidas" })
|
|
8789
9189
|
] })
|
|
8790
9190
|
] }) })
|
|
8791
9191
|
] }),
|
|
8792
|
-
/* @__PURE__ */ (0,
|
|
9192
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex flex-col gap-2 not-lg:h-[calc(100vh-200px)] lg:max-h-[687px] overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8793
9193
|
QuizQuestionList,
|
|
8794
9194
|
{
|
|
8795
9195
|
filterType,
|
|
@@ -8798,29 +9198,39 @@ var QuizFooter = (0, import_react25.forwardRef)(
|
|
|
8798
9198
|
) })
|
|
8799
9199
|
] })
|
|
8800
9200
|
}
|
|
9201
|
+
),
|
|
9202
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
9203
|
+
Modal_default,
|
|
9204
|
+
{
|
|
9205
|
+
isOpen: modalResolutionOpen,
|
|
9206
|
+
onClose: () => setModalResolutionOpen(false),
|
|
9207
|
+
title: "Resolu\xE7\xE3o",
|
|
9208
|
+
size: "lg",
|
|
9209
|
+
children: currentQuestion?.answerKey
|
|
9210
|
+
}
|
|
8801
9211
|
)
|
|
8802
9212
|
] });
|
|
8803
9213
|
}
|
|
8804
9214
|
);
|
|
8805
|
-
var QuizResultHeaderTitle = (0,
|
|
9215
|
+
var QuizResultHeaderTitle = (0, import_react26.forwardRef)(({ className, ...props }, ref) => {
|
|
8806
9216
|
const { bySimulated } = useQuizStore();
|
|
8807
|
-
return /* @__PURE__ */ (0,
|
|
9217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
8808
9218
|
"div",
|
|
8809
9219
|
{
|
|
8810
9220
|
ref,
|
|
8811
9221
|
className: cn("flex flex-row pt-4 justify-between", className),
|
|
8812
9222
|
...props,
|
|
8813
9223
|
children: [
|
|
8814
|
-
/* @__PURE__ */ (0,
|
|
8815
|
-
bySimulated && /* @__PURE__ */ (0,
|
|
9224
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: "Resultado" }),
|
|
9225
|
+
bySimulated && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Badge_default, { variant: "solid", action: "info", children: bySimulated.category })
|
|
8816
9226
|
]
|
|
8817
9227
|
}
|
|
8818
9228
|
);
|
|
8819
9229
|
});
|
|
8820
|
-
var QuizResultTitle = (0,
|
|
9230
|
+
var QuizResultTitle = (0, import_react26.forwardRef)(({ className, ...props }, ref) => {
|
|
8821
9231
|
const { getQuizTitle } = useQuizStore();
|
|
8822
9232
|
const quizTitle = getQuizTitle();
|
|
8823
|
-
return /* @__PURE__ */ (0,
|
|
9233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8824
9234
|
"p",
|
|
8825
9235
|
{
|
|
8826
9236
|
className: cn("pt-6 pb-4 text-text-950 font-bold text-lg", className),
|
|
@@ -8830,12 +9240,12 @@ var QuizResultTitle = (0, import_react25.forwardRef)(({ className, ...props }, r
|
|
|
8830
9240
|
}
|
|
8831
9241
|
);
|
|
8832
9242
|
});
|
|
8833
|
-
var QuizResultPerformance = (0,
|
|
9243
|
+
var QuizResultPerformance = (0, import_react26.forwardRef)(
|
|
8834
9244
|
({ ...props }, ref) => {
|
|
8835
9245
|
const {
|
|
8836
9246
|
getTotalQuestions,
|
|
8837
9247
|
timeElapsed,
|
|
8838
|
-
formatTime,
|
|
9248
|
+
formatTime: formatTime2,
|
|
8839
9249
|
bySimulated,
|
|
8840
9250
|
byActivity,
|
|
8841
9251
|
byQuestionary,
|
|
@@ -8876,15 +9286,15 @@ var QuizResultPerformance = (0, import_react25.forwardRef)(
|
|
|
8876
9286
|
});
|
|
8877
9287
|
}
|
|
8878
9288
|
const percentage = totalQuestions > 0 ? Math.round(correctAnswers / totalQuestions * 100) : 0;
|
|
8879
|
-
return /* @__PURE__ */ (0,
|
|
9289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
8880
9290
|
"div",
|
|
8881
9291
|
{
|
|
8882
9292
|
className: "flex flex-row gap-6 p-6 rounded-xl bg-background justify-between",
|
|
8883
9293
|
ref,
|
|
8884
9294
|
...props,
|
|
8885
9295
|
children: [
|
|
8886
|
-
/* @__PURE__ */ (0,
|
|
8887
|
-
/* @__PURE__ */ (0,
|
|
9296
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "relative", children: [
|
|
9297
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8888
9298
|
ProgressCircle_default,
|
|
8889
9299
|
{
|
|
8890
9300
|
size: "medium",
|
|
@@ -8894,21 +9304,21 @@ var QuizResultPerformance = (0, import_react25.forwardRef)(
|
|
|
8894
9304
|
label: ""
|
|
8895
9305
|
}
|
|
8896
9306
|
),
|
|
8897
|
-
/* @__PURE__ */ (0,
|
|
8898
|
-
/* @__PURE__ */ (0,
|
|
8899
|
-
/* @__PURE__ */ (0,
|
|
8900
|
-
/* @__PURE__ */ (0,
|
|
9307
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
9308
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex items-center gap-1 mb-1", children: [
|
|
9309
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_phosphor_react19.Clock, { size: 12, weight: "regular", className: "text-text-800" }),
|
|
9310
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "text-2xs font-medium text-text-800", children: formatTime2(timeElapsed) })
|
|
8901
9311
|
] }),
|
|
8902
|
-
/* @__PURE__ */ (0,
|
|
9312
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "text-2xl font-medium text-text-800 leading-7", children: [
|
|
8903
9313
|
correctAnswers,
|
|
8904
9314
|
" de ",
|
|
8905
9315
|
totalQuestions
|
|
8906
9316
|
] }),
|
|
8907
|
-
/* @__PURE__ */ (0,
|
|
9317
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "text-2xs font-medium text-text-600 mt-1", children: "Corretas" })
|
|
8908
9318
|
] })
|
|
8909
9319
|
] }),
|
|
8910
|
-
/* @__PURE__ */ (0,
|
|
8911
|
-
/* @__PURE__ */ (0,
|
|
9320
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-col gap-4 w-full", children: [
|
|
9321
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8912
9322
|
ProgressBar_default,
|
|
8913
9323
|
{
|
|
8914
9324
|
className: "w-full",
|
|
@@ -8922,7 +9332,7 @@ var QuizResultPerformance = (0, import_react25.forwardRef)(
|
|
|
8922
9332
|
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
8923
9333
|
}
|
|
8924
9334
|
),
|
|
8925
|
-
/* @__PURE__ */ (0,
|
|
9335
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8926
9336
|
ProgressBar_default,
|
|
8927
9337
|
{
|
|
8928
9338
|
className: "w-full",
|
|
@@ -8936,7 +9346,7 @@ var QuizResultPerformance = (0, import_react25.forwardRef)(
|
|
|
8936
9346
|
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
8937
9347
|
}
|
|
8938
9348
|
),
|
|
8939
|
-
/* @__PURE__ */ (0,
|
|
9349
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8940
9350
|
ProgressBar_default,
|
|
8941
9351
|
{
|
|
8942
9352
|
className: "w-full",
|
|
@@ -8956,7 +9366,7 @@ var QuizResultPerformance = (0, import_react25.forwardRef)(
|
|
|
8956
9366
|
);
|
|
8957
9367
|
}
|
|
8958
9368
|
);
|
|
8959
|
-
var QuizListResult = (0,
|
|
9369
|
+
var QuizListResult = (0, import_react26.forwardRef)(({ className, onSubjectClick, ...props }, ref) => {
|
|
8960
9370
|
const {
|
|
8961
9371
|
getQuestionsGroupedBySubject,
|
|
8962
9372
|
isQuestionAnswered,
|
|
@@ -8985,9 +9395,9 @@ var QuizListResult = (0, import_react25.forwardRef)(({ className, onSubjectClick
|
|
|
8985
9395
|
};
|
|
8986
9396
|
}
|
|
8987
9397
|
);
|
|
8988
|
-
return /* @__PURE__ */ (0,
|
|
8989
|
-
/* @__PURE__ */ (0,
|
|
8990
|
-
/* @__PURE__ */ (0,
|
|
9398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("section", { ref, className, ...props, children: [
|
|
9399
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Mat\xE9rias" }),
|
|
9400
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("ul", { className: "flex flex-col gap-2", children: subjectsStats.map((subject) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8991
9401
|
CardResults,
|
|
8992
9402
|
{
|
|
8993
9403
|
onClick: () => onSubjectClick?.(subject.subject),
|
|
@@ -8995,7 +9405,7 @@ var QuizListResult = (0, import_react25.forwardRef)(({ className, onSubjectClick
|
|
|
8995
9405
|
header: subject.subject,
|
|
8996
9406
|
correct_answers: subject.correct,
|
|
8997
9407
|
incorrect_answers: subject.incorrect,
|
|
8998
|
-
icon: /* @__PURE__ */ (0,
|
|
9408
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_phosphor_react19.Book, { size: 20 }),
|
|
8999
9409
|
direction: "row"
|
|
9000
9410
|
}
|
|
9001
9411
|
) }, subject.subject)) })
|
|
@@ -9012,13 +9422,13 @@ var QuizListResultByMateria = ({
|
|
|
9012
9422
|
} = useQuizStore();
|
|
9013
9423
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
9014
9424
|
const answeredQuestions = groupedQuestions[subject] || [];
|
|
9015
|
-
return /* @__PURE__ */ (0,
|
|
9016
|
-
/* @__PURE__ */ (0,
|
|
9017
|
-
/* @__PURE__ */ (0,
|
|
9018
|
-
/* @__PURE__ */ (0,
|
|
9019
|
-
/* @__PURE__ */ (0,
|
|
9425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "w-full max-w-[1000px] flex flex-col mx-auto h-full relative not-lg:px-6", children: [
|
|
9426
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex flex-row pt-4 justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "text-text-950 font-bold text-2xl", children: subject }) }),
|
|
9427
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("section", { className: "flex flex-col ", children: [
|
|
9428
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Resultado das quest\xF5es" }),
|
|
9429
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("ul", { className: "flex flex-col gap-2 pt-4", children: answeredQuestions.map((question) => {
|
|
9020
9430
|
const questionIndex = getQuestionIndex(question.id);
|
|
9021
|
-
return /* @__PURE__ */ (0,
|
|
9431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
9022
9432
|
CardStatus,
|
|
9023
9433
|
{
|
|
9024
9434
|
className: "max-w-full",
|
|
@@ -9045,7 +9455,6 @@ var QuizListResultByMateria = ({
|
|
|
9045
9455
|
AlternativesList,
|
|
9046
9456
|
AuthProvider,
|
|
9047
9457
|
Badge,
|
|
9048
|
-
Breadcrumb,
|
|
9049
9458
|
Button,
|
|
9050
9459
|
Calendar,
|
|
9051
9460
|
CardAccordation,
|
|
@@ -9132,6 +9541,7 @@ var QuizListResultByMateria = ({
|
|
|
9132
9541
|
TextArea,
|
|
9133
9542
|
Toast,
|
|
9134
9543
|
Toaster,
|
|
9544
|
+
VideoPlayer,
|
|
9135
9545
|
createZustandAuthAdapter,
|
|
9136
9546
|
getRootDomain,
|
|
9137
9547
|
getStatusBadge,
|