(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=>’
(function(){
const root=document.querySelector(‘[data-practice=”apartment”]’);
if(!root) return;
const data={“words”:[[“아파트”,”a-pa-teu”,”apartment”,”Apartment complex or building.”,”아파트 입구”],[“동”,”dong”,”building number”,”Apartment building number.”,”101동”],[“호”,”ho”,”unit number”,”Apartment unit.”,”1203호”],[“층”,”cheung”,”floor”,”階またはフロア.”,”5층”],[“입구”,”ip-gu”,”entrance”,”Place to enter.”,”입구”],[“관리사무소”,”gwal-li-sa-mu-so”,”management office”,”Apartment office.”,”관리사무소”],[“주차장”,”ju-cha-jang”,”parking lot”,”Parking area.”,”지하 주차장”],[“지하”,”ji-ha”,”basement”,”Underground level.”,”지하 1층”],[“엘리베이터”,”el-li-be-i-teo”,”elevator”,”Lift inside building.”,”엘리베이터”],[“경비실”,”gyeong-bi-sil”,”security office”,”Guard office.”,”경비실”]],”situations”:[[“In 101동 1203호, which part is the building?”,”101동”,[“1203호”,”101동”,”5층”,”입구”],”동 marks the apartment building number.”],[“You need help from the apartment office. Which sign should you look for?”,”관리사무소”,[“경비실”,”관리사무소”,”주차장”,”호”],”관리사무소 is the management office.”]]};
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=>’