1import { _ as _export_sfc, r as ref, w as watch, v as onMounted, d as openBlock, e as createElementBlock, A as createBaseVNode, J as toDisplayString, K as createCommentVNode, N as createTextVNode, Q as normalizeClass, z as createVNode, n as normalizeStyle } from "./index-BHBk8sZF.js"; 2import { V as VTextField } from "./VTextField-HK2wTYdQ.js"; 3import "./index-NSOnyn2l.js"; 4import "./transition-CS7Qo3dO.js"; 5import "./VInput-DqJN5SaV.js"; 6import "./VIcon-DarVhfS2.js"; 7import "./color-B5ZhD1Fv.js"; 8import "./size-CbZ1bE7X.js"; 9import "./density-D_1sQJnX.js"; 10import "./loader-Bs0BZTKJ.js"; 11import "./VProgressLinear-CBzMcZao.js"; 12import "./intersectionObserver-DH5fm1TF.js"; 13import "./rounded-CKBQHTI1.js"; 14import "./animation-K5qeGU_D.js"; 15import "./forwardRefs-BSTjJZPU.js"; 16import "./index-DzYRlmnr.js"; 17const _hoisted_1 = { class: "exercise-header" }; 18const _hoisted_2 = { class: "tw-flex tw-flex-col tw-justify-between tw-items-start" }; 19const _hoisted_3 = { class: "exercise-description" }; 20const _hoisted_4 = { 21 key: 0, 22 class: "exercise-tip" 23}; 24const _hoisted_5 = { class: "exercise-statement" }; 25const _hoisted_6 = { key: 0 }; 26const _hoisted_7 = { 27 key: 1, 28 class: "hit-status" 29}; 30const _hoisted_8 = { class: "exercise-answer" }; 31const _hoisted_9 = { key: 2 }; 32const _hoisted_10 = { class: "missed-status" }; 33const _hoisted_11 = { class: "exercise-answer" }; 34const _hoisted_12 = { 35 key: 0, 36 class: "tw-flex tw-flex-col tw-items-center tw-mt-[30px]" 37}; 38const _hoisted_13 = { class: "exercise-description" }; 39const _hoisted_14 = { class: "exercise-statement !tw-mt-[10px]" }; 40const _hoisted_15 = { class: "hit-status" }; 41const _hoisted_16 = { 42 key: 0, 43 class: "icon icon-close-eye" 44}; 45const _hoisted_17 = { 46 key: 1, 47 class: "icon icon-Eye" 48}; 49const _hoisted_18 = { key: 2 }; 50const _hoisted_19 = { key: 3 }; 51const _hoisted_20 = { 52 key: 0, 53 class: "exercise-complete" 54}; 55const _hoisted_21 = { 56 key: 1, 57 class: "exercise-complete-hit" 58}; 59const _hoisted_22 = { class: "tw-flex tw-justify-center tw-items-center text-container" }; 60const _hoisted_23 = { class: "tw-flex tw-justify-center tw-items-center tw-mb-[10px]" }; 61const _hoisted_24 = { class: "error-reminder" }; 62const _hoisted_25 = { 63 key: 2, 64 class: "exercise-complete-missed" 65}; 66const _hoisted_26 = { class: "tw-flex tw-justify-center tw-items-center text-container" }; 67const _hoisted_27 = { class: "tw-flex tw-justify-center tw-items-center tw-mb-[10px]" }; 68const _hoisted_28 = { class: "error-reminder" }; 69const _sfc_main = { 70 __name: "CompleteStatementExercise", 71 props: ["currentExercise", "exerciseHitTitle"], 72 emits: [ 73 "answerExercise", 74 "nextExercise", 75 "randomHitExerciseTitle", 76 "changeRealTimeExerciseStatus" 77 ], 78 setup(__props, { emit: __emit }) { 79 let props = __props; 80 let emit = __emit; 81 const exerciseStatus = ref(null); 82 const exerciseAnswer = ref(""); 83 const showAnswer = ref(false); 84 watch( 85 () => props.currentExercise, 86 () => { 87 exerciseStatus.value = null; 88 exerciseAnswer.value = ""; 89 setTimeout(() => { 90 exerciseStatus.value == null && focusAnswerExerciseInput(); 91 }, 100); 92 } 93 ); 94 onMounted(() => { 95 focusAnswerExerciseInput(); 96 addEnterKeyEventListener(); 97 }); 98 const focusAnswerExerciseInput = () => { 99 document.getElementById("exerciseAnswerInput").focus(); 100 }; 101 const addEnterKeyEventListener = () => { 102 window.addEventListener("keyup", (e) => { 103 if (e.key == "Enter" && exerciseAnswer.value != "") { 104 if (exerciseStatus.value == null) answerExercise(exerciseAnswer.value); 105 else emitNextExercise(); 106 } 107 }); 108 }; 109 const answerExercise = async (answer) => { 110 const resp = [ 111 normalizeAnswerAccent(props.currentExercise.answer), 112 normalizeAnswerAccent(props.currentExercise.a || ""), 113 normalizeAnswerAccent(props.currentExercise.b || ""), 114 normalizeAnswerAccent(props.currentExercise.c || "") 115 ]; 116 if (normalizeAnswerAccent(answer.toUpperCase()) != "" && resp.find((res) => normalizeAnswerAccent(res.toUpperCase().trim()) == normalizeAnswerAccent(answer.toUpperCase().trim()))) { 117 exerciseStatus.value = "hit"; 118 emit("changeRealTimeExerciseStatus", "hit"); 119 } else { 120 exerciseStatus.value = "missed"; 121 emit("changeRealTimeExerciseStatus", "missed"); 122 } 123 emit("answerExercise", answer, exerciseStatus.value); 124 }; 125 const normalizeAnswerAccent = (answer) => { 126 return answer.replace(/[ââ`']/g, "'").toUpperCase().trim(); 127 }; 128 const setShowAnswer = () => { 129 showAnswer.value = !showAnswer.value; 130 }; 131 const emitNextExercise = () => { 132 resetCurrentExerciseStatus();
133 emit("nextExercise"); 134 }; 135 const resetCurrentExerciseStatus = () => { 136 exerciseStatus.value = null; 137 exerciseAnswer.value = ""; 138 showAnswer.value = false; 139 emit("changeRealTimeExerciseStatus", ""); 140 }; 141 return (_ctx, _cache) => { 142 return openBlock(), createElementBlock("div", { 143 class: normalizeClass(["complete-exercise-container tw-flex tw-flex-col tw-justify-between tw-items-center tw-w-full", exerciseStatus.value != null && "complete-exercise-container-status"]) 144 }, [ 145 createBaseVNode("div", _hoisted_1, [ 146 createBaseVNode("div", _hoisted_2, [ 147 createBaseVNode("span", _hoisted_3, toDisplayString(__props.currentExercise.title), 1), 148 __props.currentExercise.subtitle != null ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(__props.currentExercise.subtitle), 1)) : createCommentVNode("", true) 149 ]), 150 createBaseVNode("div", _hoisted_5, [ 151 exerciseStatus.value == null ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(__props.currentExercise.start) + " _______ " + toDisplayString(__props.currentExercise.end), 1)) : exerciseStatus.value == "hit" ? (openBlock(), createElementBlock("span", _hoisted_7, [ 152 createTextVNode(toDisplayString(__props.currentExercise.start) + " ", 1), 153 createBaseVNode("span", _hoisted_8, toDisplayString(exerciseAnswer.value), 1), 154 createTextVNode(" " + toDisplayString(__props.currentExercise.end), 1) 155 ])) : exerciseStatus.value == "missed" ? (openBlock(), createElementBlock("div", _hoisted_9, [ 156 createBaseVNode("span", _hoisted_10, [ 157 createTextVNode(toDisplayString(__props.currentExercise.start) + " ", 1), 158 createBaseVNode("span", _hoisted_11, toDisplayString(exerciseAnswer.value), 1), 159 createTextVNode(" " + toDisplayString(__props.currentExercise.end), 1) 160 ]) 161 ])) : createCommentVNode("", true) 162 ]), 163 exerciseStatus.value == "missed" ? (openBlock(), createElementBlock("div", _hoisted_12, [ 164 createBaseVNode("span", _hoisted_13, toDisplayString(_ctx.$t("regular_lesson_exercises_grammatic.correct_answer")), 1), 165 createBaseVNode("div", _hoisted_14, [ 166 createBaseVNode("span", _hoisted_15, [ 167 createTextVNode(toDisplayString(__props.currentExercise.start) + " ", 1), 168 createBaseVNode("span", { 169 class: normalizeClass(["exercise-answer", { "blur-answer": !showAnswer.value }]) 170 }, toDisplayString(__props.currentExercise.answer), 3), 171 createTextVNode(" " + toDisplayString(__props.currentExercise.end), 1) 172 ]) 173 ]), 174 createBaseVNode("div", { 175 class: "show-answer-btn", 176 onClick: setShowAnswer 177 }, [ 178 !showAnswer.value ? (openBlock(), createElementBlock("i", _hoisted_16)) : createCommentVNode("", true), 179 showAnswer.value ? (openBlock(), createElementBlock("i", _hoisted_17)) : createCommentVNode("", true), 180 !showAnswer.value ? (openBlock(), createElementBlock("span", _hoisted_18, toDisplayString(_ctx.$t("regular_lesson_exercises_grammatic.show_answer")), 1)) : createCommentVNode("", true), 181 showAnswer.value ? (openBlock(), createElementBlock("span", _hoisted_19, toDisplayString(_ctx.$t("regular_lesson_exercises_grammatic.hide_answer")), 1)) : createCommentVNode("", true) 182 ]) 183 ])) : createCommentVNode("", true) 184 ]), 185 exerciseStatus.value == null ? (openBlock(), createElementBlock("div", _hoisted_20, [ 186 createVNode(VTextField, { 187 modelValue: exerciseAnswer.value, 188 "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => exerciseAnswer.value = $event), 189 label: _ctx.$t("regular_lesson_exercises_grammatic.answer_input_placeholder"), 190 name: "answer", 191 variant: "outlined", 192 "single-line": "", 193 type: "text", 194 required: "", 195 class: "exercise-answer", 196 id: "exerciseAnswerInput" 197 }, null, 8, ["modelValue", "label"]), 198 createBaseVNode("div", { 199 class: "answer-btn", 200 style: normalizeStyle({ 201 opacity: exerciseAnswer.value != "" ? 1 : 0.5, 202 cursor: exerciseAnswer.value != "" ? "pointer" : "default" 203 }), 204 onClick: _cache[1] || (_cache[1] = ($event) => exerciseAnswer.value != "" && answerExercise(exerciseAnswer.value)) 205 }
205, toDisplayString(_ctx.$t("regular_lesson_exercises_grammatic.check_answer_button")), 5) 206 ])) : createCommentVNode("", true), 207 exerciseStatus.value == "hit" ? (openBlock(), createElementBlock("div", _hoisted_21, [ 208 createBaseVNode("div", _hoisted_22, [ 209 createBaseVNode("div", _hoisted_23, [ 210 _cache[4] || (_cache[4] = createBaseVNode("span", { class: "close-icon" }, [ 211 createBaseVNode("i", { class: "icon-Check" }) 212 ], -1)), 213 createBaseVNode("span", null, toDisplayString(_ctx.$t("regular_lesson_exercises_grammatic.hit_title")), 1) 214 ]), 215 createBaseVNode("span", _hoisted_24, toDisplayString(_ctx.$t("regular_lesson_exercises_grammatic.hit_body")), 1) 216 ]), 217 createBaseVNode("div", { 218 class: "answer-btn", 219 onClick: _cache[2] || (_cache[2] = ($event) => exerciseAnswer.value != "" && emitNextExercise()) 220 }, toDisplayString(_ctx.$t("regular_lesson_exercises_grammatic.next_question_button")), 1) 221 ])) : createCommentVNode("", true), 222 exerciseStatus.value == "missed" ? (openBlock(), createElementBlock("div", _hoisted_25, [ 223 createBaseVNode("div", _hoisted_26, [ 224 createBaseVNode("div", _hoisted_27, [ 225 _cache[5] || (_cache[5] = createBaseVNode("span", { class: "close-icon" }, [ 226 createBaseVNode("i", { class: "icon-close" }) 227 ], -1)), 228 createBaseVNode("span", null, toDisplayString(_ctx.$t("regular_lesson_exercises_grammatic.missed_title")), 1) 229 ]), 230 createBaseVNode("span", _hoisted_28, toDisplayString(_ctx.$t("regular_lesson_exercises_grammatic.missed_body")), 1) 231 ]), 232 createBaseVNode("div", { 233 class: "answer-btn", 234 onClick: _cache[3] || (_cache[3] = ($event) => exerciseAnswer.value != "" && emitNextExercise()) 235 }, toDisplayString(_ctx.$t("regular_lesson_exercises_grammatic.next_question_button")), 1) 236 ])) : createCommentVNode("", true) 237 ], 2); 238 }; 239 } 240}; 241const CompleteStatementExercise = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-febc4fb0"]]); 242export { 243 CompleteStatementExercise as default 244};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.