analytica-frontend-lib 1.1.62 → 1.1.64
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/Quiz/index.d.mts +26 -40
- package/dist/Quiz/index.d.ts +26 -40
- package/dist/Quiz/index.js +3411 -3790
- package/dist/Quiz/index.js.map +1 -1
- package/dist/Quiz/index.mjs +3425 -3792
- package/dist/Quiz/index.mjs.map +1 -1
- package/dist/Quiz/useQuizStore/index.d.mts +10 -25
- package/dist/Quiz/useQuizStore/index.d.ts +10 -25
- package/dist/Quiz/useQuizStore/index.js +52 -77
- package/dist/Quiz/useQuizStore/index.js.map +1 -1
- package/dist/Quiz/useQuizStore/index.mjs +51 -77
- package/dist/Quiz/useQuizStore/index.mjs.map +1 -1
- package/dist/index.d.mts +37 -4
- package/dist/index.d.ts +37 -4
- package/dist/index.js +587 -440
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +587 -440
- package/dist/index.mjs.map +1 -1
- package/dist/utils/index.d.mts +5 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.js +35 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +10 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8709,22 +8709,16 @@ function useApiConfig(api) {
|
|
|
8709
8709
|
|
|
8710
8710
|
// src/components/Quiz/Quiz.tsx
|
|
8711
8711
|
import {
|
|
8712
|
+
BookOpen,
|
|
8712
8713
|
CaretLeft as CaretLeft3,
|
|
8713
8714
|
CaretRight as CaretRight5,
|
|
8714
8715
|
Clock as Clock2,
|
|
8715
|
-
SquaresFour
|
|
8716
|
-
BookOpen,
|
|
8717
|
-
CheckCircle as CheckCircle6,
|
|
8718
|
-
XCircle as XCircle5
|
|
8716
|
+
SquaresFour
|
|
8719
8717
|
} from "phosphor-react";
|
|
8720
8718
|
import {
|
|
8721
|
-
forwardRef as
|
|
8722
|
-
useEffect as
|
|
8723
|
-
|
|
8724
|
-
useId as useId11,
|
|
8725
|
-
useState as useState19,
|
|
8726
|
-
useCallback as useCallback5,
|
|
8727
|
-
useRef as useRef12
|
|
8719
|
+
forwardRef as forwardRef20,
|
|
8720
|
+
useEffect as useEffect19,
|
|
8721
|
+
useState as useState20
|
|
8728
8722
|
} from "react";
|
|
8729
8723
|
|
|
8730
8724
|
// src/components/Quiz/useQuizStore.ts
|
|
@@ -8736,6 +8730,12 @@ var QUESTION_DIFFICULTY = /* @__PURE__ */ ((QUESTION_DIFFICULTY2) => {
|
|
|
8736
8730
|
QUESTION_DIFFICULTY2["DIFICIL"] = "DIFICIL";
|
|
8737
8731
|
return QUESTION_DIFFICULTY2;
|
|
8738
8732
|
})(QUESTION_DIFFICULTY || {});
|
|
8733
|
+
var QUIZ_TYPE = /* @__PURE__ */ ((QUIZ_TYPE2) => {
|
|
8734
|
+
QUIZ_TYPE2["SIMULADO"] = "SIMULADO";
|
|
8735
|
+
QUIZ_TYPE2["QUESTIONARIO"] = "QUESTIONARIO";
|
|
8736
|
+
QUIZ_TYPE2["ATIVIDADE"] = "ATIVIDADE";
|
|
8737
|
+
return QUIZ_TYPE2;
|
|
8738
|
+
})(QUIZ_TYPE || {});
|
|
8739
8739
|
var QUESTION_TYPE = /* @__PURE__ */ ((QUESTION_TYPE2) => {
|
|
8740
8740
|
QUESTION_TYPE2["ALTERNATIVA"] = "ALTERNATIVA";
|
|
8741
8741
|
QUESTION_TYPE2["DISSERTATIVA"] = "DISSERTATIVA";
|
|
@@ -8824,6 +8824,7 @@ var useQuizStore = create7()(
|
|
|
8824
8824
|
};
|
|
8825
8825
|
return {
|
|
8826
8826
|
// Initial State
|
|
8827
|
+
quiz: null,
|
|
8827
8828
|
currentQuestionIndex: 0,
|
|
8828
8829
|
selectedAnswers: {},
|
|
8829
8830
|
userAnswers: [],
|
|
@@ -8836,9 +8837,7 @@ var useQuizStore = create7()(
|
|
|
8836
8837
|
questionsResult: null,
|
|
8837
8838
|
currentQuestionResult: null,
|
|
8838
8839
|
// Setters
|
|
8839
|
-
|
|
8840
|
-
setByActivity: (activity) => set({ byActivity: activity }),
|
|
8841
|
-
setByQuestionary: (lesson) => set({ byQuestionary: lesson }),
|
|
8840
|
+
setQuiz: (quiz) => set({ quiz }),
|
|
8842
8841
|
setUserId: (userId) => set({ userId }),
|
|
8843
8842
|
setUserAnswers: (userAnswers) => set({ userAnswers }),
|
|
8844
8843
|
getUserId: () => get().userId,
|
|
@@ -8865,29 +8864,16 @@ var useQuizStore = create7()(
|
|
|
8865
8864
|
set({ currentQuestionIndex: index });
|
|
8866
8865
|
}
|
|
8867
8866
|
},
|
|
8868
|
-
getActiveQuiz: () => {
|
|
8869
|
-
const { bySimulated, byActivity, byQuestionary } = get();
|
|
8870
|
-
if (bySimulated)
|
|
8871
|
-
return { quiz: bySimulated, type: "bySimulated" };
|
|
8872
|
-
if (byActivity)
|
|
8873
|
-
return { quiz: byActivity, type: "byActivity" };
|
|
8874
|
-
if (byQuestionary)
|
|
8875
|
-
return { quiz: byQuestionary, type: "byQuestionary" };
|
|
8876
|
-
return null;
|
|
8877
|
-
},
|
|
8878
8867
|
selectAnswer: (questionId, answerId) => {
|
|
8879
|
-
const {
|
|
8880
|
-
|
|
8881
|
-
|
|
8882
|
-
const activityId = activeQuiz.quiz.id;
|
|
8868
|
+
const { quiz, userAnswers } = get();
|
|
8869
|
+
if (!quiz) return;
|
|
8870
|
+
const activityId = quiz.id;
|
|
8883
8871
|
const userId = get().getUserId();
|
|
8884
8872
|
if (!userId || userId === "") {
|
|
8885
8873
|
console.warn("selectAnswer called before userId is set");
|
|
8886
8874
|
return;
|
|
8887
8875
|
}
|
|
8888
|
-
const question =
|
|
8889
|
-
(q) => q.id === questionId
|
|
8890
|
-
);
|
|
8876
|
+
const question = quiz.questions.find((q) => q.id === questionId);
|
|
8891
8877
|
if (!question) return;
|
|
8892
8878
|
const existingAnswerIndex = userAnswers.findIndex(
|
|
8893
8879
|
(answer) => answer.questionId === questionId
|
|
@@ -8913,18 +8899,15 @@ var useQuizStore = create7()(
|
|
|
8913
8899
|
});
|
|
8914
8900
|
},
|
|
8915
8901
|
selectMultipleAnswer: (questionId, answerIds) => {
|
|
8916
|
-
const {
|
|
8917
|
-
|
|
8918
|
-
|
|
8919
|
-
const activityId = activeQuiz.quiz.id;
|
|
8902
|
+
const { quiz, userAnswers } = get();
|
|
8903
|
+
if (!quiz) return;
|
|
8904
|
+
const activityId = quiz.id;
|
|
8920
8905
|
const userId = get().getUserId();
|
|
8921
8906
|
if (!userId || userId === "") {
|
|
8922
8907
|
console.warn("selectMultipleAnswer called before userId is set");
|
|
8923
8908
|
return;
|
|
8924
8909
|
}
|
|
8925
|
-
const question =
|
|
8926
|
-
(q) => q.id === questionId
|
|
8927
|
-
);
|
|
8910
|
+
const question = quiz.questions.find((q) => q.id === questionId);
|
|
8928
8911
|
if (!question) return;
|
|
8929
8912
|
const filteredUserAnswers = userAnswers.filter(
|
|
8930
8913
|
(answer) => answer.questionId !== questionId
|
|
@@ -8951,10 +8934,9 @@ var useQuizStore = create7()(
|
|
|
8951
8934
|
});
|
|
8952
8935
|
},
|
|
8953
8936
|
selectDissertativeAnswer: (questionId, answer) => {
|
|
8954
|
-
const {
|
|
8955
|
-
|
|
8956
|
-
|
|
8957
|
-
const activityId = activeQuiz.quiz.id;
|
|
8937
|
+
const { quiz, userAnswers } = get();
|
|
8938
|
+
if (!quiz) return;
|
|
8939
|
+
const activityId = quiz.id;
|
|
8958
8940
|
const userId = get().getUserId();
|
|
8959
8941
|
if (!userId || userId === "") {
|
|
8960
8942
|
console.warn(
|
|
@@ -8962,9 +8944,7 @@ var useQuizStore = create7()(
|
|
|
8962
8944
|
);
|
|
8963
8945
|
return;
|
|
8964
8946
|
}
|
|
8965
|
-
const question =
|
|
8966
|
-
(q) => q.id === questionId
|
|
8967
|
-
);
|
|
8947
|
+
const question = quiz.questions.find((q) => q.id === questionId);
|
|
8968
8948
|
if (!question || question.questionType !== "DISSERTATIVA" /* DISSERTATIVA */) {
|
|
8969
8949
|
console.warn(
|
|
8970
8950
|
"selectDissertativeAnswer called for non-dissertative question"
|
|
@@ -8995,12 +8975,11 @@ var useQuizStore = create7()(
|
|
|
8995
8975
|
});
|
|
8996
8976
|
},
|
|
8997
8977
|
skipQuestion: () => {
|
|
8998
|
-
const { getCurrentQuestion, userAnswers,
|
|
8978
|
+
const { getCurrentQuestion, userAnswers, quiz } = get();
|
|
8999
8979
|
const currentQuestion = getCurrentQuestion();
|
|
9000
|
-
|
|
9001
|
-
if (!activeQuiz) return;
|
|
8980
|
+
if (!quiz) return;
|
|
9002
8981
|
if (currentQuestion) {
|
|
9003
|
-
const activityId =
|
|
8982
|
+
const activityId = quiz.id;
|
|
9004
8983
|
const userId = get().getUserId();
|
|
9005
8984
|
if (!userId || userId === "") {
|
|
9006
8985
|
console.warn("skipQuestion called before userId is set");
|
|
@@ -9031,18 +9010,15 @@ var useQuizStore = create7()(
|
|
|
9031
9010
|
}
|
|
9032
9011
|
},
|
|
9033
9012
|
addUserAnswer: (questionId, answerId) => {
|
|
9034
|
-
const {
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
const activityId = activeQuiz.quiz.id;
|
|
9013
|
+
const { quiz, userAnswers } = get();
|
|
9014
|
+
if (!quiz) return;
|
|
9015
|
+
const activityId = quiz.id;
|
|
9038
9016
|
const userId = get().getUserId();
|
|
9039
9017
|
if (!userId || userId === "") {
|
|
9040
9018
|
console.warn("addUserAnswer called before userId is set");
|
|
9041
9019
|
return;
|
|
9042
9020
|
}
|
|
9043
|
-
const question =
|
|
9044
|
-
(q) => q.id === questionId
|
|
9045
|
-
);
|
|
9021
|
+
const question = quiz.questions.find((q) => q.id === questionId);
|
|
9046
9022
|
if (!question) return;
|
|
9047
9023
|
const existingAnswerIndex = userAnswers.findIndex(
|
|
9048
9024
|
(answer) => answer.questionId === questionId
|
|
@@ -9078,6 +9054,7 @@ var useQuizStore = create7()(
|
|
|
9078
9054
|
stopTimer();
|
|
9079
9055
|
stopMinuteCallback();
|
|
9080
9056
|
set({
|
|
9057
|
+
quiz: null,
|
|
9081
9058
|
currentQuestionIndex: 0,
|
|
9082
9059
|
selectedAnswers: {},
|
|
9083
9060
|
userAnswers: [],
|
|
@@ -9101,17 +9078,15 @@ var useQuizStore = create7()(
|
|
|
9101
9078
|
stopMinuteCallback,
|
|
9102
9079
|
// Getters
|
|
9103
9080
|
getCurrentQuestion: () => {
|
|
9104
|
-
const { currentQuestionIndex,
|
|
9105
|
-
|
|
9106
|
-
if (!activeQuiz) {
|
|
9081
|
+
const { currentQuestionIndex, quiz } = get();
|
|
9082
|
+
if (!quiz) {
|
|
9107
9083
|
return null;
|
|
9108
9084
|
}
|
|
9109
|
-
return
|
|
9085
|
+
return quiz.questions[currentQuestionIndex];
|
|
9110
9086
|
},
|
|
9111
9087
|
getTotalQuestions: () => {
|
|
9112
|
-
const {
|
|
9113
|
-
|
|
9114
|
-
return activeQuiz?.quiz?.questions?.length || 0;
|
|
9088
|
+
const { quiz } = get();
|
|
9089
|
+
return quiz?.questions?.length || 0;
|
|
9115
9090
|
},
|
|
9116
9091
|
getAnsweredQuestions: () => {
|
|
9117
9092
|
const { userAnswers } = get();
|
|
@@ -9120,11 +9095,10 @@ var useQuizStore = create7()(
|
|
|
9120
9095
|
).length;
|
|
9121
9096
|
},
|
|
9122
9097
|
getUnansweredQuestions: () => {
|
|
9123
|
-
const {
|
|
9124
|
-
|
|
9125
|
-
if (!activeQuiz) return [];
|
|
9098
|
+
const { quiz, userAnswers } = get();
|
|
9099
|
+
if (!quiz) return [];
|
|
9126
9100
|
const unansweredQuestions = [];
|
|
9127
|
-
|
|
9101
|
+
quiz.questions.forEach((question, index) => {
|
|
9128
9102
|
const userAnswer = userAnswers.find(
|
|
9129
9103
|
(answer) => answer.questionId === question.id
|
|
9130
9104
|
);
|
|
@@ -9185,9 +9159,8 @@ var useQuizStore = create7()(
|
|
|
9185
9159
|
return userAnswer;
|
|
9186
9160
|
},
|
|
9187
9161
|
getQuizTitle: () => {
|
|
9188
|
-
const {
|
|
9189
|
-
|
|
9190
|
-
return activeQuiz?.quiz?.title || "Quiz";
|
|
9162
|
+
const { quiz } = get();
|
|
9163
|
+
return quiz?.title || "Quiz";
|
|
9191
9164
|
},
|
|
9192
9165
|
formatTime: (seconds) => {
|
|
9193
9166
|
const minutes = Math.floor(seconds / 60);
|
|
@@ -9199,11 +9172,10 @@ var useQuizStore = create7()(
|
|
|
9199
9172
|
return userAnswers;
|
|
9200
9173
|
},
|
|
9201
9174
|
getUnansweredQuestionsFromUserAnswers: () => {
|
|
9202
|
-
const {
|
|
9203
|
-
|
|
9204
|
-
if (!activeQuiz) return [];
|
|
9175
|
+
const { quiz, userAnswers } = get();
|
|
9176
|
+
if (!quiz) return [];
|
|
9205
9177
|
const unansweredQuestions = [];
|
|
9206
|
-
|
|
9178
|
+
quiz.questions.forEach((question, index) => {
|
|
9207
9179
|
const userAnswer = userAnswers.find(
|
|
9208
9180
|
(answer) => answer.questionId === question.id
|
|
9209
9181
|
);
|
|
@@ -9216,8 +9188,8 @@ var useQuizStore = create7()(
|
|
|
9216
9188
|
return unansweredQuestions;
|
|
9217
9189
|
},
|
|
9218
9190
|
getQuestionsGroupedBySubject: () => {
|
|
9219
|
-
const { getQuestionResult,
|
|
9220
|
-
const questions = variant == "result" ? getQuestionResult()?.answers :
|
|
9191
|
+
const { getQuestionResult, quiz, variant } = get();
|
|
9192
|
+
const questions = variant == "result" ? getQuestionResult()?.answers : quiz?.questions;
|
|
9221
9193
|
if (!questions) return {};
|
|
9222
9194
|
const groupedQuestions = {};
|
|
9223
9195
|
questions.forEach((question) => {
|
|
@@ -9255,19 +9227,18 @@ var useQuizStore = create7()(
|
|
|
9255
9227
|
return userAnswers;
|
|
9256
9228
|
},
|
|
9257
9229
|
setCurrentQuestion: (question) => {
|
|
9258
|
-
const {
|
|
9259
|
-
|
|
9260
|
-
if (!activeQuiz) return;
|
|
9230
|
+
const { quiz, variant, questionsResult } = get();
|
|
9231
|
+
if (!quiz) return;
|
|
9261
9232
|
let questionIndex = 0;
|
|
9262
9233
|
if (variant == "result") {
|
|
9263
9234
|
if (!questionsResult) return;
|
|
9264
9235
|
const questionResult = questionsResult.answers.find((q) => q.id === question.id) ?? questionsResult.answers.find((q) => q.questionId === question.id);
|
|
9265
9236
|
if (!questionResult) return;
|
|
9266
|
-
questionIndex =
|
|
9237
|
+
questionIndex = quiz.questions.findIndex(
|
|
9267
9238
|
(q) => q.id === questionResult.questionId
|
|
9268
9239
|
);
|
|
9269
9240
|
} else {
|
|
9270
|
-
questionIndex =
|
|
9241
|
+
questionIndex = quiz.questions.findIndex(
|
|
9271
9242
|
(q) => q.id === question.id
|
|
9272
9243
|
);
|
|
9273
9244
|
}
|
|
@@ -9301,7 +9272,7 @@ var useQuizStore = create7()(
|
|
|
9301
9272
|
return userAnswer ? userAnswer.answerStatus : null;
|
|
9302
9273
|
},
|
|
9303
9274
|
getQuestionIndex: (questionId) => {
|
|
9304
|
-
const { questionsResult, variant } = get();
|
|
9275
|
+
const { questionsResult, variant, quiz } = get();
|
|
9305
9276
|
if (variant == "result") {
|
|
9306
9277
|
if (!questionsResult) return 0;
|
|
9307
9278
|
let idx = questionsResult.answers.findIndex(
|
|
@@ -9314,12 +9285,8 @@ var useQuizStore = create7()(
|
|
|
9314
9285
|
}
|
|
9315
9286
|
return idx !== -1 ? idx + 1 : 0;
|
|
9316
9287
|
} else {
|
|
9317
|
-
|
|
9318
|
-
const
|
|
9319
|
-
if (!activeQuiz) return 0;
|
|
9320
|
-
const idx = activeQuiz.quiz.questions.findIndex(
|
|
9321
|
-
(q) => q.id === questionId
|
|
9322
|
-
);
|
|
9288
|
+
if (!quiz) return 0;
|
|
9289
|
+
const idx = quiz.questions.findIndex((q) => q.id === questionId);
|
|
9323
9290
|
return idx !== -1 ? idx + 1 : 0;
|
|
9324
9291
|
}
|
|
9325
9292
|
},
|
|
@@ -9357,10 +9324,22 @@ var useQuizStore = create7()(
|
|
|
9357
9324
|
)
|
|
9358
9325
|
);
|
|
9359
9326
|
|
|
9327
|
+
// src/components/Quiz/QuizContent.tsx
|
|
9328
|
+
import {
|
|
9329
|
+
forwardRef as forwardRef19,
|
|
9330
|
+
useCallback as useCallback5,
|
|
9331
|
+
useEffect as useEffect18,
|
|
9332
|
+
useId as useId11,
|
|
9333
|
+
useMemo as useMemo6,
|
|
9334
|
+
useRef as useRef12,
|
|
9335
|
+
useState as useState19
|
|
9336
|
+
} from "react";
|
|
9337
|
+
import { CheckCircle as CheckCircle6, XCircle as XCircle5 } from "phosphor-react";
|
|
9338
|
+
|
|
9360
9339
|
// src/assets/img/mock-image-question.png
|
|
9361
9340
|
var mock_image_question_default = "./mock-image-question-HEZCLFDL.png";
|
|
9362
9341
|
|
|
9363
|
-
// src/components/Quiz/
|
|
9342
|
+
// src/components/Quiz/QuizContent.tsx
|
|
9364
9343
|
import { Fragment as Fragment10, jsx as jsx47, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
9365
9344
|
var getStatusBadge = (status) => {
|
|
9366
9345
|
switch (status) {
|
|
@@ -9380,158 +9359,11 @@ var getStatusStyles = (variantCorrect) => {
|
|
|
9380
9359
|
return "bg-error-background border-error-300";
|
|
9381
9360
|
}
|
|
9382
9361
|
};
|
|
9383
|
-
var Quiz = forwardRef19(({ children, className, variant = "default", ...props }, ref) => {
|
|
9384
|
-
const { setVariant } = useQuizStore();
|
|
9385
|
-
useEffect18(() => {
|
|
9386
|
-
setVariant(variant);
|
|
9387
|
-
}, [variant, setVariant]);
|
|
9388
|
-
return /* @__PURE__ */ jsx47("div", { ref, className: cn("flex flex-col", className), ...props, children });
|
|
9389
|
-
});
|
|
9390
|
-
var QuizHeaderResult = forwardRef19(
|
|
9391
|
-
({ className, ...props }, ref) => {
|
|
9392
|
-
const { getQuestionResultByQuestionId, getCurrentQuestion } = useQuizStore();
|
|
9393
|
-
const [status, setStatus] = useState19(void 0);
|
|
9394
|
-
useEffect18(() => {
|
|
9395
|
-
const cq = getCurrentQuestion();
|
|
9396
|
-
if (!cq) {
|
|
9397
|
-
setStatus(void 0);
|
|
9398
|
-
return;
|
|
9399
|
-
}
|
|
9400
|
-
const qr = getQuestionResultByQuestionId(cq.id);
|
|
9401
|
-
setStatus(qr?.answerStatus);
|
|
9402
|
-
}, [
|
|
9403
|
-
getCurrentQuestion,
|
|
9404
|
-
getQuestionResultByQuestionId,
|
|
9405
|
-
getCurrentQuestion()?.id
|
|
9406
|
-
]);
|
|
9407
|
-
const getClassesByAnswersStatus = () => {
|
|
9408
|
-
switch (status) {
|
|
9409
|
-
case "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */:
|
|
9410
|
-
return "bg-success-background";
|
|
9411
|
-
case "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */:
|
|
9412
|
-
return "bg-error-background";
|
|
9413
|
-
default:
|
|
9414
|
-
return "bg-error-background";
|
|
9415
|
-
}
|
|
9416
|
-
};
|
|
9417
|
-
const getLabelByAnswersStatus = () => {
|
|
9418
|
-
switch (status) {
|
|
9419
|
-
case "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */:
|
|
9420
|
-
return "\u{1F389} Parab\xE9ns!!";
|
|
9421
|
-
case "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */:
|
|
9422
|
-
return "N\xE3o foi dessa vez...";
|
|
9423
|
-
case "NAO_RESPONDIDO" /* NAO_RESPONDIDO */:
|
|
9424
|
-
return "N\xE3o foi dessa vez...voc\xEA deixou a resposta em branco";
|
|
9425
|
-
default:
|
|
9426
|
-
return "N\xE3o foi dessa vez...voc\xEA deixou a resposta em branco";
|
|
9427
|
-
}
|
|
9428
|
-
};
|
|
9429
|
-
return /* @__PURE__ */ jsxs34(
|
|
9430
|
-
"div",
|
|
9431
|
-
{
|
|
9432
|
-
ref,
|
|
9433
|
-
className: cn(
|
|
9434
|
-
"flex flex-row items-center gap-10 p-3.5 rounded-xl mb-4",
|
|
9435
|
-
getClassesByAnswersStatus(),
|
|
9436
|
-
className
|
|
9437
|
-
),
|
|
9438
|
-
...props,
|
|
9439
|
-
children: [
|
|
9440
|
-
/* @__PURE__ */ jsx47("p", { className: "text-text-950 font-bold text-lg", children: "Resultado" }),
|
|
9441
|
-
/* @__PURE__ */ jsx47("p", { className: "text-text-700 text-md", children: getLabelByAnswersStatus() })
|
|
9442
|
-
]
|
|
9443
|
-
}
|
|
9444
|
-
);
|
|
9445
|
-
}
|
|
9446
|
-
);
|
|
9447
|
-
var QuizTitle = forwardRef19(
|
|
9448
|
-
({ className, ...props }, ref) => {
|
|
9449
|
-
const {
|
|
9450
|
-
currentQuestionIndex,
|
|
9451
|
-
getTotalQuestions,
|
|
9452
|
-
getQuizTitle,
|
|
9453
|
-
timeElapsed,
|
|
9454
|
-
formatTime: formatTime2,
|
|
9455
|
-
isStarted
|
|
9456
|
-
} = useQuizStore();
|
|
9457
|
-
const [showExitConfirmation, setShowExitConfirmation] = useState19(false);
|
|
9458
|
-
const totalQuestions = getTotalQuestions();
|
|
9459
|
-
const quizTitle = getQuizTitle();
|
|
9460
|
-
const handleBackClick = () => {
|
|
9461
|
-
if (isStarted) {
|
|
9462
|
-
setShowExitConfirmation(true);
|
|
9463
|
-
} else {
|
|
9464
|
-
window.history.back();
|
|
9465
|
-
}
|
|
9466
|
-
};
|
|
9467
|
-
const handleConfirmExit = () => {
|
|
9468
|
-
setShowExitConfirmation(false);
|
|
9469
|
-
window.history.back();
|
|
9470
|
-
};
|
|
9471
|
-
const handleCancelExit = () => {
|
|
9472
|
-
setShowExitConfirmation(false);
|
|
9473
|
-
};
|
|
9474
|
-
return /* @__PURE__ */ jsxs34(Fragment10, { children: [
|
|
9475
|
-
/* @__PURE__ */ jsxs34(
|
|
9476
|
-
"div",
|
|
9477
|
-
{
|
|
9478
|
-
ref,
|
|
9479
|
-
className: cn(
|
|
9480
|
-
"flex flex-row justify-between items-center relative p-2",
|
|
9481
|
-
className
|
|
9482
|
-
),
|
|
9483
|
-
...props,
|
|
9484
|
-
children: [
|
|
9485
|
-
/* @__PURE__ */ jsx47(
|
|
9486
|
-
IconButton_default,
|
|
9487
|
-
{
|
|
9488
|
-
icon: /* @__PURE__ */ jsx47(CaretLeft3, { size: 24 }),
|
|
9489
|
-
size: "md",
|
|
9490
|
-
"aria-label": "Voltar",
|
|
9491
|
-
onClick: handleBackClick
|
|
9492
|
-
}
|
|
9493
|
-
),
|
|
9494
|
-
/* @__PURE__ */ jsxs34("span", { className: "flex flex-col gap-2 text-center", children: [
|
|
9495
|
-
/* @__PURE__ */ jsx47("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
|
|
9496
|
-
/* @__PURE__ */ jsx47("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
|
|
9497
|
-
] }),
|
|
9498
|
-
/* @__PURE__ */ jsx47("span", { className: "flex flex-row items-center justify-center", children: /* @__PURE__ */ jsx47(Badge_default, { variant: "outlined", action: "info", iconLeft: /* @__PURE__ */ jsx47(Clock2, {}), children: isStarted ? formatTime2(timeElapsed) : "00:00" }) })
|
|
9499
|
-
]
|
|
9500
|
-
}
|
|
9501
|
-
),
|
|
9502
|
-
/* @__PURE__ */ jsx47(
|
|
9503
|
-
AlertDialog,
|
|
9504
|
-
{
|
|
9505
|
-
isOpen: showExitConfirmation,
|
|
9506
|
-
onChangeOpen: setShowExitConfirmation,
|
|
9507
|
-
title: "Deseja sair?",
|
|
9508
|
-
description: "Se voc\xEA sair do simulado agora, todas as respostas ser\xE3o perdidas.",
|
|
9509
|
-
cancelButtonLabel: "Voltar e revisar",
|
|
9510
|
-
submitButtonLabel: "Sair Mesmo Assim",
|
|
9511
|
-
onSubmit: handleConfirmExit,
|
|
9512
|
-
onCancel: handleCancelExit
|
|
9513
|
-
}
|
|
9514
|
-
)
|
|
9515
|
-
] });
|
|
9516
|
-
}
|
|
9517
|
-
);
|
|
9518
9362
|
var QuizSubTitle = forwardRef19(
|
|
9519
9363
|
({ subTitle, ...props }, ref) => {
|
|
9520
9364
|
return /* @__PURE__ */ jsx47("div", { className: "px-4 pb-2 pt-6", ...props, ref, children: /* @__PURE__ */ jsx47("p", { className: "font-bold text-lg text-text-950", children: subTitle }) });
|
|
9521
9365
|
}
|
|
9522
9366
|
);
|
|
9523
|
-
var QuizHeader = () => {
|
|
9524
|
-
const { getCurrentQuestion, currentQuestionIndex } = useQuizStore();
|
|
9525
|
-
const currentQuestion = getCurrentQuestion();
|
|
9526
|
-
return /* @__PURE__ */ jsx47(
|
|
9527
|
-
HeaderAlternative,
|
|
9528
|
-
{
|
|
9529
|
-
title: currentQuestion ? `Quest\xE3o ${currentQuestionIndex + 1}` : "Quest\xE3o",
|
|
9530
|
-
subTitle: currentQuestion?.knowledgeMatrix?.[0]?.topic?.name ?? "",
|
|
9531
|
-
content: currentQuestion?.statement ?? ""
|
|
9532
|
-
}
|
|
9533
|
-
);
|
|
9534
|
-
};
|
|
9535
9367
|
var QuizContainer = forwardRef19(({ children, className, ...props }, ref) => {
|
|
9536
9368
|
return /* @__PURE__ */ jsx47(
|
|
9537
9369
|
"div",
|
|
@@ -9546,21 +9378,6 @@ var QuizContainer = forwardRef19(({ children, className, ...props }, ref) => {
|
|
|
9546
9378
|
}
|
|
9547
9379
|
);
|
|
9548
9380
|
});
|
|
9549
|
-
var QuizContent = forwardRef19(({ paddingBottom }) => {
|
|
9550
|
-
const { getCurrentQuestion } = useQuizStore();
|
|
9551
|
-
const currentQuestion = getCurrentQuestion();
|
|
9552
|
-
const questionComponents = {
|
|
9553
|
-
["ALTERNATIVA" /* ALTERNATIVA */]: QuizAlternative,
|
|
9554
|
-
["MULTIPLA_CHOICE" /* MULTIPLA_CHOICE */]: QuizMultipleChoice,
|
|
9555
|
-
["DISSERTATIVA" /* DISSERTATIVA */]: QuizDissertative,
|
|
9556
|
-
["VERDADEIRO_FALSO" /* VERDADEIRO_FALSO */]: QuizTrueOrFalse,
|
|
9557
|
-
["LIGAR_PONTOS" /* LIGAR_PONTOS */]: QuizConnectDots,
|
|
9558
|
-
["PREENCHER" /* PREENCHER */]: QuizFill,
|
|
9559
|
-
["IMAGEM" /* IMAGEM */]: QuizImageQuestion
|
|
9560
|
-
};
|
|
9561
|
-
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.questionType] : null;
|
|
9562
|
-
return QuestionComponent ? /* @__PURE__ */ jsx47(QuestionComponent, { paddingBottom }) : null;
|
|
9563
|
-
});
|
|
9564
9381
|
var QuizAlternative = ({ paddingBottom }) => {
|
|
9565
9382
|
const {
|
|
9566
9383
|
getCurrentQuestion,
|
|
@@ -9764,7 +9581,7 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
9764
9581
|
) }) : /* @__PURE__ */ jsx47("div", { className: "space-y-4", children: /* @__PURE__ */ jsx47("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: localAnswer || "Nenhuma resposta fornecida" }) }) }) }),
|
|
9765
9582
|
variant === "result" && currentQuestionResult?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ jsxs34(Fragment10, { children: [
|
|
9766
9583
|
/* @__PURE__ */ jsx47(QuizSubTitle, { subTitle: "Observa\xE7\xE3o do professor" }),
|
|
9767
|
-
/* @__PURE__ */ jsx47(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx47("p", { className: "text-text-600 text-md whitespace-pre-wrap", children:
|
|
9584
|
+
/* @__PURE__ */ jsx47(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx47("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: currentQuestionResult?.teacherFeedback }) })
|
|
9768
9585
|
] })
|
|
9769
9586
|
] });
|
|
9770
9587
|
};
|
|
@@ -10265,6 +10082,153 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
10265
10082
|
) })
|
|
10266
10083
|
] });
|
|
10267
10084
|
};
|
|
10085
|
+
|
|
10086
|
+
// src/components/Quiz/Quiz.tsx
|
|
10087
|
+
import { Fragment as Fragment11, jsx as jsx48, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
10088
|
+
var getQuizTypeConfig = (type) => {
|
|
10089
|
+
const QUIZ_TYPE_CONFIG = {
|
|
10090
|
+
["SIMULADO" /* SIMULADO */]: {
|
|
10091
|
+
label: "Simulado",
|
|
10092
|
+
article: "o",
|
|
10093
|
+
preposition: "do"
|
|
10094
|
+
},
|
|
10095
|
+
["QUESTIONARIO" /* QUESTIONARIO */]: {
|
|
10096
|
+
label: "Question\xE1rio",
|
|
10097
|
+
article: "o",
|
|
10098
|
+
preposition: "do"
|
|
10099
|
+
},
|
|
10100
|
+
["ATIVIDADE" /* ATIVIDADE */]: {
|
|
10101
|
+
label: "Atividade",
|
|
10102
|
+
article: "a",
|
|
10103
|
+
preposition: "da"
|
|
10104
|
+
}
|
|
10105
|
+
};
|
|
10106
|
+
const config = QUIZ_TYPE_CONFIG[type];
|
|
10107
|
+
return config || QUIZ_TYPE_CONFIG["SIMULADO" /* SIMULADO */];
|
|
10108
|
+
};
|
|
10109
|
+
var getTypeLabel = (type) => {
|
|
10110
|
+
return getQuizTypeConfig(type).label;
|
|
10111
|
+
};
|
|
10112
|
+
var getCompletionTitle = (type) => {
|
|
10113
|
+
const config = getQuizTypeConfig(type);
|
|
10114
|
+
return `Voc\xEA concluiu ${config.article} ${config.label.toLowerCase()}!`;
|
|
10115
|
+
};
|
|
10116
|
+
var getExitConfirmationText = (type) => {
|
|
10117
|
+
const config = getQuizTypeConfig(type);
|
|
10118
|
+
return `Se voc\xEA sair ${config.preposition} ${config.label.toLowerCase()} agora, todas as respostas ser\xE3o perdidas.`;
|
|
10119
|
+
};
|
|
10120
|
+
var getFinishConfirmationText = (type) => {
|
|
10121
|
+
const config = getQuizTypeConfig(type);
|
|
10122
|
+
return `Tem certeza que deseja finalizar ${config.article} ${config.label.toLowerCase()}?`;
|
|
10123
|
+
};
|
|
10124
|
+
var Quiz = forwardRef20(({ children, className, variant = "default", ...props }, ref) => {
|
|
10125
|
+
const { setVariant } = useQuizStore();
|
|
10126
|
+
useEffect19(() => {
|
|
10127
|
+
setVariant(variant);
|
|
10128
|
+
}, [variant, setVariant]);
|
|
10129
|
+
return /* @__PURE__ */ jsx48("div", { ref, className: cn("flex flex-col", className), ...props, children });
|
|
10130
|
+
});
|
|
10131
|
+
var QuizTitle = forwardRef20(
|
|
10132
|
+
({ className, ...props }, ref) => {
|
|
10133
|
+
const {
|
|
10134
|
+
quiz,
|
|
10135
|
+
currentQuestionIndex,
|
|
10136
|
+
getTotalQuestions,
|
|
10137
|
+
getQuizTitle,
|
|
10138
|
+
timeElapsed,
|
|
10139
|
+
formatTime: formatTime2,
|
|
10140
|
+
isStarted
|
|
10141
|
+
} = useQuizStore();
|
|
10142
|
+
const [showExitConfirmation, setShowExitConfirmation] = useState20(false);
|
|
10143
|
+
const totalQuestions = getTotalQuestions();
|
|
10144
|
+
const quizTitle = getQuizTitle();
|
|
10145
|
+
const handleBackClick = () => {
|
|
10146
|
+
if (isStarted) {
|
|
10147
|
+
setShowExitConfirmation(true);
|
|
10148
|
+
} else {
|
|
10149
|
+
window.history.back();
|
|
10150
|
+
}
|
|
10151
|
+
};
|
|
10152
|
+
const handleConfirmExit = () => {
|
|
10153
|
+
setShowExitConfirmation(false);
|
|
10154
|
+
window.history.back();
|
|
10155
|
+
};
|
|
10156
|
+
const handleCancelExit = () => {
|
|
10157
|
+
setShowExitConfirmation(false);
|
|
10158
|
+
};
|
|
10159
|
+
return /* @__PURE__ */ jsxs35(Fragment11, { children: [
|
|
10160
|
+
/* @__PURE__ */ jsxs35(
|
|
10161
|
+
"div",
|
|
10162
|
+
{
|
|
10163
|
+
ref,
|
|
10164
|
+
className: cn(
|
|
10165
|
+
"flex flex-row justify-between items-center relative p-2",
|
|
10166
|
+
className
|
|
10167
|
+
),
|
|
10168
|
+
...props,
|
|
10169
|
+
children: [
|
|
10170
|
+
/* @__PURE__ */ jsx48(
|
|
10171
|
+
IconButton_default,
|
|
10172
|
+
{
|
|
10173
|
+
icon: /* @__PURE__ */ jsx48(CaretLeft3, { size: 24 }),
|
|
10174
|
+
size: "md",
|
|
10175
|
+
"aria-label": "Voltar",
|
|
10176
|
+
onClick: handleBackClick
|
|
10177
|
+
}
|
|
10178
|
+
),
|
|
10179
|
+
/* @__PURE__ */ jsxs35("span", { className: "flex flex-col gap-2 text-center", children: [
|
|
10180
|
+
/* @__PURE__ */ jsx48("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
|
|
10181
|
+
/* @__PURE__ */ jsx48("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
|
|
10182
|
+
] }),
|
|
10183
|
+
/* @__PURE__ */ jsx48("span", { className: "flex flex-row items-center justify-center", children: /* @__PURE__ */ jsx48(Badge_default, { variant: "outlined", action: "info", iconLeft: /* @__PURE__ */ jsx48(Clock2, {}), children: isStarted ? formatTime2(timeElapsed) : "00:00" }) })
|
|
10184
|
+
]
|
|
10185
|
+
}
|
|
10186
|
+
),
|
|
10187
|
+
/* @__PURE__ */ jsx48(
|
|
10188
|
+
AlertDialog,
|
|
10189
|
+
{
|
|
10190
|
+
isOpen: showExitConfirmation,
|
|
10191
|
+
onChangeOpen: setShowExitConfirmation,
|
|
10192
|
+
title: "Deseja sair?",
|
|
10193
|
+
description: getExitConfirmationText(
|
|
10194
|
+
quiz?.type || "SIMULADO" /* SIMULADO */
|
|
10195
|
+
),
|
|
10196
|
+
cancelButtonLabel: "Voltar e revisar",
|
|
10197
|
+
submitButtonLabel: "Sair Mesmo Assim",
|
|
10198
|
+
onSubmit: handleConfirmExit,
|
|
10199
|
+
onCancel: handleCancelExit
|
|
10200
|
+
}
|
|
10201
|
+
)
|
|
10202
|
+
] });
|
|
10203
|
+
}
|
|
10204
|
+
);
|
|
10205
|
+
var QuizHeader = () => {
|
|
10206
|
+
const { getCurrentQuestion, currentQuestionIndex } = useQuizStore();
|
|
10207
|
+
const currentQuestion = getCurrentQuestion();
|
|
10208
|
+
return /* @__PURE__ */ jsx48(
|
|
10209
|
+
HeaderAlternative,
|
|
10210
|
+
{
|
|
10211
|
+
title: currentQuestion ? `Quest\xE3o ${currentQuestionIndex + 1}` : "Quest\xE3o",
|
|
10212
|
+
subTitle: currentQuestion?.knowledgeMatrix?.[0]?.topic?.name ?? "",
|
|
10213
|
+
content: currentQuestion?.statement ?? ""
|
|
10214
|
+
}
|
|
10215
|
+
);
|
|
10216
|
+
};
|
|
10217
|
+
var QuizContent = forwardRef20(({ paddingBottom }) => {
|
|
10218
|
+
const { getCurrentQuestion } = useQuizStore();
|
|
10219
|
+
const currentQuestion = getCurrentQuestion();
|
|
10220
|
+
const questionComponents = {
|
|
10221
|
+
["ALTERNATIVA" /* ALTERNATIVA */]: QuizAlternative,
|
|
10222
|
+
["MULTIPLA_CHOICE" /* MULTIPLA_CHOICE */]: QuizMultipleChoice,
|
|
10223
|
+
["DISSERTATIVA" /* DISSERTATIVA */]: QuizDissertative,
|
|
10224
|
+
["VERDADEIRO_FALSO" /* VERDADEIRO_FALSO */]: QuizTrueOrFalse,
|
|
10225
|
+
["LIGAR_PONTOS" /* LIGAR_PONTOS */]: QuizConnectDots,
|
|
10226
|
+
["PREENCHER" /* PREENCHER */]: QuizFill,
|
|
10227
|
+
["IMAGEM" /* IMAGEM */]: QuizImageQuestion
|
|
10228
|
+
};
|
|
10229
|
+
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.questionType] : null;
|
|
10230
|
+
return QuestionComponent ? /* @__PURE__ */ jsx48(QuestionComponent, { paddingBottom }) : null;
|
|
10231
|
+
});
|
|
10268
10232
|
var QuizQuestionList = ({
|
|
10269
10233
|
filterType = "all",
|
|
10270
10234
|
onQuestionClick
|
|
@@ -10310,18 +10274,18 @@ var QuizQuestionList = ({
|
|
|
10310
10274
|
return "Em branco";
|
|
10311
10275
|
}
|
|
10312
10276
|
};
|
|
10313
|
-
return /* @__PURE__ */
|
|
10314
|
-
Object.entries(filteredGroupedQuestions).length == 0 && /* @__PURE__ */
|
|
10277
|
+
return /* @__PURE__ */ jsxs35("div", { className: "space-y-6 px-4 h-full", children: [
|
|
10278
|
+
Object.entries(filteredGroupedQuestions).length == 0 && /* @__PURE__ */ jsx48("div", { className: "flex items-center justify-center text-gray-500 py-8 h-full", children: /* @__PURE__ */ jsx48("p", { className: "text-lg", children: "Nenhum resultado" }) }),
|
|
10315
10279
|
Object.entries(filteredGroupedQuestions).map(
|
|
10316
|
-
([subjectId, questions]) => /* @__PURE__ */
|
|
10317
|
-
/* @__PURE__ */
|
|
10318
|
-
/* @__PURE__ */
|
|
10319
|
-
/* @__PURE__ */
|
|
10280
|
+
([subjectId, questions]) => /* @__PURE__ */ jsxs35("section", { className: "flex flex-col gap-2", children: [
|
|
10281
|
+
/* @__PURE__ */ jsxs35("span", { className: "pt-6 pb-4 flex flex-row gap-2", children: [
|
|
10282
|
+
/* @__PURE__ */ jsx48("div", { className: "bg-primary-500 p-1 rounded-sm flex items-center justify-center", children: /* @__PURE__ */ jsx48(BookOpen, { size: 17, className: "text-white" }) }),
|
|
10283
|
+
/* @__PURE__ */ jsx48("p", { className: "text-text-800 font-bold text-lg", children: questions?.[0]?.knowledgeMatrix?.[0]?.subject?.name ?? "Sem mat\xE9ria" })
|
|
10320
10284
|
] }),
|
|
10321
|
-
/* @__PURE__ */
|
|
10285
|
+
/* @__PURE__ */ jsx48("ul", { className: "flex flex-col gap-2", children: questions.map((question) => {
|
|
10322
10286
|
const status = getQuestionStatus(question.id);
|
|
10323
10287
|
const questionNumber = getQuestionIndex(question.id);
|
|
10324
|
-
return /* @__PURE__ */
|
|
10288
|
+
return /* @__PURE__ */ jsx48(
|
|
10325
10289
|
CardStatus,
|
|
10326
10290
|
{
|
|
10327
10291
|
header: `Quest\xE3o ${questionNumber.toString().padStart(2, "0")}`,
|
|
@@ -10338,16 +10302,21 @@ var QuizQuestionList = ({
|
|
|
10338
10302
|
)
|
|
10339
10303
|
] });
|
|
10340
10304
|
};
|
|
10341
|
-
var QuizFooter =
|
|
10305
|
+
var QuizFooter = forwardRef20(
|
|
10342
10306
|
({
|
|
10343
10307
|
className,
|
|
10344
10308
|
onGoToSimulated,
|
|
10345
10309
|
onDetailResult,
|
|
10346
10310
|
handleFinishSimulated,
|
|
10311
|
+
onGoToNextModule,
|
|
10312
|
+
onRepeat,
|
|
10313
|
+
onTryLater,
|
|
10347
10314
|
resultImageComponent,
|
|
10315
|
+
resultIncorrectImageComponent,
|
|
10348
10316
|
...props
|
|
10349
10317
|
}, ref) => {
|
|
10350
10318
|
const {
|
|
10319
|
+
quiz,
|
|
10351
10320
|
currentQuestionIndex,
|
|
10352
10321
|
getTotalQuestions,
|
|
10353
10322
|
goToNextQuestion,
|
|
@@ -10366,23 +10335,36 @@ var QuizFooter = forwardRef19(
|
|
|
10366
10335
|
const currentAnswer = getCurrentAnswer();
|
|
10367
10336
|
const currentQuestion = getCurrentQuestion();
|
|
10368
10337
|
const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false;
|
|
10369
|
-
const [
|
|
10370
|
-
const [
|
|
10371
|
-
const
|
|
10372
|
-
const
|
|
10373
|
-
const
|
|
10338
|
+
const [activeModal, setActiveModal] = useState20(null);
|
|
10339
|
+
const [filterType, setFilterType] = useState20("all");
|
|
10340
|
+
const openModal = (modalName) => setActiveModal(modalName);
|
|
10341
|
+
const closeModal = () => setActiveModal(null);
|
|
10342
|
+
const isModalOpen = (modalName) => activeModal === modalName;
|
|
10374
10343
|
const unansweredQuestions = getUnansweredQuestionsFromUserAnswers();
|
|
10375
10344
|
const allQuestions = getTotalQuestions();
|
|
10345
|
+
const stats = getQuestionResultStatistics();
|
|
10346
|
+
const correctAnswers = stats?.correctAnswers;
|
|
10347
|
+
const totalAnswers = stats?.totalAnswered;
|
|
10348
|
+
const quizType = quiz?.type || "SIMULADO" /* SIMULADO */;
|
|
10349
|
+
const quizTypeLabel = getTypeLabel(quizType);
|
|
10376
10350
|
const handleFinishQuiz = async () => {
|
|
10377
10351
|
if (unansweredQuestions.length > 0) {
|
|
10378
|
-
|
|
10352
|
+
openModal("alertDialog");
|
|
10379
10353
|
return;
|
|
10380
10354
|
}
|
|
10381
10355
|
try {
|
|
10382
10356
|
if (handleFinishSimulated) {
|
|
10383
10357
|
await Promise.resolve(handleFinishSimulated());
|
|
10384
10358
|
}
|
|
10385
|
-
|
|
10359
|
+
if (quizType === "QUESTIONARIO" /* QUESTIONARIO */ && typeof correctAnswers === "number" && typeof totalAnswers === "number" && correctAnswers === totalAnswers) {
|
|
10360
|
+
openModal("modalQuestionnaireAllCorrect");
|
|
10361
|
+
return;
|
|
10362
|
+
}
|
|
10363
|
+
if (quizType === "QUESTIONARIO" /* QUESTIONARIO */ && typeof correctAnswers === "number" && correctAnswers === 0) {
|
|
10364
|
+
openModal("modalQuestionnaireAllIncorrect");
|
|
10365
|
+
return;
|
|
10366
|
+
}
|
|
10367
|
+
openModal("modalResult");
|
|
10386
10368
|
} catch (err) {
|
|
10387
10369
|
console.error("handleFinishSimulated failed:", err);
|
|
10388
10370
|
return;
|
|
@@ -10393,16 +10375,23 @@ var QuizFooter = forwardRef19(
|
|
|
10393
10375
|
if (handleFinishSimulated) {
|
|
10394
10376
|
await Promise.resolve(handleFinishSimulated());
|
|
10395
10377
|
}
|
|
10396
|
-
|
|
10397
|
-
|
|
10378
|
+
if (quizType === "QUESTIONARIO" /* QUESTIONARIO */ && typeof correctAnswers === "number" && typeof totalAnswers === "number" && correctAnswers === totalAnswers) {
|
|
10379
|
+
openModal("modalQuestionnaireAllCorrect");
|
|
10380
|
+
return;
|
|
10381
|
+
}
|
|
10382
|
+
if (quizType === "QUESTIONARIO" /* QUESTIONARIO */ && typeof correctAnswers === "number" && correctAnswers === 0) {
|
|
10383
|
+
openModal("modalQuestionnaireAllIncorrect");
|
|
10384
|
+
return;
|
|
10385
|
+
}
|
|
10386
|
+
openModal("modalResult");
|
|
10398
10387
|
} catch (err) {
|
|
10399
10388
|
console.error("handleFinishSimulated failed:", err);
|
|
10400
|
-
|
|
10389
|
+
closeModal();
|
|
10401
10390
|
return;
|
|
10402
10391
|
}
|
|
10403
10392
|
};
|
|
10404
|
-
return /* @__PURE__ */
|
|
10405
|
-
/* @__PURE__ */
|
|
10393
|
+
return /* @__PURE__ */ jsxs35(Fragment11, { children: [
|
|
10394
|
+
/* @__PURE__ */ jsx48(
|
|
10406
10395
|
"footer",
|
|
10407
10396
|
{
|
|
10408
10397
|
ref,
|
|
@@ -10411,17 +10400,17 @@ var QuizFooter = forwardRef19(
|
|
|
10411
10400
|
className
|
|
10412
10401
|
),
|
|
10413
10402
|
...props,
|
|
10414
|
-
children: variant === "default" ? /* @__PURE__ */
|
|
10415
|
-
/* @__PURE__ */
|
|
10416
|
-
/* @__PURE__ */
|
|
10403
|
+
children: variant === "default" ? /* @__PURE__ */ jsxs35(Fragment11, { children: [
|
|
10404
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex flex-row items-center gap-1", children: [
|
|
10405
|
+
/* @__PURE__ */ jsx48(
|
|
10417
10406
|
IconButton_default,
|
|
10418
10407
|
{
|
|
10419
|
-
icon: /* @__PURE__ */
|
|
10408
|
+
icon: /* @__PURE__ */ jsx48(SquaresFour, { size: 24, className: "text-text-950" }),
|
|
10420
10409
|
size: "md",
|
|
10421
|
-
onClick: () =>
|
|
10410
|
+
onClick: () => openModal("modalNavigate")
|
|
10422
10411
|
}
|
|
10423
10412
|
),
|
|
10424
|
-
isFirstQuestion ? /* @__PURE__ */
|
|
10413
|
+
isFirstQuestion ? /* @__PURE__ */ jsx48(
|
|
10425
10414
|
Button_default,
|
|
10426
10415
|
{
|
|
10427
10416
|
variant: "outline",
|
|
@@ -10432,13 +10421,13 @@ var QuizFooter = forwardRef19(
|
|
|
10432
10421
|
},
|
|
10433
10422
|
children: "Pular"
|
|
10434
10423
|
}
|
|
10435
|
-
) : /* @__PURE__ */
|
|
10424
|
+
) : /* @__PURE__ */ jsx48(
|
|
10436
10425
|
Button_default,
|
|
10437
10426
|
{
|
|
10438
10427
|
size: "medium",
|
|
10439
10428
|
variant: "link",
|
|
10440
10429
|
action: "primary",
|
|
10441
|
-
iconLeft: /* @__PURE__ */
|
|
10430
|
+
iconLeft: /* @__PURE__ */ jsx48(CaretLeft3, { size: 18 }),
|
|
10442
10431
|
onClick: () => {
|
|
10443
10432
|
goToPreviousQuestion();
|
|
10444
10433
|
},
|
|
@@ -10446,7 +10435,7 @@ var QuizFooter = forwardRef19(
|
|
|
10446
10435
|
}
|
|
10447
10436
|
)
|
|
10448
10437
|
] }),
|
|
10449
|
-
!isFirstQuestion && !isLastQuestion && /* @__PURE__ */
|
|
10438
|
+
!isFirstQuestion && !isLastQuestion && /* @__PURE__ */ jsx48(
|
|
10450
10439
|
Button_default,
|
|
10451
10440
|
{
|
|
10452
10441
|
size: "small",
|
|
@@ -10459,7 +10448,7 @@ var QuizFooter = forwardRef19(
|
|
|
10459
10448
|
children: "Pular"
|
|
10460
10449
|
}
|
|
10461
10450
|
),
|
|
10462
|
-
isLastQuestion ? /* @__PURE__ */
|
|
10451
|
+
isLastQuestion ? /* @__PURE__ */ jsx48(
|
|
10463
10452
|
Button_default,
|
|
10464
10453
|
{
|
|
10465
10454
|
size: "medium",
|
|
@@ -10469,13 +10458,13 @@ var QuizFooter = forwardRef19(
|
|
|
10469
10458
|
onClick: handleFinishQuiz,
|
|
10470
10459
|
children: "Finalizar"
|
|
10471
10460
|
}
|
|
10472
|
-
) : /* @__PURE__ */
|
|
10461
|
+
) : /* @__PURE__ */ jsx48(
|
|
10473
10462
|
Button_default,
|
|
10474
10463
|
{
|
|
10475
10464
|
size: "medium",
|
|
10476
10465
|
variant: "link",
|
|
10477
10466
|
action: "primary",
|
|
10478
|
-
iconRight: /* @__PURE__ */
|
|
10467
|
+
iconRight: /* @__PURE__ */ jsx48(CaretRight5, { size: 18 }),
|
|
10479
10468
|
disabled: !currentAnswer && !isCurrentQuestionSkipped,
|
|
10480
10469
|
onClick: () => {
|
|
10481
10470
|
goToNextQuestion();
|
|
@@ -10483,157 +10472,313 @@ var QuizFooter = forwardRef19(
|
|
|
10483
10472
|
children: "Avan\xE7ar"
|
|
10484
10473
|
}
|
|
10485
10474
|
)
|
|
10486
|
-
] }) : /* @__PURE__ */
|
|
10475
|
+
] }) : /* @__PURE__ */ jsx48("div", { className: "flex flex-row items-center justify-end w-full", children: /* @__PURE__ */ jsx48(
|
|
10487
10476
|
Button_default,
|
|
10488
10477
|
{
|
|
10489
10478
|
variant: "solid",
|
|
10490
10479
|
action: "primary",
|
|
10491
10480
|
size: "medium",
|
|
10492
|
-
onClick: () =>
|
|
10481
|
+
onClick: () => openModal("modalResolution"),
|
|
10493
10482
|
children: "Ver Resolu\xE7\xE3o"
|
|
10494
10483
|
}
|
|
10495
10484
|
) })
|
|
10496
10485
|
}
|
|
10497
10486
|
),
|
|
10498
|
-
/* @__PURE__ */
|
|
10487
|
+
/* @__PURE__ */ jsx48(
|
|
10499
10488
|
AlertDialog,
|
|
10500
10489
|
{
|
|
10501
|
-
isOpen:
|
|
10502
|
-
onChangeOpen:
|
|
10503
|
-
title:
|
|
10504
|
-
description: unansweredQuestions.length > 0 ? `Voc\xEA deixou as quest\xF5es ${unansweredQuestions.join(", ")} sem resposta. Finalizar agora pode impactar seu desempenho.` :
|
|
10490
|
+
isOpen: isModalOpen("alertDialog"),
|
|
10491
|
+
onChangeOpen: (open) => open ? openModal("alertDialog") : closeModal(),
|
|
10492
|
+
title: `Finalizar ${quizTypeLabel.toLowerCase()}?`,
|
|
10493
|
+
description: unansweredQuestions.length > 0 ? `Voc\xEA deixou as quest\xF5es ${unansweredQuestions.join(", ")} sem resposta. Finalizar agora pode impactar seu desempenho.` : getFinishConfirmationText(quizType),
|
|
10505
10494
|
cancelButtonLabel: "Voltar e revisar",
|
|
10506
10495
|
submitButtonLabel: "Finalizar Mesmo Assim",
|
|
10507
10496
|
onSubmit: handleAlertSubmit
|
|
10508
10497
|
}
|
|
10509
10498
|
),
|
|
10510
|
-
/* @__PURE__ */
|
|
10499
|
+
/* @__PURE__ */ jsx48(
|
|
10511
10500
|
Modal_default,
|
|
10512
10501
|
{
|
|
10513
|
-
isOpen:
|
|
10514
|
-
onClose:
|
|
10502
|
+
isOpen: isModalOpen("modalResult"),
|
|
10503
|
+
onClose: closeModal,
|
|
10515
10504
|
title: "",
|
|
10516
10505
|
closeOnEscape: false,
|
|
10517
10506
|
hideCloseButton: true,
|
|
10518
10507
|
size: "md",
|
|
10519
|
-
children: /* @__PURE__ */
|
|
10520
|
-
resultImageComponent ? /* @__PURE__ */
|
|
10521
|
-
/* @__PURE__ */
|
|
10522
|
-
/* @__PURE__ */
|
|
10523
|
-
/* @__PURE__ */
|
|
10524
|
-
"Voc\xEA acertou",
|
|
10525
|
-
|
|
10526
|
-
|
|
10527
|
-
" de",
|
|
10528
|
-
" ",
|
|
10508
|
+
children: /* @__PURE__ */ jsxs35("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
10509
|
+
resultImageComponent ? /* @__PURE__ */ jsx48("div", { className: "w-[282px] h-auto", children: resultImageComponent }) : /* @__PURE__ */ jsx48("div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ jsx48("span", { className: "text-gray-500 text-sm", children: "Imagem de resultado" }) }),
|
|
10510
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
10511
|
+
/* @__PURE__ */ jsx48("h2", { className: "text-text-950 font-bold text-lg", children: getCompletionTitle(quizType) }),
|
|
10512
|
+
/* @__PURE__ */ jsxs35("p", { className: "text-text-500 font-sm", children: [
|
|
10513
|
+
"Voc\xEA acertou ",
|
|
10514
|
+
correctAnswers ?? "--",
|
|
10515
|
+
" de ",
|
|
10529
10516
|
allQuestions,
|
|
10530
|
-
"
|
|
10517
|
+
" ",
|
|
10518
|
+
"quest\xF5es."
|
|
10531
10519
|
] })
|
|
10532
10520
|
] }),
|
|
10533
|
-
/* @__PURE__ */
|
|
10534
|
-
/* @__PURE__ */
|
|
10521
|
+
/* @__PURE__ */ jsxs35("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: [
|
|
10522
|
+
/* @__PURE__ */ jsxs35(
|
|
10535
10523
|
Button_default,
|
|
10536
10524
|
{
|
|
10537
10525
|
variant: "outline",
|
|
10538
10526
|
className: "w-full",
|
|
10539
10527
|
size: "small",
|
|
10540
10528
|
onClick: onGoToSimulated,
|
|
10541
|
-
children:
|
|
10529
|
+
children: [
|
|
10530
|
+
"Ir para ",
|
|
10531
|
+
quizTypeLabel.toLocaleLowerCase(),
|
|
10532
|
+
"s"
|
|
10533
|
+
]
|
|
10542
10534
|
}
|
|
10543
10535
|
),
|
|
10544
|
-
/* @__PURE__ */
|
|
10536
|
+
/* @__PURE__ */ jsx48(Button_default, { className: "w-full", onClick: onDetailResult, children: "Detalhar resultado" })
|
|
10545
10537
|
] })
|
|
10546
10538
|
] })
|
|
10547
10539
|
}
|
|
10548
10540
|
),
|
|
10549
|
-
/* @__PURE__ */
|
|
10541
|
+
/* @__PURE__ */ jsx48(
|
|
10550
10542
|
Modal_default,
|
|
10551
10543
|
{
|
|
10552
|
-
isOpen:
|
|
10553
|
-
onClose:
|
|
10544
|
+
isOpen: isModalOpen("modalNavigate"),
|
|
10545
|
+
onClose: closeModal,
|
|
10554
10546
|
title: "Quest\xF5es",
|
|
10555
10547
|
size: "lg",
|
|
10556
|
-
children: /* @__PURE__ */
|
|
10557
|
-
/* @__PURE__ */
|
|
10558
|
-
/* @__PURE__ */
|
|
10559
|
-
/* @__PURE__ */
|
|
10560
|
-
/* @__PURE__ */
|
|
10548
|
+
children: /* @__PURE__ */ jsxs35("div", { className: "flex flex-col w-full not-lg:h-[calc(100vh-200px)] lg:max-h-[687px] lg:h-[687px]", children: [
|
|
10549
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex flex-row justify-between items-center py-6 pt-6 pb-4 border-b border-border-200 flex-shrink-0", children: [
|
|
10550
|
+
/* @__PURE__ */ jsx48("p", { className: "text-text-950 font-bold text-lg", children: "Filtrar por" }),
|
|
10551
|
+
/* @__PURE__ */ jsx48("span", { className: "max-w-[266px]", children: /* @__PURE__ */ jsxs35(Select_default, { value: filterType, onValueChange: setFilterType, children: [
|
|
10552
|
+
/* @__PURE__ */ jsx48(
|
|
10561
10553
|
SelectTrigger,
|
|
10562
10554
|
{
|
|
10563
10555
|
variant: "rounded",
|
|
10564
10556
|
className: "max-w-[266px] min-w-[160px]",
|
|
10565
|
-
children: /* @__PURE__ */
|
|
10557
|
+
children: /* @__PURE__ */ jsx48(SelectValue, { placeholder: "Selecione uma op\xE7\xE3o" })
|
|
10566
10558
|
}
|
|
10567
10559
|
),
|
|
10568
|
-
/* @__PURE__ */
|
|
10569
|
-
/* @__PURE__ */
|
|
10570
|
-
/* @__PURE__ */
|
|
10571
|
-
/* @__PURE__ */
|
|
10560
|
+
/* @__PURE__ */ jsxs35(SelectContent, { children: [
|
|
10561
|
+
/* @__PURE__ */ jsx48(SelectItem, { value: "all", children: "Todas" }),
|
|
10562
|
+
/* @__PURE__ */ jsx48(SelectItem, { value: "unanswered", children: "Em branco" }),
|
|
10563
|
+
/* @__PURE__ */ jsx48(SelectItem, { value: "answered", children: "Respondidas" })
|
|
10572
10564
|
] })
|
|
10573
10565
|
] }) })
|
|
10574
10566
|
] }),
|
|
10575
|
-
/* @__PURE__ */
|
|
10567
|
+
/* @__PURE__ */ jsx48("div", { className: "flex flex-col gap-2 flex-1 min-h-0 overflow-y-auto", children: /* @__PURE__ */ jsx48(
|
|
10576
10568
|
QuizQuestionList,
|
|
10577
10569
|
{
|
|
10578
10570
|
filterType,
|
|
10579
|
-
onQuestionClick:
|
|
10571
|
+
onQuestionClick: closeModal
|
|
10580
10572
|
}
|
|
10581
10573
|
) })
|
|
10582
10574
|
] })
|
|
10583
10575
|
}
|
|
10584
10576
|
),
|
|
10585
|
-
/* @__PURE__ */
|
|
10577
|
+
/* @__PURE__ */ jsx48(
|
|
10586
10578
|
Modal_default,
|
|
10587
10579
|
{
|
|
10588
|
-
isOpen:
|
|
10589
|
-
onClose:
|
|
10580
|
+
isOpen: isModalOpen("modalResolution"),
|
|
10581
|
+
onClose: closeModal,
|
|
10590
10582
|
title: "Resolu\xE7\xE3o",
|
|
10591
10583
|
size: "lg",
|
|
10592
10584
|
children: currentQuestion?.solutionExplanation
|
|
10593
10585
|
}
|
|
10586
|
+
),
|
|
10587
|
+
/* @__PURE__ */ jsx48(
|
|
10588
|
+
Modal_default,
|
|
10589
|
+
{
|
|
10590
|
+
isOpen: isModalOpen("modalQuestionnaireAllCorrect"),
|
|
10591
|
+
onClose: closeModal,
|
|
10592
|
+
title: "",
|
|
10593
|
+
closeOnEscape: false,
|
|
10594
|
+
hideCloseButton: true,
|
|
10595
|
+
size: "md",
|
|
10596
|
+
children: /* @__PURE__ */ jsxs35("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
10597
|
+
resultImageComponent ? /* @__PURE__ */ jsx48("div", { className: "w-[282px] h-auto", children: resultImageComponent }) : /* @__PURE__ */ jsx48("div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ jsx48("span", { className: "text-gray-500 text-sm", children: "Imagem de resultado" }) }),
|
|
10598
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
10599
|
+
/* @__PURE__ */ jsx48("h2", { className: "text-text-950 font-bold text-lg", children: "\u{1F389} Parab\xE9ns!" }),
|
|
10600
|
+
/* @__PURE__ */ jsx48("p", { className: "text-text-500 font-sm", children: "Voc\xEA concluiu o m\xF3dulo Movimento Uniforme." })
|
|
10601
|
+
] }),
|
|
10602
|
+
/* @__PURE__ */ jsx48("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: /* @__PURE__ */ jsx48(Button_default, { className: "w-full", onClick: onGoToNextModule, children: "Pr\xF3ximo m\xF3dulo" }) })
|
|
10603
|
+
] })
|
|
10604
|
+
}
|
|
10605
|
+
),
|
|
10606
|
+
/* @__PURE__ */ jsx48(
|
|
10607
|
+
Modal_default,
|
|
10608
|
+
{
|
|
10609
|
+
isOpen: isModalOpen("modalQuestionnaireAllIncorrect"),
|
|
10610
|
+
onClose: closeModal,
|
|
10611
|
+
title: "",
|
|
10612
|
+
closeOnEscape: false,
|
|
10613
|
+
hideCloseButton: true,
|
|
10614
|
+
size: "md",
|
|
10615
|
+
children: /* @__PURE__ */ jsxs35("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
10616
|
+
resultIncorrectImageComponent ? /* @__PURE__ */ jsx48("div", { className: "w-[282px] h-auto", children: resultIncorrectImageComponent }) : /* @__PURE__ */ jsx48("div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ jsx48("span", { className: "text-gray-500 text-sm", children: "Imagem de resultado" }) }),
|
|
10617
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
10618
|
+
/* @__PURE__ */ jsx48("h2", { className: "text-text-950 font-bold text-lg", children: "\u{1F615} N\xE3o foi dessa vez..." }),
|
|
10619
|
+
/* @__PURE__ */ jsx48("p", { className: "text-text-500 font-sm", children: "Voc\xEA tirou 0 no question\xE1rio, mas n\xE3o se preocupe! Isso \xE9 apenas uma oportunidade de aprendizado." }),
|
|
10620
|
+
/* @__PURE__ */ jsx48("p", { className: "text-text-500 font-sm", children: "Que tal tentar novamente para melhorar sua nota? Estamos aqui para te ajudar a entender o conte\xFAdo e evoluir." }),
|
|
10621
|
+
/* @__PURE__ */ jsx48("p", { className: "text-text-500 font-sm", children: "Clique em Repetir Question\xE1rio e mostre do que voc\xEA \xE9 capaz! \u{1F4AA}" })
|
|
10622
|
+
] }),
|
|
10623
|
+
/* @__PURE__ */ jsxs35("div", { className: "flex flex-row justify-center items-center gap-2 w-full", children: [
|
|
10624
|
+
/* @__PURE__ */ jsx48(
|
|
10625
|
+
Button_default,
|
|
10626
|
+
{
|
|
10627
|
+
type: "button",
|
|
10628
|
+
variant: "link",
|
|
10629
|
+
size: "small",
|
|
10630
|
+
className: "w-auto",
|
|
10631
|
+
onClick: () => {
|
|
10632
|
+
closeModal();
|
|
10633
|
+
openModal("alertDialogTryLater");
|
|
10634
|
+
},
|
|
10635
|
+
children: "Tentar depois"
|
|
10636
|
+
}
|
|
10637
|
+
),
|
|
10638
|
+
/* @__PURE__ */ jsx48(
|
|
10639
|
+
Button_default,
|
|
10640
|
+
{
|
|
10641
|
+
variant: "outline",
|
|
10642
|
+
size: "small",
|
|
10643
|
+
className: "w-auto",
|
|
10644
|
+
onClick: onDetailResult,
|
|
10645
|
+
children: "Detalhar resultado"
|
|
10646
|
+
}
|
|
10647
|
+
),
|
|
10648
|
+
/* @__PURE__ */ jsx48(
|
|
10649
|
+
Button_default,
|
|
10650
|
+
{
|
|
10651
|
+
className: "w-auto",
|
|
10652
|
+
size: "small",
|
|
10653
|
+
onClick: onGoToNextModule,
|
|
10654
|
+
children: "Pr\xF3ximo m\xF3dulo"
|
|
10655
|
+
}
|
|
10656
|
+
)
|
|
10657
|
+
] })
|
|
10658
|
+
] })
|
|
10659
|
+
}
|
|
10660
|
+
),
|
|
10661
|
+
/* @__PURE__ */ jsx48(
|
|
10662
|
+
AlertDialog,
|
|
10663
|
+
{
|
|
10664
|
+
isOpen: isModalOpen("alertDialogTryLater"),
|
|
10665
|
+
onChangeOpen: (open) => open ? openModal("alertDialogTryLater") : closeModal(),
|
|
10666
|
+
title: "Tentar depois?",
|
|
10667
|
+
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.",
|
|
10668
|
+
cancelButtonLabel: "Repetir question\xE1rio",
|
|
10669
|
+
submitButtonLabel: "Tentar depois",
|
|
10670
|
+
onSubmit: () => {
|
|
10671
|
+
onTryLater?.();
|
|
10672
|
+
closeModal();
|
|
10673
|
+
},
|
|
10674
|
+
onCancel: () => {
|
|
10675
|
+
onRepeat?.();
|
|
10676
|
+
closeModal();
|
|
10677
|
+
}
|
|
10678
|
+
}
|
|
10594
10679
|
)
|
|
10595
10680
|
] });
|
|
10596
10681
|
}
|
|
10597
10682
|
);
|
|
10683
|
+
|
|
10684
|
+
// src/components/Quiz/QuizResult.tsx
|
|
10685
|
+
import { forwardRef as forwardRef21, useEffect as useEffect20, useState as useState21 } from "react";
|
|
10686
|
+
import { Clock as Clock3 } from "phosphor-react";
|
|
10687
|
+
import { jsx as jsx49, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
10598
10688
|
var QuizBadge = ({
|
|
10599
10689
|
subtype
|
|
10600
10690
|
}) => {
|
|
10601
10691
|
switch (subtype) {
|
|
10602
10692
|
case "PROVA" /* PROVA */:
|
|
10603
|
-
return /* @__PURE__ */
|
|
10693
|
+
return /* @__PURE__ */ jsx49(Badge_default, { variant: "examsOutlined", action: "exam2", "data-testid": "quiz-badge", children: "Prova" });
|
|
10604
10694
|
case "ENEM_PROVA_1" /* ENEM_PROVA_1 */:
|
|
10605
10695
|
case "ENEM_PROVA_2" /* ENEM_PROVA_2 */:
|
|
10606
|
-
return /* @__PURE__ */
|
|
10696
|
+
return /* @__PURE__ */ jsx49(Badge_default, { variant: "examsOutlined", action: "exam1", "data-testid": "quiz-badge", children: "Enem" });
|
|
10607
10697
|
case "VESTIBULAR" /* VESTIBULAR */:
|
|
10608
|
-
return /* @__PURE__ */
|
|
10698
|
+
return /* @__PURE__ */ jsx49(Badge_default, { variant: "examsOutlined", action: "exam4", "data-testid": "quiz-badge", children: "Vestibular" });
|
|
10609
10699
|
case "SIMULADO" /* SIMULADO */:
|
|
10610
10700
|
case "SIMULADAO" /* SIMULADAO */:
|
|
10611
10701
|
case void 0:
|
|
10612
|
-
return /* @__PURE__ */
|
|
10702
|
+
return /* @__PURE__ */ jsx49(Badge_default, { variant: "examsOutlined", action: "exam3", "data-testid": "quiz-badge", children: "Simulad\xE3o" });
|
|
10613
10703
|
default:
|
|
10614
|
-
return /* @__PURE__ */
|
|
10704
|
+
return /* @__PURE__ */ jsx49(Badge_default, { variant: "solid", action: "info", "data-testid": "quiz-badge", children: subtype });
|
|
10615
10705
|
}
|
|
10616
10706
|
};
|
|
10617
|
-
var
|
|
10618
|
-
|
|
10619
|
-
|
|
10620
|
-
|
|
10707
|
+
var QuizHeaderResult = forwardRef21(
|
|
10708
|
+
({ className, ...props }, ref) => {
|
|
10709
|
+
const { getQuestionResultByQuestionId, getCurrentQuestion } = useQuizStore();
|
|
10710
|
+
const [status, setStatus] = useState21(void 0);
|
|
10711
|
+
useEffect20(() => {
|
|
10712
|
+
const cq = getCurrentQuestion();
|
|
10713
|
+
if (!cq) {
|
|
10714
|
+
setStatus(void 0);
|
|
10715
|
+
return;
|
|
10716
|
+
}
|
|
10717
|
+
const qr = getQuestionResultByQuestionId(cq.id);
|
|
10718
|
+
setStatus(qr?.answerStatus);
|
|
10719
|
+
}, [
|
|
10720
|
+
getCurrentQuestion,
|
|
10721
|
+
getQuestionResultByQuestionId,
|
|
10722
|
+
getCurrentQuestion()?.id
|
|
10723
|
+
]);
|
|
10724
|
+
const getClassesByAnswersStatus = () => {
|
|
10725
|
+
switch (status) {
|
|
10726
|
+
case "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */:
|
|
10727
|
+
return "bg-success-background";
|
|
10728
|
+
case "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */:
|
|
10729
|
+
return "bg-error-background";
|
|
10730
|
+
default:
|
|
10731
|
+
return "bg-error-background";
|
|
10732
|
+
}
|
|
10733
|
+
};
|
|
10734
|
+
const getLabelByAnswersStatus = () => {
|
|
10735
|
+
switch (status) {
|
|
10736
|
+
case "RESPOSTA_CORRETA" /* RESPOSTA_CORRETA */:
|
|
10737
|
+
return "\u{1F389} Parab\xE9ns!!";
|
|
10738
|
+
case "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */:
|
|
10739
|
+
return "N\xE3o foi dessa vez...";
|
|
10740
|
+
case "NAO_RESPONDIDO" /* NAO_RESPONDIDO */:
|
|
10741
|
+
default:
|
|
10742
|
+
return "N\xE3o foi dessa vez...voc\xEA deixou a resposta em branco";
|
|
10743
|
+
}
|
|
10744
|
+
};
|
|
10745
|
+
return /* @__PURE__ */ jsxs36(
|
|
10746
|
+
"div",
|
|
10747
|
+
{
|
|
10748
|
+
ref,
|
|
10749
|
+
className: cn(
|
|
10750
|
+
"flex flex-row items-center gap-10 p-3.5 rounded-xl mb-4",
|
|
10751
|
+
getClassesByAnswersStatus(),
|
|
10752
|
+
className
|
|
10753
|
+
),
|
|
10754
|
+
...props,
|
|
10755
|
+
children: [
|
|
10756
|
+
/* @__PURE__ */ jsx49("p", { className: "text-text-950 font-bold text-lg", children: "Resultado" }),
|
|
10757
|
+
/* @__PURE__ */ jsx49("p", { className: "text-text-700 text-md", children: getLabelByAnswersStatus() })
|
|
10758
|
+
]
|
|
10759
|
+
}
|
|
10760
|
+
);
|
|
10761
|
+
}
|
|
10762
|
+
);
|
|
10763
|
+
var QuizResultHeaderTitle = forwardRef21(({ className, ...props }, ref) => {
|
|
10764
|
+
const { quiz } = useQuizStore();
|
|
10765
|
+
return /* @__PURE__ */ jsxs36(
|
|
10621
10766
|
"div",
|
|
10622
10767
|
{
|
|
10623
10768
|
ref,
|
|
10624
10769
|
className: cn("flex flex-row pt-4 justify-between", className),
|
|
10625
10770
|
...props,
|
|
10626
10771
|
children: [
|
|
10627
|
-
/* @__PURE__ */
|
|
10628
|
-
/* @__PURE__ */
|
|
10772
|
+
/* @__PURE__ */ jsx49("p", { className: "text-text-950 font-bold text-2xl", children: "Resultado" }),
|
|
10773
|
+
/* @__PURE__ */ jsx49(QuizBadge, { subtype: quiz?.subtype || void 0 })
|
|
10629
10774
|
]
|
|
10630
10775
|
}
|
|
10631
10776
|
);
|
|
10632
10777
|
});
|
|
10633
|
-
var QuizResultTitle =
|
|
10778
|
+
var QuizResultTitle = forwardRef21(({ className, ...props }, ref) => {
|
|
10634
10779
|
const { getQuizTitle } = useQuizStore();
|
|
10635
10780
|
const quizTitle = getQuizTitle();
|
|
10636
|
-
return /* @__PURE__ */
|
|
10781
|
+
return /* @__PURE__ */ jsx49(
|
|
10637
10782
|
"p",
|
|
10638
10783
|
{
|
|
10639
10784
|
className: cn("pt-6 pb-4 text-text-950 font-bold text-lg", className),
|
|
@@ -10643,7 +10788,7 @@ var QuizResultTitle = forwardRef19(({ className, ...props }, ref) => {
|
|
|
10643
10788
|
}
|
|
10644
10789
|
);
|
|
10645
10790
|
});
|
|
10646
|
-
var QuizResultPerformance =
|
|
10791
|
+
var QuizResultPerformance = forwardRef21(
|
|
10647
10792
|
({ ...props }, ref) => {
|
|
10648
10793
|
const {
|
|
10649
10794
|
getTotalQuestions,
|
|
@@ -10685,15 +10830,15 @@ var QuizResultPerformance = forwardRef19(
|
|
|
10685
10830
|
});
|
|
10686
10831
|
}
|
|
10687
10832
|
const percentage = totalQuestions > 0 ? Math.round(correctAnswers / totalQuestions * 100) : 0;
|
|
10688
|
-
return /* @__PURE__ */
|
|
10833
|
+
return /* @__PURE__ */ jsxs36(
|
|
10689
10834
|
"div",
|
|
10690
10835
|
{
|
|
10691
10836
|
className: "flex flex-row gap-6 p-6 rounded-xl bg-background justify-between",
|
|
10692
10837
|
ref,
|
|
10693
10838
|
...props,
|
|
10694
10839
|
children: [
|
|
10695
|
-
/* @__PURE__ */
|
|
10696
|
-
/* @__PURE__ */
|
|
10840
|
+
/* @__PURE__ */ jsxs36("div", { className: "relative", children: [
|
|
10841
|
+
/* @__PURE__ */ jsx49(
|
|
10697
10842
|
ProgressCircle_default,
|
|
10698
10843
|
{
|
|
10699
10844
|
size: "medium",
|
|
@@ -10703,24 +10848,24 @@ var QuizResultPerformance = forwardRef19(
|
|
|
10703
10848
|
label: ""
|
|
10704
10849
|
}
|
|
10705
10850
|
),
|
|
10706
|
-
/* @__PURE__ */
|
|
10707
|
-
/* @__PURE__ */
|
|
10708
|
-
/* @__PURE__ */
|
|
10709
|
-
/* @__PURE__ */
|
|
10851
|
+
/* @__PURE__ */ jsxs36("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
10852
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex items-center gap-1 mb-1", children: [
|
|
10853
|
+
/* @__PURE__ */ jsx49(Clock3, { size: 12, weight: "regular", className: "text-text-800" }),
|
|
10854
|
+
/* @__PURE__ */ jsx49("span", { className: "text-2xs font-medium text-text-800", children: formatTime2(
|
|
10710
10855
|
(getQuestionResultStatistics()?.timeSpent ?? 0) * 60
|
|
10711
10856
|
) })
|
|
10712
10857
|
] }),
|
|
10713
|
-
/* @__PURE__ */
|
|
10858
|
+
/* @__PURE__ */ jsxs36("div", { className: "text-2xl font-medium text-text-800 leading-7", children: [
|
|
10714
10859
|
getQuestionResultStatistics()?.correctAnswers ?? "--",
|
|
10715
10860
|
" de",
|
|
10716
10861
|
" ",
|
|
10717
10862
|
totalQuestions
|
|
10718
10863
|
] }),
|
|
10719
|
-
/* @__PURE__ */
|
|
10864
|
+
/* @__PURE__ */ jsx49("div", { className: "text-2xs font-medium text-text-600 mt-1", children: "Corretas" })
|
|
10720
10865
|
] })
|
|
10721
10866
|
] }),
|
|
10722
|
-
/* @__PURE__ */
|
|
10723
|
-
/* @__PURE__ */
|
|
10867
|
+
/* @__PURE__ */ jsxs36("div", { className: "flex flex-col gap-4 w-full", children: [
|
|
10868
|
+
/* @__PURE__ */ jsx49(
|
|
10724
10869
|
ProgressBar_default,
|
|
10725
10870
|
{
|
|
10726
10871
|
className: "w-full",
|
|
@@ -10734,7 +10879,7 @@ var QuizResultPerformance = forwardRef19(
|
|
|
10734
10879
|
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
10735
10880
|
}
|
|
10736
10881
|
),
|
|
10737
|
-
/* @__PURE__ */
|
|
10882
|
+
/* @__PURE__ */ jsx49(
|
|
10738
10883
|
ProgressBar_default,
|
|
10739
10884
|
{
|
|
10740
10885
|
className: "w-full",
|
|
@@ -10748,7 +10893,7 @@ var QuizResultPerformance = forwardRef19(
|
|
|
10748
10893
|
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
10749
10894
|
}
|
|
10750
10895
|
),
|
|
10751
|
-
/* @__PURE__ */
|
|
10896
|
+
/* @__PURE__ */ jsx49(
|
|
10752
10897
|
ProgressBar_default,
|
|
10753
10898
|
{
|
|
10754
10899
|
className: "w-full",
|
|
@@ -10768,7 +10913,7 @@ var QuizResultPerformance = forwardRef19(
|
|
|
10768
10913
|
);
|
|
10769
10914
|
}
|
|
10770
10915
|
);
|
|
10771
|
-
var QuizListResult =
|
|
10916
|
+
var QuizListResult = forwardRef21(({ className, onSubjectClick, ...props }, ref) => {
|
|
10772
10917
|
const { getQuestionsGroupedBySubject } = useQuizStore();
|
|
10773
10918
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
10774
10919
|
const subjectsStats = Object.entries(groupedQuestions).map(
|
|
@@ -10795,9 +10940,9 @@ var QuizListResult = forwardRef19(({ className, onSubjectClick, ...props }, ref)
|
|
|
10795
10940
|
};
|
|
10796
10941
|
}
|
|
10797
10942
|
);
|
|
10798
|
-
return /* @__PURE__ */
|
|
10799
|
-
/* @__PURE__ */
|
|
10800
|
-
/* @__PURE__ */
|
|
10943
|
+
return /* @__PURE__ */ jsxs36("section", { ref, className, ...props, children: [
|
|
10944
|
+
/* @__PURE__ */ jsx49("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Mat\xE9rias" }),
|
|
10945
|
+
/* @__PURE__ */ jsx49("ul", { className: "flex flex-col gap-2", children: subjectsStats.map((subject) => /* @__PURE__ */ jsx49("li", { children: /* @__PURE__ */ jsx49(
|
|
10801
10946
|
CardResults,
|
|
10802
10947
|
{
|
|
10803
10948
|
onClick: () => onSubjectClick?.(subject.subject.id),
|
|
@@ -10819,16 +10964,16 @@ var QuizListResultByMateria = ({
|
|
|
10819
10964
|
const { getQuestionsGroupedBySubject, getQuestionIndex } = useQuizStore();
|
|
10820
10965
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
10821
10966
|
const answeredQuestions = groupedQuestions[subject] || [];
|
|
10822
|
-
return /* @__PURE__ */
|
|
10823
|
-
/* @__PURE__ */
|
|
10824
|
-
/* @__PURE__ */
|
|
10825
|
-
/* @__PURE__ */
|
|
10826
|
-
/* @__PURE__ */
|
|
10967
|
+
return /* @__PURE__ */ jsxs36("div", { className: "flex flex-col", children: [
|
|
10968
|
+
/* @__PURE__ */ jsx49("div", { className: "flex flex-row pt-4 justify-between", children: /* @__PURE__ */ jsx49("p", { className: "text-text-950 font-bold text-2xl", children: answeredQuestions?.[0]?.knowledgeMatrix?.[0]?.subject?.name ?? "Sem mat\xE9ria" }) }),
|
|
10969
|
+
/* @__PURE__ */ jsxs36("section", { className: "flex flex-col ", children: [
|
|
10970
|
+
/* @__PURE__ */ jsx49("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Resultado das quest\xF5es" }),
|
|
10971
|
+
/* @__PURE__ */ jsx49("ul", { className: "flex flex-col gap-2 pt-4", children: answeredQuestions.map((question) => {
|
|
10827
10972
|
const questionIndex = getQuestionIndex(
|
|
10828
10973
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10829
10974
|
question.questionId ?? question.id
|
|
10830
10975
|
);
|
|
10831
|
-
return /* @__PURE__ */
|
|
10976
|
+
return /* @__PURE__ */ jsx49("li", { children: /* @__PURE__ */ jsx49(
|
|
10832
10977
|
CardStatus,
|
|
10833
10978
|
{
|
|
10834
10979
|
className: "max-w-full",
|
|
@@ -10851,12 +10996,12 @@ var QuizListResultByMateria = ({
|
|
|
10851
10996
|
};
|
|
10852
10997
|
|
|
10853
10998
|
// src/components/LoadingModal/loadingModal.tsx
|
|
10854
|
-
import { forwardRef as
|
|
10855
|
-
import { jsx as
|
|
10856
|
-
var LoadingModal =
|
|
10999
|
+
import { forwardRef as forwardRef22 } from "react";
|
|
11000
|
+
import { jsx as jsx50, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
11001
|
+
var LoadingModal = forwardRef22(
|
|
10857
11002
|
({ open, title = "Titulo...", subtitle = "Subtitulo...", ...props }, ref) => {
|
|
10858
11003
|
if (!open) return null;
|
|
10859
|
-
return /* @__PURE__ */
|
|
11004
|
+
return /* @__PURE__ */ jsx50(
|
|
10860
11005
|
"div",
|
|
10861
11006
|
{
|
|
10862
11007
|
ref,
|
|
@@ -10865,8 +11010,8 @@ var LoadingModal = forwardRef20(
|
|
|
10865
11010
|
"aria-describedby": "loading-modal-subtitle",
|
|
10866
11011
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-background/90 backdrop-blur-xs",
|
|
10867
11012
|
...props,
|
|
10868
|
-
children: /* @__PURE__ */
|
|
10869
|
-
/* @__PURE__ */
|
|
11013
|
+
children: /* @__PURE__ */ jsxs37("div", { className: "w-full max-w-[364px] flex flex-col items-center justify-center gap-14", children: [
|
|
11014
|
+
/* @__PURE__ */ jsx50("span", { className: "animate-spin", "aria-hidden": "true", children: /* @__PURE__ */ jsxs37(
|
|
10870
11015
|
"svg",
|
|
10871
11016
|
{
|
|
10872
11017
|
width: "102",
|
|
@@ -10877,14 +11022,14 @@ var LoadingModal = forwardRef20(
|
|
|
10877
11022
|
"aria-hidden": "true",
|
|
10878
11023
|
focusable: false,
|
|
10879
11024
|
children: [
|
|
10880
|
-
/* @__PURE__ */
|
|
11025
|
+
/* @__PURE__ */ jsx50(
|
|
10881
11026
|
"path",
|
|
10882
11027
|
{
|
|
10883
11028
|
d: "M101.5 51C101.5 78.8904 78.8904 101.5 51 101.5C23.1096 101.5 0.5 78.8904 0.5 51C0.5 23.1096 23.1096 0.5 51 0.5C78.8904 0.5 101.5 23.1096 101.5 51ZM8.62286 51C8.62286 74.4043 27.5957 93.3771 51 93.3771C74.4043 93.3771 93.3771 74.4043 93.3771 51C93.3771 27.5957 74.4043 8.62286 51 8.62286C27.5957 8.62286 8.62286 27.5957 8.62286 51Z",
|
|
10884
11029
|
className: "fill-primary-100"
|
|
10885
11030
|
}
|
|
10886
11031
|
),
|
|
10887
|
-
/* @__PURE__ */
|
|
11032
|
+
/* @__PURE__ */ jsx50(
|
|
10888
11033
|
"path",
|
|
10889
11034
|
{
|
|
10890
11035
|
d: "M97.4386 51C99.6816 51 101.517 52.8213 101.337 55.0571C100.754 62.2833 98.6212 69.3162 95.0643 75.6696C90.8444 83.207 84.7616 89.536 77.3975 94.0514C70.0333 98.5668 61.6339 101.118 53.0024 101.46C44.371 101.803 35.7959 99.9255 28.0971 96.0078C20.3982 92.0902 13.833 86.2631 9.02917 79.0838C4.22529 71.9045 1.34332 63.6129 0.658804 55.0017C-0.0257159 46.3906 1.51009 37.7479 5.1194 29.8997C8.16173 23.2845 12.5915 17.4202 18.0904 12.6959C19.7917 11.2341 22.3444 11.6457 23.6647 13.459C24.9851 15.2723 24.5702 17.7988 22.8916 19.2866C18.5048 23.1747 14.9608 27.9413 12.4992 33.2937C9.47048 39.8794 8.1817 47.132 8.75612 54.3581C9.33053 61.5841 11.7489 68.542 15.7801 74.5666C19.8113 80.5911 25.3205 85.4809 31.781 88.7684C38.2414 92.0559 45.4372 93.6312 52.6804 93.3438C59.9235 93.0564 66.9718 90.9158 73.1515 87.1267C79.3311 83.3375 84.4355 78.0266 87.9766 71.7015C90.8546 66.561 92.6217 60.8903 93.1827 55.0553C93.3973 52.8225 95.1955 51 97.4386 51Z",
|
|
@@ -10894,9 +11039,9 @@ var LoadingModal = forwardRef20(
|
|
|
10894
11039
|
]
|
|
10895
11040
|
}
|
|
10896
11041
|
) }),
|
|
10897
|
-
/* @__PURE__ */
|
|
10898
|
-
/* @__PURE__ */
|
|
10899
|
-
/* @__PURE__ */
|
|
11042
|
+
/* @__PURE__ */ jsxs37("span", { className: "flex flex-col gap-4 text-center", children: [
|
|
11043
|
+
/* @__PURE__ */ jsx50("p", { id: "loading-modal-title", className: "text-text-950 text-lg", children: title }),
|
|
11044
|
+
/* @__PURE__ */ jsx50("p", { id: "loading-modal-subtitle", className: "text-text-600 text-lg", children: subtitle })
|
|
10900
11045
|
] })
|
|
10901
11046
|
] })
|
|
10902
11047
|
}
|
|
@@ -10907,7 +11052,7 @@ var loadingModal_default = LoadingModal;
|
|
|
10907
11052
|
|
|
10908
11053
|
// src/components/NotificationCard/NotificationCard.tsx
|
|
10909
11054
|
import { DotsThreeVertical as DotsThreeVertical3, Bell as Bell2 } from "phosphor-react";
|
|
10910
|
-
import { useState as
|
|
11055
|
+
import { useState as useState22, useEffect as useEffect21 } from "react";
|
|
10911
11056
|
|
|
10912
11057
|
// src/store/notificationStore.ts
|
|
10913
11058
|
import { create as create8 } from "zustand";
|
|
@@ -11154,14 +11299,14 @@ var createNotificationStore = (apiClient) => {
|
|
|
11154
11299
|
var mock_content_default = "./mock-content-K2CDVG6P.png";
|
|
11155
11300
|
|
|
11156
11301
|
// src/components/NotificationCard/NotificationCard.tsx
|
|
11157
|
-
import { Fragment as
|
|
11302
|
+
import { Fragment as Fragment12, jsx as jsx51, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
11158
11303
|
var NotificationEmpty = ({
|
|
11159
11304
|
emptyStateImage,
|
|
11160
11305
|
emptyStateTitle = "Nenhuma notifica\xE7\xE3o no momento",
|
|
11161
11306
|
emptyStateDescription = "Voc\xEA est\xE1 em dia com todas as novidades. Volte depois para conferir atualiza\xE7\xF5es!"
|
|
11162
11307
|
}) => {
|
|
11163
|
-
return /* @__PURE__ */
|
|
11164
|
-
emptyStateImage && /* @__PURE__ */
|
|
11308
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex flex-col items-center justify-center gap-4 p-6 w-full", children: [
|
|
11309
|
+
emptyStateImage && /* @__PURE__ */ jsx51("div", { className: "w-20 h-20 flex items-center justify-center", children: /* @__PURE__ */ jsx51(
|
|
11165
11310
|
"img",
|
|
11166
11311
|
{
|
|
11167
11312
|
src: emptyStateImage,
|
|
@@ -11171,23 +11316,23 @@ var NotificationEmpty = ({
|
|
|
11171
11316
|
className: "object-contain"
|
|
11172
11317
|
}
|
|
11173
11318
|
) }),
|
|
11174
|
-
/* @__PURE__ */
|
|
11175
|
-
/* @__PURE__ */
|
|
11319
|
+
/* @__PURE__ */ jsx51("h3", { className: "text-xl font-semibold text-text-950 text-center leading-[23px]", children: emptyStateTitle }),
|
|
11320
|
+
/* @__PURE__ */ jsx51("p", { className: "text-sm font-normal text-text-400 text-center max-w-[316px] leading-[21px]", children: emptyStateDescription })
|
|
11176
11321
|
] });
|
|
11177
11322
|
};
|
|
11178
11323
|
var NotificationHeader = ({
|
|
11179
11324
|
unreadCount,
|
|
11180
11325
|
variant = "modal"
|
|
11181
11326
|
}) => {
|
|
11182
|
-
return /* @__PURE__ */
|
|
11183
|
-
variant === "modal" ? /* @__PURE__ */
|
|
11184
|
-
unreadCount > 0 && /* @__PURE__ */
|
|
11327
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex items-center justify-between gap-2", children: [
|
|
11328
|
+
variant === "modal" ? /* @__PURE__ */ jsx51(Text_default, { size: "sm", weight: "bold", className: "text-text-950", children: "Notifica\xE7\xF5es" }) : /* @__PURE__ */ jsx51("h3", { className: "text-sm font-semibold text-text-950", children: "Notifica\xE7\xF5es" }),
|
|
11329
|
+
unreadCount > 0 && /* @__PURE__ */ jsx51(
|
|
11185
11330
|
Badge_default,
|
|
11186
11331
|
{
|
|
11187
11332
|
variant: "solid",
|
|
11188
11333
|
action: "info",
|
|
11189
11334
|
size: "small",
|
|
11190
|
-
iconLeft: /* @__PURE__ */
|
|
11335
|
+
iconLeft: /* @__PURE__ */ jsx51(Bell2, { size: 12, "aria-hidden": "true", focusable: "false" }),
|
|
11191
11336
|
className: "border-0",
|
|
11192
11337
|
children: unreadCount === 1 ? "1 n\xE3o lida" : `${unreadCount} n\xE3o lidas`
|
|
11193
11338
|
}
|
|
@@ -11223,7 +11368,7 @@ var SingleNotificationCard = ({
|
|
|
11223
11368
|
onNavigate();
|
|
11224
11369
|
}
|
|
11225
11370
|
};
|
|
11226
|
-
return /* @__PURE__ */
|
|
11371
|
+
return /* @__PURE__ */ jsxs38(
|
|
11227
11372
|
"div",
|
|
11228
11373
|
{
|
|
11229
11374
|
className: cn(
|
|
@@ -11232,20 +11377,20 @@ var SingleNotificationCard = ({
|
|
|
11232
11377
|
className
|
|
11233
11378
|
),
|
|
11234
11379
|
children: [
|
|
11235
|
-
/* @__PURE__ */
|
|
11236
|
-
!isRead && /* @__PURE__ */
|
|
11237
|
-
/* @__PURE__ */
|
|
11238
|
-
/* @__PURE__ */
|
|
11239
|
-
/* @__PURE__ */
|
|
11380
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-2 w-full", children: [
|
|
11381
|
+
!isRead && /* @__PURE__ */ jsx51("div", { className: "w-[7px] h-[7px] bg-info-300 rounded-full flex-shrink-0" }),
|
|
11382
|
+
/* @__PURE__ */ jsx51("h3", { className: "font-bold text-sm leading-4 text-text-950 flex-grow", children: title }),
|
|
11383
|
+
/* @__PURE__ */ jsxs38(DropdownMenu_default, { children: [
|
|
11384
|
+
/* @__PURE__ */ jsx51(
|
|
11240
11385
|
DropdownMenuTrigger,
|
|
11241
11386
|
{
|
|
11242
11387
|
className: "flex-shrink-0 inline-flex items-center justify-center font-medium bg-transparent text-text-950 cursor-pointer hover:bg-info-50 w-6 h-6 rounded-lg",
|
|
11243
11388
|
"aria-label": "Menu de a\xE7\xF5es",
|
|
11244
|
-
children: /* @__PURE__ */
|
|
11389
|
+
children: /* @__PURE__ */ jsx51(DotsThreeVertical3, { size: 24 })
|
|
11245
11390
|
}
|
|
11246
11391
|
),
|
|
11247
|
-
/* @__PURE__ */
|
|
11248
|
-
!isRead && /* @__PURE__ */
|
|
11392
|
+
/* @__PURE__ */ jsxs38(DropdownMenuContent, { align: "end", className: "min-w-[160px]", children: [
|
|
11393
|
+
!isRead && /* @__PURE__ */ jsx51(
|
|
11249
11394
|
DropdownMenuItem,
|
|
11250
11395
|
{
|
|
11251
11396
|
onClick: handleMarkAsRead,
|
|
@@ -11253,14 +11398,14 @@ var SingleNotificationCard = ({
|
|
|
11253
11398
|
children: "Marcar como lida"
|
|
11254
11399
|
}
|
|
11255
11400
|
),
|
|
11256
|
-
/* @__PURE__ */
|
|
11401
|
+
/* @__PURE__ */ jsx51(DropdownMenuItem, { onClick: handleDelete, className: "text-error-600", children: "Deletar" })
|
|
11257
11402
|
] })
|
|
11258
11403
|
] })
|
|
11259
11404
|
] }),
|
|
11260
|
-
/* @__PURE__ */
|
|
11261
|
-
/* @__PURE__ */
|
|
11262
|
-
/* @__PURE__ */
|
|
11263
|
-
onNavigate && actionLabel && /* @__PURE__ */
|
|
11405
|
+
/* @__PURE__ */ jsx51("p", { className: "text-sm leading-[21px] text-text-800 w-full", children: message }),
|
|
11406
|
+
/* @__PURE__ */ jsxs38("div", { className: "flex items-center justify-between w-full", children: [
|
|
11407
|
+
/* @__PURE__ */ jsx51("span", { className: "text-sm font-medium text-text-400", children: time }),
|
|
11408
|
+
onNavigate && actionLabel && /* @__PURE__ */ jsx51(
|
|
11264
11409
|
"button",
|
|
11265
11410
|
{
|
|
11266
11411
|
type: "button",
|
|
@@ -11288,7 +11433,7 @@ var NotificationList = ({
|
|
|
11288
11433
|
className,
|
|
11289
11434
|
emptyStateImage
|
|
11290
11435
|
}) => {
|
|
11291
|
-
const [globalNotificationModal, setGlobalNotificationModal] =
|
|
11436
|
+
const [globalNotificationModal, setGlobalNotificationModal] = useState22({ isOpen: false, notification: null });
|
|
11292
11437
|
const handleGlobalNotificationClick = (notification) => {
|
|
11293
11438
|
if (onGlobalNotificationClick) {
|
|
11294
11439
|
onGlobalNotificationClick(notification);
|
|
@@ -11300,9 +11445,9 @@ var NotificationList = ({
|
|
|
11300
11445
|
}
|
|
11301
11446
|
};
|
|
11302
11447
|
if (error) {
|
|
11303
|
-
return /* @__PURE__ */
|
|
11304
|
-
/* @__PURE__ */
|
|
11305
|
-
onRetry && /* @__PURE__ */
|
|
11448
|
+
return /* @__PURE__ */ jsxs38("div", { className: "flex flex-col items-center gap-4 p-6 w-full", children: [
|
|
11449
|
+
/* @__PURE__ */ jsx51("p", { className: "text-sm text-error-600", children: error }),
|
|
11450
|
+
onRetry && /* @__PURE__ */ jsx51(
|
|
11306
11451
|
"button",
|
|
11307
11452
|
{
|
|
11308
11453
|
type: "button",
|
|
@@ -11314,8 +11459,8 @@ var NotificationList = ({
|
|
|
11314
11459
|
] });
|
|
11315
11460
|
}
|
|
11316
11461
|
if (loading) {
|
|
11317
|
-
return /* @__PURE__ */
|
|
11318
|
-
(skeletonId) => /* @__PURE__ */
|
|
11462
|
+
return /* @__PURE__ */ jsx51("div", { className: "flex flex-col gap-0 w-full", children: ["skeleton-first", "skeleton-second", "skeleton-third"].map(
|
|
11463
|
+
(skeletonId) => /* @__PURE__ */ jsx51(
|
|
11319
11464
|
SkeletonCard,
|
|
11320
11465
|
{
|
|
11321
11466
|
className: "p-4 border-b border-border-200"
|
|
@@ -11325,11 +11470,11 @@ var NotificationList = ({
|
|
|
11325
11470
|
) });
|
|
11326
11471
|
}
|
|
11327
11472
|
if (!groupedNotifications || groupedNotifications.length === 0) {
|
|
11328
|
-
return renderEmpty ? /* @__PURE__ */
|
|
11473
|
+
return renderEmpty ? /* @__PURE__ */ jsx51("div", { className: "w-full", children: renderEmpty() }) : /* @__PURE__ */ jsx51(NotificationEmpty, {});
|
|
11329
11474
|
}
|
|
11330
|
-
return /* @__PURE__ */
|
|
11331
|
-
groupedNotifications.map((group, idx) => /* @__PURE__ */
|
|
11332
|
-
/* @__PURE__ */
|
|
11475
|
+
return /* @__PURE__ */ jsxs38("div", { className: cn("flex flex-col gap-0 w-full", className), children: [
|
|
11476
|
+
groupedNotifications.map((group, idx) => /* @__PURE__ */ jsxs38("div", { className: "flex flex-col", children: [
|
|
11477
|
+
/* @__PURE__ */ jsx51("div", { className: "flex items-end px-4 py-6 pb-4", children: /* @__PURE__ */ jsx51("h4", { className: "text-lg font-bold text-text-500 flex-grow", children: group.label }) }),
|
|
11333
11478
|
group.notifications.map((notification) => {
|
|
11334
11479
|
const isGlobalNotification = !notification.entityType && !notification.entityId && !notification.activity && !notification.goal;
|
|
11335
11480
|
let navigationHandler;
|
|
@@ -11349,7 +11494,7 @@ var NotificationList = ({
|
|
|
11349
11494
|
notification.entityType ?? void 0
|
|
11350
11495
|
);
|
|
11351
11496
|
}
|
|
11352
|
-
return /* @__PURE__ */
|
|
11497
|
+
return /* @__PURE__ */ jsx51(
|
|
11353
11498
|
SingleNotificationCard,
|
|
11354
11499
|
{
|
|
11355
11500
|
title: notification.title,
|
|
@@ -11365,7 +11510,7 @@ var NotificationList = ({
|
|
|
11365
11510
|
);
|
|
11366
11511
|
})
|
|
11367
11512
|
] }, `${group.label}-${idx}`)),
|
|
11368
|
-
/* @__PURE__ */
|
|
11513
|
+
/* @__PURE__ */ jsx51(
|
|
11369
11514
|
Modal_default,
|
|
11370
11515
|
{
|
|
11371
11516
|
isOpen: globalNotificationModal.isOpen,
|
|
@@ -11402,8 +11547,8 @@ var NotificationCenter = ({
|
|
|
11402
11547
|
className
|
|
11403
11548
|
}) => {
|
|
11404
11549
|
const { isMobile } = useMobile();
|
|
11405
|
-
const [isModalOpen, setIsModalOpen] =
|
|
11406
|
-
const [globalNotificationModal, setGlobalNotificationModal] =
|
|
11550
|
+
const [isModalOpen, setIsModalOpen] = useState22(false);
|
|
11551
|
+
const [globalNotificationModal, setGlobalNotificationModal] = useState22({ isOpen: false, notification: null });
|
|
11407
11552
|
const handleMobileClick = () => {
|
|
11408
11553
|
setIsModalOpen(true);
|
|
11409
11554
|
onFetchNotifications?.();
|
|
@@ -11418,12 +11563,12 @@ var NotificationCenter = ({
|
|
|
11418
11563
|
onToggleActive?.();
|
|
11419
11564
|
}
|
|
11420
11565
|
};
|
|
11421
|
-
|
|
11566
|
+
useEffect21(() => {
|
|
11422
11567
|
if (isActive) {
|
|
11423
11568
|
onFetchNotifications?.();
|
|
11424
11569
|
}
|
|
11425
11570
|
}, [isActive, onFetchNotifications]);
|
|
11426
|
-
const renderEmptyState = () => /* @__PURE__ */
|
|
11571
|
+
const renderEmptyState = () => /* @__PURE__ */ jsx51(
|
|
11427
11572
|
NotificationEmpty,
|
|
11428
11573
|
{
|
|
11429
11574
|
emptyStateImage,
|
|
@@ -11432,17 +11577,17 @@ var NotificationCenter = ({
|
|
|
11432
11577
|
}
|
|
11433
11578
|
);
|
|
11434
11579
|
if (isMobile) {
|
|
11435
|
-
return /* @__PURE__ */
|
|
11436
|
-
/* @__PURE__ */
|
|
11580
|
+
return /* @__PURE__ */ jsxs38(Fragment12, { children: [
|
|
11581
|
+
/* @__PURE__ */ jsx51(
|
|
11437
11582
|
IconButton_default,
|
|
11438
11583
|
{
|
|
11439
11584
|
active: isModalOpen,
|
|
11440
11585
|
onClick: handleMobileClick,
|
|
11441
|
-
icon: /* @__PURE__ */
|
|
11586
|
+
icon: /* @__PURE__ */ jsx51(Bell2, { size: 24, className: "text-primary" }),
|
|
11442
11587
|
className
|
|
11443
11588
|
}
|
|
11444
11589
|
),
|
|
11445
|
-
/* @__PURE__ */
|
|
11590
|
+
/* @__PURE__ */ jsx51(
|
|
11446
11591
|
Modal_default,
|
|
11447
11592
|
{
|
|
11448
11593
|
isOpen: isModalOpen,
|
|
@@ -11451,10 +11596,10 @@ var NotificationCenter = ({
|
|
|
11451
11596
|
size: "md",
|
|
11452
11597
|
hideCloseButton: false,
|
|
11453
11598
|
closeOnEscape: true,
|
|
11454
|
-
children: /* @__PURE__ */
|
|
11455
|
-
/* @__PURE__ */
|
|
11456
|
-
/* @__PURE__ */
|
|
11457
|
-
unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */
|
|
11599
|
+
children: /* @__PURE__ */ jsxs38("div", { className: "flex flex-col h-full max-h-[80vh]", children: [
|
|
11600
|
+
/* @__PURE__ */ jsxs38("div", { className: "px-0 pb-3 border-b border-border-200", children: [
|
|
11601
|
+
/* @__PURE__ */ jsx51(NotificationHeader, { unreadCount, variant: "modal" }),
|
|
11602
|
+
unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */ jsx51(
|
|
11458
11603
|
"button",
|
|
11459
11604
|
{
|
|
11460
11605
|
type: "button",
|
|
@@ -11464,7 +11609,7 @@ var NotificationCenter = ({
|
|
|
11464
11609
|
}
|
|
11465
11610
|
)
|
|
11466
11611
|
] }),
|
|
11467
|
-
/* @__PURE__ */
|
|
11612
|
+
/* @__PURE__ */ jsx51("div", { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx51(
|
|
11468
11613
|
NotificationList,
|
|
11469
11614
|
{
|
|
11470
11615
|
groupedNotifications,
|
|
@@ -11494,18 +11639,18 @@ var NotificationCenter = ({
|
|
|
11494
11639
|
)
|
|
11495
11640
|
] });
|
|
11496
11641
|
}
|
|
11497
|
-
return /* @__PURE__ */
|
|
11498
|
-
/* @__PURE__ */
|
|
11642
|
+
return /* @__PURE__ */ jsxs38(Fragment12, { children: [
|
|
11643
|
+
/* @__PURE__ */ jsxs38(
|
|
11499
11644
|
DropdownMenu_default,
|
|
11500
11645
|
{
|
|
11501
11646
|
...typeof isActive === "boolean" ? { open: isActive, onOpenChange: handleOpenChange } : { onOpenChange: handleOpenChange },
|
|
11502
11647
|
children: [
|
|
11503
|
-
/* @__PURE__ */
|
|
11648
|
+
/* @__PURE__ */ jsx51(DropdownMenuTrigger, { className: "text-primary cursor-pointer", children: /* @__PURE__ */ jsx51(
|
|
11504
11649
|
IconButton_default,
|
|
11505
11650
|
{
|
|
11506
11651
|
active: isActive,
|
|
11507
11652
|
onClick: handleDesktopClick,
|
|
11508
|
-
icon: /* @__PURE__ */
|
|
11653
|
+
icon: /* @__PURE__ */ jsx51(
|
|
11509
11654
|
Bell2,
|
|
11510
11655
|
{
|
|
11511
11656
|
size: 24,
|
|
@@ -11515,22 +11660,22 @@ var NotificationCenter = ({
|
|
|
11515
11660
|
className
|
|
11516
11661
|
}
|
|
11517
11662
|
) }),
|
|
11518
|
-
/* @__PURE__ */
|
|
11663
|
+
/* @__PURE__ */ jsx51(
|
|
11519
11664
|
DropdownMenuContent,
|
|
11520
11665
|
{
|
|
11521
11666
|
className: "min-w-[320px] max-w-[400px] max-h-[500px] overflow-hidden",
|
|
11522
11667
|
side: "bottom",
|
|
11523
11668
|
align: "end",
|
|
11524
|
-
children: /* @__PURE__ */
|
|
11525
|
-
/* @__PURE__ */
|
|
11526
|
-
/* @__PURE__ */
|
|
11669
|
+
children: /* @__PURE__ */ jsxs38("div", { className: "flex flex-col", children: [
|
|
11670
|
+
/* @__PURE__ */ jsxs38("div", { className: "px-4 py-3 border-b border-border-200", children: [
|
|
11671
|
+
/* @__PURE__ */ jsx51(
|
|
11527
11672
|
NotificationHeader,
|
|
11528
11673
|
{
|
|
11529
11674
|
unreadCount,
|
|
11530
11675
|
variant: "dropdown"
|
|
11531
11676
|
}
|
|
11532
11677
|
),
|
|
11533
|
-
unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */
|
|
11678
|
+
unreadCount > 0 && onMarkAllAsRead && /* @__PURE__ */ jsx51(
|
|
11534
11679
|
"button",
|
|
11535
11680
|
{
|
|
11536
11681
|
type: "button",
|
|
@@ -11540,7 +11685,7 @@ var NotificationCenter = ({
|
|
|
11540
11685
|
}
|
|
11541
11686
|
)
|
|
11542
11687
|
] }),
|
|
11543
|
-
/* @__PURE__ */
|
|
11688
|
+
/* @__PURE__ */ jsx51("div", { className: "max-h-[350px] overflow-y-auto", children: /* @__PURE__ */ jsx51(
|
|
11544
11689
|
NotificationList,
|
|
11545
11690
|
{
|
|
11546
11691
|
groupedNotifications,
|
|
@@ -11567,7 +11712,7 @@ var NotificationCenter = ({
|
|
|
11567
11712
|
]
|
|
11568
11713
|
}
|
|
11569
11714
|
),
|
|
11570
|
-
/* @__PURE__ */
|
|
11715
|
+
/* @__PURE__ */ jsx51(
|
|
11571
11716
|
Modal_default,
|
|
11572
11717
|
{
|
|
11573
11718
|
isOpen: globalNotificationModal.isOpen,
|
|
@@ -11586,7 +11731,7 @@ var NotificationCenter = ({
|
|
|
11586
11731
|
var NotificationCard = (props) => {
|
|
11587
11732
|
switch (props.mode) {
|
|
11588
11733
|
case "single":
|
|
11589
|
-
return /* @__PURE__ */
|
|
11734
|
+
return /* @__PURE__ */ jsx51(
|
|
11590
11735
|
SingleNotificationCard,
|
|
11591
11736
|
{
|
|
11592
11737
|
title: props.title,
|
|
@@ -11601,7 +11746,7 @@ var NotificationCard = (props) => {
|
|
|
11601
11746
|
}
|
|
11602
11747
|
);
|
|
11603
11748
|
case "list":
|
|
11604
|
-
return /* @__PURE__ */
|
|
11749
|
+
return /* @__PURE__ */ jsx51(
|
|
11605
11750
|
NotificationList,
|
|
11606
11751
|
{
|
|
11607
11752
|
groupedNotifications: props.groupedNotifications ?? (props.notifications ? [
|
|
@@ -11624,9 +11769,9 @@ var NotificationCard = (props) => {
|
|
|
11624
11769
|
}
|
|
11625
11770
|
);
|
|
11626
11771
|
case "center":
|
|
11627
|
-
return /* @__PURE__ */
|
|
11772
|
+
return /* @__PURE__ */ jsx51(NotificationCenter, { ...props });
|
|
11628
11773
|
default:
|
|
11629
|
-
return /* @__PURE__ */
|
|
11774
|
+
return /* @__PURE__ */ jsx51("div", { className: "flex flex-col items-center gap-4 p-6 w-full", children: /* @__PURE__ */ jsx51("p", { className: "text-sm text-text-600", children: "Modo de notifica\xE7\xE3o n\xE3o reconhecido" }) });
|
|
11630
11775
|
}
|
|
11631
11776
|
};
|
|
11632
11777
|
var NotificationCard_default = NotificationCard;
|
|
@@ -11805,6 +11950,7 @@ export {
|
|
|
11805
11950
|
QUESTION_DIFFICULTY,
|
|
11806
11951
|
QUESTION_STATUS,
|
|
11807
11952
|
QUESTION_TYPE,
|
|
11953
|
+
QUIZ_TYPE,
|
|
11808
11954
|
Quiz,
|
|
11809
11955
|
QuizAlternative,
|
|
11810
11956
|
QuizConnectDots,
|
|
@@ -11853,6 +11999,7 @@ export {
|
|
|
11853
11999
|
Toaster_default as Toaster,
|
|
11854
12000
|
VideoPlayer_default as VideoPlayer,
|
|
11855
12001
|
Whiteboard_default as Whiteboard,
|
|
12002
|
+
cn,
|
|
11856
12003
|
createNotificationStore,
|
|
11857
12004
|
createNotificationsHook,
|
|
11858
12005
|
createUseNotificationStore,
|