analytica-frontend-lib 1.2.1 → 1.2.2

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.
@@ -2920,10 +2920,15 @@ var QuizAlternative = ({ paddingBottom }) => {
2920
2920
  const isSelected = currentQuestionResult?.selectedOptions.some(
2921
2921
  (selectedOption) => selectedOption.optionId === option.id
2922
2922
  );
2923
- if (isCorrectOption) {
2924
- status = "correct" /* CORRECT */;
2925
- } else if (isSelected && !isCorrectOption) {
2926
- status = "incorrect" /* INCORRECT */;
2923
+ const shouldShowCorrectAnswers = currentQuestionResult?.answerStatus !== "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */ && currentQuestionResult?.answerStatus !== "NAO_RESPONDIDO" /* NAO_RESPONDIDO */;
2924
+ if (shouldShowCorrectAnswers) {
2925
+ if (isCorrectOption) {
2926
+ status = "correct" /* CORRECT */;
2927
+ } else if (isSelected && !isCorrectOption) {
2928
+ status = "incorrect" /* INCORRECT */;
2929
+ } else {
2930
+ status = "neutral" /* NEUTRAL */;
2931
+ }
2927
2932
  } else {
2928
2933
  status = "neutral" /* NEUTRAL */;
2929
2934
  }
@@ -3021,10 +3026,15 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
3021
3026
  const isSelected = currentQuestionResult?.selectedOptions?.some(
3022
3027
  (op) => op.optionId === option.id
3023
3028
  );
3024
- if (isCorrectOption) {
3025
- status = "correct" /* CORRECT */;
3026
- } else if (isSelected && !isCorrectOption) {
3027
- status = "incorrect" /* INCORRECT */;
3029
+ const shouldShowCorrectAnswers = currentQuestionResult?.answerStatus !== "PENDENTE_AVALIACAO" /* PENDENTE_AVALIACAO */ && currentQuestionResult?.answerStatus !== "NAO_RESPONDIDO" /* NAO_RESPONDIDO */;
3030
+ if (shouldShowCorrectAnswers) {
3031
+ if (isCorrectOption) {
3032
+ status = "correct" /* CORRECT */;
3033
+ } else if (isSelected && !isCorrectOption) {
3034
+ status = "incorrect" /* INCORRECT */;
3035
+ } else {
3036
+ status = "neutral" /* NEUTRAL */;
3037
+ }
3028
3038
  } else {
3029
3039
  status = "neutral" /* NEUTRAL */;
3030
3040
  }
@@ -3127,8 +3137,8 @@ var QuizTrueOrFalse = ({ paddingBottom }) => {
3127
3137
  isCorrect: false
3128
3138
  }
3129
3139
  ];
3130
- const getLetterByIndex = (index) => String.fromCharCode(97 + index);
3131
- const isDefaultVariant = variant == "default";
3140
+ const getLetterByIndex = (index) => String.fromCodePoint(97 + index);
3141
+ const isDefaultVariant = variant === "default";
3132
3142
  return /* @__PURE__ */ jsxs11(Fragment3, { children: [
3133
3143
  /* @__PURE__ */ jsx14(QuizSubTitle, { subTitle: "Alternativas" }),
3134
3144
  /* @__PURE__ */ jsx14(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx14("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
@@ -3143,7 +3153,7 @@ var QuizTrueOrFalse = ({ paddingBottom }) => {
3143
3153
  {
3144
3154
  className: cn(
3145
3155
  "flex flex-row justify-between items-center gap-2 p-2 rounded-md",
3146
- !isDefaultVariant ? getStatusStyles(variantCorrect) : ""
3156
+ isDefaultVariant ? "" : getStatusStyles(variantCorrect)
3147
3157
  ),
3148
3158
  children: [
3149
3159
  /* @__PURE__ */ jsx14("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index).concat(") ").concat(option.label) }),
@@ -3244,7 +3254,7 @@ var QuizConnectDots = ({ paddingBottom }) => {
3244
3254
  return next;
3245
3255
  });
3246
3256
  };
3247
- const getLetterByIndex = (index) => String.fromCharCode(97 + index);
3257
+ const getLetterByIndex = (index) => String.fromCodePoint(97 + index);
3248
3258
  const isDefaultVariant = variant === "default";
3249
3259
  const assignedDots = new Set(
3250
3260
  userAnswers.map((a) => a.dotOption).filter(Boolean)
@@ -3260,7 +3270,7 @@ var QuizConnectDots = ({ paddingBottom }) => {
3260
3270
  {
3261
3271
  className: cn(
3262
3272
  "flex flex-row justify-between items-center gap-2 p-2 rounded-md",
3263
- !isDefaultVariant ? getStatusStyles(variantCorrect) : ""
3273
+ isDefaultVariant ? "" : getStatusStyles(variantCorrect)
3264
3274
  ),
3265
3275
  children: [
3266
3276
  /* @__PURE__ */ jsx14("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index) + ") " + option.label }),
@@ -3342,8 +3352,10 @@ var QuizFill = ({ paddingBottom }) => {
3342
3352
  const [answers, setAnswers] = useState6({});
3343
3353
  const baseId = useId8();
3344
3354
  const getAvailableOptionsForSelect = (selectId) => {
3345
- const usedOptions = Object.entries(answers).filter(([key]) => key !== selectId).map(([, value]) => value);
3346
- return options.filter((option) => !usedOptions.includes(option));
3355
+ const usedOptions = new Set(
3356
+ Object.entries(answers).filter(([key]) => key !== selectId).map(([, value]) => value)
3357
+ );
3358
+ return options.filter((option) => !usedOptions.has(option));
3347
3359
  };
3348
3360
  const handleSelectChange = (selectId, value) => {
3349
3361
  const newAnswers = { ...answers, [selectId]: value };