(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=”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=>’