(function(){
const root=document.querySelector(‘[data-practice=”pharmacy”]’);
if(!root) return;
const data={“words”:[[“약국”,”yak-guk”,”pharmacy”,”Place to buy medicine.”,”약국이 어디예요?”],[“감기약”,”gam-gi-yak”,”cold medicine”,”Medicine for cold symptoms.”,”감기약 주세요”],[“기침”,”gi-chim”,”cough”,”Coughing symptom.”,”기침이 나요”],[“콧물”,”kon-mul”,”runny nose”,”Nasal symptom.”,”콧물이 나요”],[“목”,”mok”,”throat”,”Throat in this context.”,”목이 아파요”],[“열”,”yeol”,”fever”,”High body temperature.”,”열이 있어요”],[“두통”,”du-tong”,”headache”,”Head pain.”,”두통이 있어요”],[“처방전”,”cheo-bang-jeon”,”prescription”,”Doctor’s medicine order.”,”처방전 있어요”],[“복용”,”bo-gyong”,”taking medicine”,”Dosage or usage.”,”복용 방법”],[“식후”,”sik-hu”,”after meals”,”Take after eating.”,”식후에 드세요”],[“졸려요”,”jol-lyeo-yo”,”sleepy”,”Causes drowsiness.”,”이 약 졸려요?”],[“알레르기”,”al-le-reu-gi”,”allergy”,”Allergy information.”,”알레르기 있어요”]],”situations”:[[“You have a cough. Which Korean phrase works?”,”기침이 나요”,[“기침이 나요”,”식후에 드세요”,”처방전 있어요”,”알레르기 있어요”],”기침이 나요 means I have a cough.”],[“The pharmacist says 식후에 드세요. When should you take it?”,”after meals”,[“before sleeping”,”after meals”,”with coffee”,”only once”],”식후 means after meals.”]]};
let flash=0, mc=0, spell=0, sit=0, score=0, total=0, missed=[];
const $=(sel)=>root.querySelector(sel);
function showFlash(){
const w=data.words[flash % data.words.length];
$(‘.flash-word’).textContent=w[0];
$(‘.flash-roman’).textContent=w[1];
$(‘.flash-meaning’).textContent=’Click “Show Meaning” to check yourself.’;
$(‘.flash-example’).textContent=w[4];
}
function showMeaning(){
const w=data.words[flash % data.words.length];
$(‘.flash-meaning’).textContent=w[2]+’ – ‘+w[3];
}
function nextFlash(){ flash++; showFlash(); }
function makeOptions(answer, source){
const pool=source.filter(v=>v!==answer).sort(()=>Math.random()-0.5).slice(0,3);
return [answer,…pool].sort(()=>Math.random()-0.5);
}
function updateScore(){ $(‘.score’).textContent=score+’ / ‘+total; $(‘.missed’).innerHTML=missed.length?missed.map(m=>’
(function(){
const root=document.querySelector(‘[data-practice=”subway”]’);
if(!root) return;
const data={“words”:[[“출구”,”chul-gu”,”exit”,”Use this to leave the station.”,”2번 출구”],[“환승”,”hwan-seung”,”transfer”,”Use this to change subway lines.”,”2호선 환승”],[“방면”,”bang-myeon”,”toward / direction”,”Shows the direction a train or passage goes.”,”서울역 방면”],[“승강장”,”seung-gang-jang”,”platform”,”Where passengers board the train.”,”승강장 가는 길”],[“화장실”,”hwa-jang-sil”,”restroom”,”Facility sign for toilets.”,”화장실 오른쪽”],[“오른쪽”,”o-reun-jjok”,”right”,”Direction word.”,”오른쪽으로 가세요”],[“왼쪽”,”oen-jjok”,”left”,”Direction word.”,”왼쪽 출구”],[“직진”,”jik-jin”,”straight”,”Continue forward.”,”직진하세요”],[“계단”,”gye-dan”,”stairs”,”Stairway sign.”,”계단 이용”],[“엘리베이터”,”el-li-be-i-teo”,”elevator”,”Accessible vertical movement.”,”엘리베이터”]],”situations”:[[“You need to leave the station and meet someone outside Exit 3. Which word should you look for?”,”출구”,[“환승”,”출구”,”방면”,”계단”],”출구 means exit, and exit numbers matter in Korean subway stations.”],[“You are changing from Line 2 to Line 7 without leaving the station. Which word matters most?”,”환승”,[“화장실”,”환승”,”직진”,”출구”],”환승 means transfer, so it keeps you inside the subway system.”]]};
let flash=0, mc=0, spell=0, sit=0, score=0, total=0, missed=[];
const $=(sel)=>root.querySelector(sel);
function showFlash(){
const w=data.words[flash % data.words.length];
$(‘.flash-word’).textContent=w[0];
$(‘.flash-roman’).textContent=w[1];
$(‘.flash-meaning’).textContent=’Click “Show Meaning” to check yourself.’;
$(‘.flash-example’).textContent=w[4];
}
function showMeaning(){
const w=data.words[flash % data.words.length];
$(‘.flash-meaning’).textContent=w[2]+’ – ‘+w[3];
}
function nextFlash(){ flash++; showFlash(); }
function makeOptions(answer, source){
const pool=source.filter(v=>v!==answer).sort(()=>Math.random()-0.5).slice(0,3);
return [answer,…pool].sort(()=>Math.random()-0.5);
}
function updateScore(){ $(‘.score’).textContent=score+’ / ‘+total; $(‘.missed’).innerHTML=missed.length?missed.map(m=>’