From 0f26cdd2722c04d6098a0d9b6a03ed17833dc656 Mon Sep 17 00:00:00 2001 From: polv Date: Wed, 12 Aug 2026 23:38:22 +0700 Subject: [PATCH] save quiz state for chosen categories --- .../.vitepress/theme/components/VocabQuiz.vue | 25 +++++++++---- docs/howtostudykorean/unit-1/14-passive.md | 35 +++++++++---------- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/docs/.vitepress/theme/components/VocabQuiz.vue b/docs/.vitepress/theme/components/VocabQuiz.vue index f85f9fc..919df48 100644 --- a/docs/.vitepress/theme/components/VocabQuiz.vue +++ b/docs/.vitepress/theme/components/VocabQuiz.vue @@ -72,7 +72,12 @@ ๐Ÿง Quiz options @@ -127,7 +132,6 @@ const { fmKey = "vocabulary", category } = defineProps<{ }>(); const vCats = ref([]); -const vChosenCats = ref([]); const vList = ref([]); const vListOriginalIndex = ref<{ s: IVoc; k: number }[]>([]); const vIndex = ref(-1); @@ -137,6 +141,7 @@ const isEdit = ref(false); const vEditContent = ref(""); const quizState = reactive({ + vChosenCats: [] as string[], isAutoplayAudio: true, isKoFirst: true, }); @@ -202,7 +207,9 @@ if (category) { } } -vChosenCats.value = [...vCats.value]; +if (!quizState.vChosenCats.some((c) => vCats.value.includes(c))) { + quizState.vChosenCats = [...vCats.value]; +} watch( () => quizState.isKoFirst, @@ -234,7 +241,7 @@ function makeVList() { }); const newVList = Object.entries(vocabulary) - .filter(([k]) => vChosenCats.value.includes(k)) + .filter(([k]) => quizState.vChosenCats.includes(k)) .flatMap(([, vs]) => vs); vListOriginalIndex.value = newVList.map((s) => ({ @@ -309,14 +316,18 @@ function mark(isRight: boolean) { } function updateCats(cat: string) { - const i = vChosenCats.value.indexOf(cat); + const i = quizState.vChosenCats.indexOf(cat); if (i === -1) { - vChosenCats.value = [...vChosenCats.value, cat]; + quizState.vChosenCats = [...quizState.vChosenCats, cat]; } else { - vChosenCats.value = [...vChosenCats.value.filter((_, j) => j !== i)]; + quizState.vChosenCats = [ + ...quizState.vChosenCats.filter((_, j) => j !== i), + ]; } makeVList(); + + saveQuizState(); } async function onVContentSave() { diff --git a/docs/howtostudykorean/unit-1/14-passive.md b/docs/howtostudykorean/unit-1/14-passive.md index 9ac8e34..6c1ce98 100644 --- a/docs/howtostudykorean/unit-1/14-passive.md +++ b/docs/howtostudykorean/unit-1/14-passive.md @@ -332,7 +332,7 @@ vocabulary: notes: |

To indicate that you went from the sitting/lying down position to standing, the word "์ผ์–ด๋‚˜๋‹ค" (to get up) should be used.

examples: - - ko: ์šฐ๋ฆฌ๋Š” ํ•œ ์‹œ๊ฐ„ ๋™์•ˆ ์ค„์— **์„œ** **์žˆ์—ˆ์–ด์š”** + - ko: ์šฐ๋ฆฌ๋Š” ํ•œ ์‹œ๊ฐ„ ๋™์•ˆ ์ค„์— **์„œ ์žˆ์—ˆ์–ด์š”** en: We were **standing** in the line for an hour - ko: ์ €๋Š” ์ค„์— **์„œ**์„œ ์ˆœ์„œ๋ฅผ ๊ธฐ๋‹ค๋ ธ์–ด์š” en: I **stood** in line and waited for my turn @@ -351,7 +351,7 @@ vocabulary: en: to be turned on notes: The active form of this word is "์ผœ๋‹ค" (to turn on) examples: - - ko: ์ปดํ“จํ„ฐ๊ฐ€ **์ผœ์ ธ** **์žˆ์–ด์š”** + - ko: ์ปดํ“จํ„ฐ๊ฐ€ **์ผœ์ ธ ์žˆ์–ด์š”** en: The computer is **(in the state of being) on** - ko: ๊บผ์ง€๋‹ค @@ -359,8 +359,8 @@ vocabulary: en: to be turned off notes: The active form of this word is "๋„๋‹ค" (to turn off) examples: - - ko: TV๊ฐ€ **๊บผ์ ธ** **์žˆ์–ด์š”** - en: The TV is **(in the state of being)** **off** + - ko: TV๊ฐ€ **๊บผ์ ธ ์žˆ์–ด์š”** + en: The TV is **(in the state of being) off** - ko: ๋‚˜๋‹ค audio: https://www.howtostudykorean.com/wp-content/uploads/2015/11/Lesson14v30.mp3 @@ -388,7 +388,7 @@ vocabulary: examples: - ko: ์ €์˜ ์—ฌ์ž ์นœ๊ตฌ๋Š” ์ €ํ•œํ…Œ **ํ™”(๊ฐ€) ๋‚ฌ์–ด์š”** en: My girlfriend was **mad** at me - - ko: ์„ ์ƒ๋‹˜์„ ์กด๊ฒฝํ•˜์ง€ ์•Š์œผ๋ฉด ๋‚˜๋Š” **ํ™”๊ฐ€** **๋‚ ** **๊ฑฐ์•ผ** + - ko: ์„ ์ƒ๋‹˜์„ ์กด๊ฒฝํ•˜์ง€ ์•Š์œผ๋ฉด ๋‚˜๋Š” **ํ™”๊ฐ€ ๋‚  ๊ฑฐ์•ผ** en: If you don't respect your teacher, I will be **mad** - ko: ์งœ์ฆ๋‚˜๋‹ค @@ -407,9 +407,9 @@ vocabulary:

The pronunciation of this word is closer to "๋…ธ์ด๋‹ค"

The active form of this word is "๋†“๋‹ค" (to put down)

examples: - - ko: ํŽœ์ด ํƒ์ž์— **๋†“์—ฌ** **์žˆ์–ด์š”** - en: The pen is **on** the table (**lying** **on** the table) - - ko: ์ฑ…์ƒ์— ์ฑ… ๋ช‡ ๊ถŒ์ด **๋†“์—ฌ** **์žˆ์–ด์š”** + - ko: ํŽœ์ด ํƒ์ž์— **๋†“์—ฌ ์žˆ์–ด์š”** + en: The pen is **on** the table (**lying on** the table) + - ko: ์ฑ…์ƒ์— ์ฑ… ๋ช‡ ๊ถŒ์ด **๋†“์—ฌ ์žˆ์–ด์š”** en: There are some books **on** the desk - ko: ์—ด๋ฆฌ๋‹ค @@ -417,7 +417,7 @@ vocabulary: en: to be open notes: The active form of this word is "์—ด๋‹ค" (to open) examples: - - ko: ๋ฌธ์ด **์—ด๋ ค** **์žˆ์–ด์š”** + - ko: ๋ฌธ์ด **์—ด๋ ค ์žˆ์–ด์š”** en: The door is **open(ed)** - ko: ๋ฌธ์ด **์—ด๋ ค** ์žˆ์„ ๊ฒƒ ๊ฐ™์•„์š” en: The door will probably be **open** @@ -1166,7 +1166,7 @@ To indicate that you went from the sitting/lying down p Examples: -- ์šฐ๋ฆฌ๋Š” ํ•œ ์‹œ๊ฐ„ ๋™์•ˆ ์ค„์— **์„œ** **์žˆ์—ˆ์–ด์š”** = We were **standing** in the line for an hour +- ์šฐ๋ฆฌ๋Š” ํ•œ ์‹œ๊ฐ„ ๋™์•ˆ ์ค„์— **์„œ ์žˆ์—ˆ์–ด์š”** = We were **standing** in the line for an hour - ์ €๋Š” ์ค„์— **์„œ**์„œ ์ˆœ์„œ๋ฅผ ๊ธฐ๋‹ค๋ ธ์–ด์š” = I **stood** in line and waited for my turn @@ -1193,7 +1193,7 @@ The active form of this word is โ€œ์ผœ๋‹คโ€ (The computer is **(in the state of being) on** +- ์ปดํ“จํ„ฐ๊ฐ€ **์ผœ์ ธ ์žˆ์–ด์š”** = The computer is **(in the state of being) on** @@ -1205,7 +1205,7 @@ The active form of this word is โ€œ๋„๋‹คโ€ (The TV is **(in the state of being)** **off** +- TV๊ฐ€ **๊บผ์ ธ ์žˆ์–ด์š”** = The TV is **(in the state of being) off** @@ -1252,7 +1252,7 @@ Example: Example: - ์ €์˜ ์—ฌ์ž ์นœ๊ตฌ๋Š” ์ €ํ•œํ…Œ **ํ™”(๊ฐ€) ๋‚ฌ์–ด์š”** = My girlfriend was **mad** at me -- ์„ ์ƒ๋‹˜์„ ์กด๊ฒฝํ•˜์ง€ ์•Š์œผ๋ฉด ๋‚˜๋Š” **ํ™”๊ฐ€** **๋‚ ** **๊ฑฐ์•ผ** = If you donโ€™t respect your teacher, I will be **mad** +- ์„ ์ƒ๋‹˜์„ ์กด๊ฒฝํ•˜์ง€ ์•Š์œผ๋ฉด ๋‚˜๋Š” **ํ™”๊ฐ€ ๋‚  ๊ฑฐ์•ผ** = If you donโ€™t respect your teacher, I will be **mad** @@ -1263,8 +1263,7 @@ Example: Example: - ์ €๋Š” ๊ทธ๊ฐ€ ๋„ˆ๋ฌด **์งœ์ฆ๋‚˜์š”** = I am **annoyed** at him -- ์ˆ˜์••์ด ๋„ˆ๋ฌด ๋‚ฎ์•„์„œ ์šฐ๋ฆฌ ์ง‘์—์„œ ์ƒค์›Œ๋ฅผ ํ•˜๋ฉด **์งœ์ฆ์ด ๋‚˜์š”** - - It is **annoying** showering at my house because the water pressure is too low +- ์ˆ˜์••์ด ๋„ˆ๋ฌด ๋‚ฎ์•„์„œ ์šฐ๋ฆฌ ์ง‘์—์„œ ์ƒค์›Œ๋ฅผ ํ•˜๋ฉด **์งœ์ฆ์ด ๋‚˜์š”** = It is **annoying** showering at my house because the water pressure is too low @@ -1282,8 +1281,8 @@ Common Usages: Examples: -- ํŽœ์ด ํƒ์ž์— **๋†“์—ฌ** **์žˆ์–ด์š”** = The pen is **on** the table (**lying** **on** the table) -- ์ฑ…์ƒ์— ์ฑ… ๋ช‡ ๊ถŒ์ด **๋†“์—ฌ** **์žˆ์–ด์š”** = There are some books **on** the desk +- ํŽœ์ด ํƒ์ž์— **๋†“์—ฌ ์žˆ์–ด์š”** = The pen is **on** the table (**lying on** the table) +- ์ฑ…์ƒ์— ์ฑ… ๋ช‡ ๊ถŒ์ด **๋†“์—ฌ ์žˆ์–ด์š”** = There are some books **on** the desk @@ -1299,7 +1298,7 @@ Common Usages: Examples: -- ๋ฌธ์ด **์—ด๋ ค** **์žˆ์–ด์š”** = The door is **open(ed)** +- ๋ฌธ์ด **์—ด๋ ค ์žˆ์–ด์š”** = The door is **open(ed)** - ๋ฌธ์ด **์—ด๋ ค** ์žˆ์„ ๊ฒƒ ๊ฐ™์•„์š” = The door will probably be **open**