analytica-frontend-lib
Version:
Repositório público dos componentes utilizados nas plataformas da Analytica Ensino
707 lines (705 loc) • 26.8 kB
JavaScript
import {
AlertDialog
} from "./chunk-6E2SCKRJ.mjs";
import {
QuizAlternative,
QuizConnectDots,
QuizDissertative,
QuizFill,
QuizImageQuestion,
QuizMultipleChoice,
QuizTrueOrFalse
} from "./chunk-C6FDFF3W.mjs";
import {
formatExamInfo
} from "./chunk-DDZDNGBU.mjs";
import {
HeaderAlternative
} from "./chunk-TUJ3CWS2.mjs";
import {
HtmlMathRenderer_default
} from "./chunk-FN4G43WK.mjs";
import {
CardStatus
} from "./chunk-R7FP73MH.mjs";
import {
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
Select_default
} from "./chunk-UU7Q5S52.mjs";
import {
IconButton_default
} from "./chunk-LGQNMQOT.mjs";
import {
Modal_default
} from "./chunk-TNLGS7SB.mjs";
import {
Button_default
} from "./chunk-LAYB7IKW.mjs";
import {
Text_default
} from "./chunk-IMCIR6TJ.mjs";
import {
cn
} from "./chunk-53ICLDGS.mjs";
import {
useQuizStore
} from "./chunk-G7IP4VLI.mjs";
// src/components/Quiz/Quiz.tsx
import { BookOpenIcon } from "@phosphor-icons/react/dist/csr/BookOpen";
import { CaretLeftIcon } from "@phosphor-icons/react/dist/csr/CaretLeft";
import { CaretRightIcon } from "@phosphor-icons/react/dist/csr/CaretRight";
import { SquaresFourIcon } from "@phosphor-icons/react/dist/csr/SquaresFour";
import {
forwardRef,
useEffect,
useState
} from "react";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
var getQuizTypeConfig = (type) => {
const QUIZ_TYPE_CONFIG = {
["SIMULADO" /* SIMULADO */]: {
label: "Simulado",
article: "o",
preposition: "do"
},
["QUESTIONARIO" /* QUESTIONARIO */]: {
label: "Question\xE1rio",
article: "o",
preposition: "do"
},
["ATIVIDADE" /* ATIVIDADE */]: {
label: "Atividade",
article: "a",
preposition: "da"
},
["AULA_RECOMENDADA" /* AULA_RECOMENDADA */]: {
label: "Aula recomendada",
article: "a",
preposition: "da"
}
};
const config = QUIZ_TYPE_CONFIG[type];
return config || QUIZ_TYPE_CONFIG["SIMULADO" /* SIMULADO */];
};
var getTypeLabel = (type) => {
return getQuizTypeConfig(type).label;
};
var getQuizArticle = (type) => {
return getQuizTypeConfig(type).article;
};
var getQuizPreposition = (type) => {
return getQuizTypeConfig(type).preposition;
};
var getCompletionTitle = (type) => {
const config = getQuizTypeConfig(type);
return `Voc\xEA concluiu ${config.article} ${config.label.toLowerCase()}!`;
};
var getGoBackButtonLabel = (type) => {
if (type === "SIMULADO" /* SIMULADO */) return "Ir para simulados";
if (type === "QUESTIONARIO" /* QUESTIONARIO */) return "Ir para aulas";
if (type === "ATIVIDADE" /* ATIVIDADE */) return "Ir para atividades";
if (type === "AULA_RECOMENDADA" /* AULA_RECOMENDADA */) return "Ir para aulas recomendadas";
return "Ir para simulados";
};
var getExitConfirmationText = (type) => {
const config = getQuizTypeConfig(type);
if (type === "QUESTIONARIO" /* QUESTIONARIO */) {
return `Se voc\xEA sair ${config.preposition} ${config.label.toLowerCase()} agora, todas as respostas ser\xE3o perdidas.`;
}
return `Se voc\xEA sair ${config.preposition} ${config.label.toLowerCase()} agora, poder\xE1 continuar de onde parou depois.`;
};
var getFinishConfirmationText = (type) => {
const config = getQuizTypeConfig(type);
return `Tem certeza que deseja finalizar ${config.article} ${config.label.toLowerCase()}?`;
};
var Quiz = forwardRef(({ children, className, variant = "default" /* DEFAULT */, ...props }, ref) => {
const { setVariant } = useQuizStore();
useEffect(() => {
setVariant(variant);
}, [variant, setVariant]);
return /* @__PURE__ */ jsx("div", { ref, className: cn("flex flex-col", className), ...props, children });
});
var QuizTitle = forwardRef(({ className, onBack, ...props }, ref) => {
const {
quiz,
currentQuestionIndex,
getTotalQuestions,
getQuizTitle,
isStarted
} = useQuizStore();
const [showExitConfirmation, setShowExitConfirmation] = useState(false);
const totalQuestions = getTotalQuestions();
const quizTitle = getQuizTitle();
const handleBackClick = () => {
if (isStarted) {
setShowExitConfirmation(true);
} else {
actionOnBack();
}
};
const handleConfirmExit = () => {
setShowExitConfirmation(false);
actionOnBack();
};
const actionOnBack = () => {
if (onBack) {
onBack();
} else {
globalThis.history.back();
}
};
const handleCancelExit = () => {
setShowExitConfirmation(false);
};
return /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsxs(
"div",
{
ref,
className: cn(
"flex flex-row justify-between items-center relative p-2",
className
),
...props,
children: [
/* @__PURE__ */ jsx(
IconButton_default,
{
icon: /* @__PURE__ */ jsx(CaretLeftIcon, { size: 24 }),
size: "md",
"aria-label": "Voltar",
onClick: handleBackClick
}
),
/* @__PURE__ */ jsxs("span", { className: "flex flex-col gap-2 text-center", children: [
/* @__PURE__ */ jsx("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
/* @__PURE__ */ jsx("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
] })
]
}
),
/* @__PURE__ */ jsx(
AlertDialog,
{
isOpen: showExitConfirmation,
onChangeOpen: setShowExitConfirmation,
title: "Deseja sair?",
description: getExitConfirmationText(quiz?.type || "SIMULADO" /* SIMULADO */),
cancelButtonLabel: "Voltar e revisar",
submitButtonLabel: "Sair Mesmo Assim",
onSubmit: handleConfirmExit,
onCancel: handleCancelExit
}
)
] });
});
var QuizHeader = () => {
const { getCurrentQuestion, getQuestionIndex, quiz } = useQuizStore();
const currentQuestion = getCurrentQuestion();
let currentId = currentQuestion && "questionId" in currentQuestion ? currentQuestion.questionId : currentQuestion?.id;
const questionIndex = getQuestionIndex(currentId);
const questionNumber = currentQuestion ? `Quest\xE3o ${questionIndex.toString().padStart(2, "0")}` : "Quest\xE3o";
const shouldShowExamInfo = quiz?.type === "SIMULADO" /* SIMULADO */;
const examInfo = shouldShowExamInfo ? formatExamInfo(currentQuestion?.examBoard, currentQuestion?.examYear) : "";
const title = examInfo ? `${questionNumber} ${examInfo}` : questionNumber;
return /* @__PURE__ */ jsx(
HeaderAlternative,
{
title,
subTitle: currentQuestion?.knowledgeMatrix?.[0]?.topic?.name ?? "",
content: currentQuestion?.statement ?? ""
}
);
};
var QuizContent = ({ paddingBottom }) => {
const { getCurrentQuestion } = useQuizStore();
const currentQuestion = getCurrentQuestion();
const questionComponents = {
["ALTERNATIVA" /* ALTERNATIVA */]: QuizAlternative,
["MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */]: QuizMultipleChoice,
["DISSERTATIVA" /* DISSERTATIVA */]: QuizDissertative,
["VERDADEIRO_FALSO" /* VERDADEIRO_FALSO */]: QuizTrueOrFalse,
["RELACIONAR" /* RELACIONAR */]: QuizConnectDots,
["PREENCHER_LACUNAS" /* PREENCHER_LACUNAS */]: QuizFill,
["IMAGEM" /* IMAGEM */]: QuizImageQuestion
};
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.questionType] : null;
return QuestionComponent ? /* @__PURE__ */ jsx(QuestionComponent, { paddingBottom }) : /* @__PURE__ */ jsx(Text_default, { size: "md", weight: "medium", className: "text-text-950 text-md", children: "Tipo de quest\xE3o n\xE3o suportado" });
};
var QuizQuestionList = ({
filterType = "all",
onQuestionClick
} = {}) => {
const {
getQuestionsGroupedBySubject,
goToQuestion,
getQuestionStatusFromUserAnswers,
getQuestionIndex,
quiz
} = useQuizStore();
const shouldShowExamInfo = quiz?.type === "SIMULADO" /* SIMULADO */;
const groupedQuestions = getQuestionsGroupedBySubject();
const getQuestionStatus = (questionId) => {
return getQuestionStatusFromUserAnswers(questionId);
};
const filteredGroupedQuestions = Object.entries(groupedQuestions).reduce(
(acc, [subjectId, questions]) => {
const filteredQuestions = questions.filter((question) => {
const status = getQuestionStatus(question.id);
switch (filterType) {
case "answered":
return status === "answered";
case "unanswered":
return status === "unanswered" || status === "skipped";
default:
return true;
}
});
if (filteredQuestions.length > 0) {
acc[subjectId] = filteredQuestions;
}
return acc;
},
// eslint-disable-next-line @typescript-eslint/no-explicit-any
{}
);
const getStatusLabel = (status) => {
switch (status) {
case "answered":
return "Respondida";
case "skipped":
return "Em branco";
default:
return "Em branco";
}
};
return /* @__PURE__ */ jsxs("div", { className: "space-y-6 px-4 h-full", children: [
Object.entries(filteredGroupedQuestions).length == 0 && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center text-gray-500 py-8 h-full", children: /* @__PURE__ */ jsx("p", { className: "text-lg", children: "Nenhum resultado" }) }),
Object.entries(filteredGroupedQuestions).map(
([subjectId, questions]) => /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-2", children: [
/* @__PURE__ */ jsxs("span", { className: "pt-6 pb-4 flex flex-row gap-2", children: [
/* @__PURE__ */ jsx("div", { className: "bg-primary-500 p-1 rounded-sm flex items-center justify-center", children: /* @__PURE__ */ jsx(BookOpenIcon, { size: 17, className: "text-white" }) }),
/* @__PURE__ */ jsx("p", { className: "text-text-800 font-bold text-lg", children: questions?.[0]?.knowledgeMatrix?.[0]?.subject?.name ?? "Sem mat\xE9ria" })
] }),
/* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-2", children: questions.map((question) => {
const status = getQuestionStatus(question.id);
const questionNumber = getQuestionIndex(question.id);
const examInfo = shouldShowExamInfo ? formatExamInfo(question.examBoard, question.examYear) : "";
const questionTitle = `Quest\xE3o ${questionNumber.toString().padStart(2, "0")}`;
const header = examInfo ? `${questionTitle} ${examInfo}` : questionTitle;
return /* @__PURE__ */ jsx(
CardStatus,
{
header,
label: getStatusLabel(status),
onClick: () => {
goToQuestion(questionNumber - 1);
onQuestionClick?.();
}
},
question.id
);
}) })
] }, subjectId)
)
] });
};
var QuizResultModal = ({
isOpen,
onClose,
image,
showImagePlaceholder = true,
title,
description,
footer
}) => /* @__PURE__ */ jsx(
Modal_default,
{
isOpen,
onClose,
title: "",
closeOnEscape: false,
hideCloseButton: true,
size: "md",
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
image ? /* @__PURE__ */ jsx("div", { className: "w-[282px] h-auto", children: image }) : showImagePlaceholder && /* @__PURE__ */ jsx("div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ jsx(Text_default, { as: "span", size: "sm", color: "text-gray-500", children: "Imagem de resultado" }) }),
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 text-center", children: [
/* @__PURE__ */ jsx(Text_default, { as: "h2", size: "lg", weight: "bold", children: title }),
description
] }),
footer
] })
}
);
var QuizFooter = forwardRef(
({
className,
onGoToSimulated,
onDetailResult,
handleFinishSimulated,
onGoToNextModule,
onRepeat,
onTryLater,
resultImageComponent,
resultIncorrectImageComponent,
...props
}, ref) => {
const {
quiz,
currentQuestionIndex,
getTotalQuestions,
goToNextQuestion,
goToPreviousQuestion,
getUnansweredQuestionsFromUserAnswers,
getCurrentAnswer,
skipQuestion,
skipCurrentQuestionIfUnanswered,
getCurrentQuestion,
getQuestionStatusFromUserAnswers,
variant,
getQuestionResultStatistics
} = useQuizStore();
const totalQuestions = getTotalQuestions();
const isFirstQuestion = currentQuestionIndex === 0;
const isLastQuestion = currentQuestionIndex === totalQuestions - 1;
const currentAnswer = getCurrentAnswer();
const currentQuestion = getCurrentQuestion();
const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false;
const [activeModal, setActiveModal] = useState(null);
const [filterType, setFilterType] = useState("all");
const openModal = (modalName) => setActiveModal(modalName);
const closeModal = () => setActiveModal(null);
const isModalOpen = (modalName) => activeModal === modalName;
const unansweredQuestions = getUnansweredQuestionsFromUserAnswers();
const allQuestions = getTotalQuestions();
const stats = getQuestionResultStatistics();
const correctAnswers = stats?.correctAnswers;
const quizType = quiz?.type || "SIMULADO" /* SIMULADO */;
const quizTypeLabel = getTypeLabel(quizType);
const moduleName = quiz?.questions?.[0]?.knowledgeMatrix?.[0]?.subtopic?.name;
const submitAndOpenResultModal = async () => {
if (handleFinishSimulated) {
await Promise.resolve(handleFinishSimulated());
}
const latestStats = getQuestionResultStatistics();
const latestCorrect = latestStats?.correctAnswers;
const latestTotal = latestStats?.totalAnswered;
if (quizType === "QUESTIONARIO" /* QUESTIONARIO */ && typeof latestCorrect === "number" && typeof latestTotal === "number" && latestCorrect === latestTotal) {
openModal("modalQuestionnaireAllCorrect");
return;
}
if (quizType === "QUESTIONARIO" /* QUESTIONARIO */ && typeof latestCorrect === "number" && latestCorrect === 0) {
openModal("modalQuestionnaireAllIncorrect");
return;
}
openModal("modalResult");
};
const handleFinishQuiz = async () => {
skipCurrentQuestionIfUnanswered();
if (unansweredQuestions.length > 0) {
openModal("alertDialog");
return;
}
try {
await submitAndOpenResultModal();
} catch (err) {
console.error("handleFinishSimulated failed:", err);
}
};
const handleAlertSubmit = async () => {
try {
await submitAndOpenResultModal();
} catch (err) {
console.error("handleFinishSimulated failed:", err);
closeModal();
}
};
return /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx(
"footer",
{
ref,
className: cn(
"w-full px-2 bg-background lg:max-w-[1000px] not-lg:max-w-[calc(100vw-32px)] border-t border-border-50 fixed bottom-0 min-h-[80px] flex flex-row justify-between items-center",
className
),
...props,
children: variant === "default" ? /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-1", children: [
/* @__PURE__ */ jsx(
IconButton_default,
{
icon: /* @__PURE__ */ jsx(SquaresFourIcon, { size: 24, className: "text-text-950" }),
size: "md",
onClick: () => openModal("modalNavigate")
}
),
isFirstQuestion ? /* @__PURE__ */ jsx(
Button_default,
{
variant: "outline",
size: "small",
onClick: () => {
skipQuestion();
goToNextQuestion();
},
children: "Pular"
}
) : /* @__PURE__ */ jsx(
Button_default,
{
size: "medium",
variant: "link",
action: "primary",
iconLeft: /* @__PURE__ */ jsx(CaretLeftIcon, { size: 18 }),
onClick: () => {
goToPreviousQuestion();
},
children: "Voltar"
}
)
] }),
!isFirstQuestion && !isLastQuestion && /* @__PURE__ */ jsx(
Button_default,
{
size: "small",
variant: "outline",
action: "primary",
onClick: () => {
skipQuestion();
goToNextQuestion();
},
children: "Pular"
}
),
isLastQuestion ? /* @__PURE__ */ jsx(
Button_default,
{
size: "medium",
variant: "solid",
action: "primary",
onClick: handleFinishQuiz,
children: "Finalizar"
}
) : /* @__PURE__ */ jsx(
Button_default,
{
size: "medium",
variant: "link",
action: "primary",
iconRight: /* @__PURE__ */ jsx(CaretRightIcon, { size: 18 }),
disabled: !currentAnswer && !isCurrentQuestionSkipped,
onClick: () => {
goToNextQuestion();
},
children: "Avan\xE7ar"
}
)
] }) : currentQuestion?.solutionExplanation && /* @__PURE__ */ jsx("div", { className: "flex flex-row items-center justify-center w-full", children: /* @__PURE__ */ jsx(
Button_default,
{
variant: "link",
action: "primary",
size: "medium",
onClick: () => openModal("modalResolution"),
children: "Ver resolu\xE7\xE3o"
}
) })
}
),
/* @__PURE__ */ jsx(
AlertDialog,
{
isOpen: isModalOpen("alertDialog"),
onChangeOpen: (open) => open ? openModal("alertDialog") : closeModal(),
title: `Finalizar ${quizTypeLabel.toLowerCase()}?`,
description: unansweredQuestions.length > 0 ? `Voc\xEA deixou as quest\xF5es ${unansweredQuestions.join(", ")} sem resposta. Finalizar agora pode impactar seu desempenho.` : getFinishConfirmationText(quizType),
cancelButtonLabel: "Voltar e revisar",
submitButtonLabel: "Finalizar Mesmo Assim",
onSubmit: handleAlertSubmit
}
),
/* @__PURE__ */ jsx(
QuizResultModal,
{
isOpen: isModalOpen("modalResult"),
onClose: closeModal,
image: resultImageComponent,
title: getCompletionTitle(quizType),
description: /* @__PURE__ */ jsxs(Text_default, { as: "p", size: "sm", color: "text-text-500", children: [
"Voc\xEA acertou ",
correctAnswers ?? "--",
" de ",
allQuestions,
" quest\xF5es."
] }),
footer: /* @__PURE__ */ jsxs("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: [
/* @__PURE__ */ jsx(
Button_default,
{
variant: "outline",
className: "w-full",
size: "small",
onClick: onGoToSimulated,
children: getGoBackButtonLabel(quizType)
}
),
/* @__PURE__ */ jsx(Button_default, { className: "w-full", onClick: onDetailResult, children: "Detalhar resultado" })
] })
}
),
/* @__PURE__ */ jsx(
Modal_default,
{
isOpen: isModalOpen("modalNavigate"),
onClose: closeModal,
title: "Quest\xF5es",
size: "lg",
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col w-full not-lg:h-[calc(100vh-200px)] lg:max-h-[687px] lg:h-[687px]", children: [
/* @__PURE__ */ jsxs("div", { className: "flex flex-row justify-between items-center py-6 pt-6 pb-4 border-b border-border-200 flex-shrink-0", children: [
/* @__PURE__ */ jsx("p", { className: "text-text-950 font-bold text-lg", children: "Filtrar por" }),
/* @__PURE__ */ jsx("span", { className: "max-w-[266px]", children: /* @__PURE__ */ jsxs(Select_default, { value: filterType, onValueChange: setFilterType, children: [
/* @__PURE__ */ jsx(
SelectTrigger,
{
variant: "rounded",
className: "max-w-[266px] min-w-[160px]",
children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Selecione uma op\xE7\xE3o" })
}
),
/* @__PURE__ */ jsxs(SelectContent, { children: [
/* @__PURE__ */ jsx(SelectItem, { value: "all", children: "Todas" }),
/* @__PURE__ */ jsx(SelectItem, { value: "unanswered", children: "Em branco" }),
/* @__PURE__ */ jsx(SelectItem, { value: "answered", children: "Respondidas" })
] })
] }) })
] }),
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2 flex-1 min-h-0 overflow-y-auto", children: /* @__PURE__ */ jsx(
QuizQuestionList,
{
filterType,
onQuestionClick: closeModal
}
) })
] })
}
),
/* @__PURE__ */ jsx(
Modal_default,
{
isOpen: isModalOpen("modalResolution"),
onClose: closeModal,
title: "Resolu\xE7\xE3o",
size: "lg",
children: /* @__PURE__ */ jsx(
HtmlMathRenderer_default,
{
content: currentQuestion?.solutionExplanation || "",
className: "text-text-950 text-base"
}
)
}
),
/* @__PURE__ */ jsx(
QuizResultModal,
{
isOpen: isModalOpen("modalQuestionnaireAllCorrect"),
onClose: closeModal,
image: resultImageComponent,
title: "\u{1F389} Parab\xE9ns!",
description: /* @__PURE__ */ jsx(Text_default, { as: "p", size: "sm", color: "text-text-500", children: moduleName ? `Voc\xEA concluiu o m\xF3dulo ${moduleName}.` : "Voc\xEA concluiu o question\xE1rio!" }),
footer: /* @__PURE__ */ jsx("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: /* @__PURE__ */ jsx(Button_default, { className: "w-full", onClick: onGoToNextModule, children: getGoBackButtonLabel(quizType) }) })
}
),
/* @__PURE__ */ jsx(
QuizResultModal,
{
isOpen: isModalOpen("modalQuestionnaireAllIncorrect"),
onClose: closeModal,
image: resultIncorrectImageComponent,
showImagePlaceholder: false,
title: "\u{1F615} N\xE3o foi dessa vez...",
description: /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx(Text_default, { as: "p", size: "sm", color: "text-text-500", children: "Voc\xEA tirou 0 no question\xE1rio, mas n\xE3o se preocupe! Isso \xE9 apenas uma oportunidade de aprendizado." }),
/* @__PURE__ */ jsx(Text_default, { as: "p", size: "sm", color: "text-text-500", children: "Que tal tentar novamente para melhorar sua nota? Estamos aqui para te ajudar a entender o conte\xFAdo e evoluir." }),
quiz?.canRetry && /* @__PURE__ */ jsx(Text_default, { as: "p", size: "sm", color: "text-text-500", children: "Clique em Repetir Question\xE1rio e mostre do que voc\xEA \xE9 capaz! \u{1F4AA}" })
] }),
footer: /* @__PURE__ */ jsxs("div", { className: "flex flex-row justify-center items-center gap-2 w-full", children: [
quiz?.canRetry && /* @__PURE__ */ jsx(
Button_default,
{
type: "button",
variant: "link",
size: "small",
className: "w-auto",
onClick: () => {
closeModal();
openModal("alertDialogTryLater");
},
children: "Tentar depois"
}
),
/* @__PURE__ */ jsx(
Button_default,
{
variant: "outline",
size: "small",
className: "w-auto",
onClick: onDetailResult,
children: "Detalhar resultado"
}
),
quiz?.canRetry ? /* @__PURE__ */ jsx(Button_default, { className: "w-auto", size: "small", onClick: onRepeat, children: "Repetir question\xE1rio" }) : /* @__PURE__ */ jsx(
Button_default,
{
className: "w-auto",
size: "small",
onClick: onGoToSimulated,
children: getGoBackButtonLabel(quizType)
}
)
] })
}
),
/* @__PURE__ */ jsx(
AlertDialog,
{
isOpen: isModalOpen("alertDialogTryLater"),
onChangeOpen: (open) => open ? openModal("alertDialogTryLater") : closeModal(),
title: "Tentar depois?",
description: "Voc\xEA optou por refazer o question\xE1rio mais tarde.\n\nLembre-se: enquanto n\xE3o refazer o question\xE1rio, sua nota permanecer\xE1 0 no sistema.",
cancelButtonLabel: "Repetir question\xE1rio",
submitButtonLabel: "Tentar depois",
onSubmit: () => {
onTryLater?.();
closeModal();
},
onCancel: () => {
onRepeat?.();
closeModal();
}
}
)
] });
}
);
export {
getQuizTypeConfig,
getTypeLabel,
getQuizArticle,
getQuizPreposition,
getCompletionTitle,
getGoBackButtonLabel,
getExitConfirmationText,
getFinishConfirmationText,
Quiz,
QuizTitle,
QuizHeader,
QuizContent,
QuizQuestionList,
QuizFooter
};
//# sourceMappingURL=chunk-HLPCFGPW.mjs.map