// Idiom Practice — drills on IELTS-relevant idioms for "idiomatic range" (a scored Speaking/Writing criterion). // Two modes: "guess the idiom" MCQ and "check the register" (informal vs neutral), plus a browse list. function IdiomPractice({ state, update }) { const [category, setCategory] = useState('all'); const [mode, setMode] = useState('mcq'); // 'mcq' | 'register' | 'browse' const [current, setCurrent] = useState(null); const [selected, setSelected] = useState(null); const [locked, setLocked] = useState(false); const [stats, setStats] = useState({ correct: 0, total: 0 }); const pool = useMemo(() => { if (category === 'all') return window.IDIOMS; return window.IDIOMS.filter(c => c.cat === category); }, [category]); const generateMCQ = useCallback(() => { if (!pool.length) return; const correct = pool[Math.floor(Math.random() * pool.length)]; // Build 3 wrong distractors from different idioms const others = window.IDIOMS.filter(c => c.idiom !== correct.idiom); const distractors = []; while (distractors.length < 3 && others.length > distractors.length) { const pick = others[Math.floor(Math.random() * others.length)]; if (!distractors.find(d => d.idiom === pick.idiom)) distractors.push(pick); } const options = [correct, ...distractors].sort(() => Math.random() - 0.5); setCurrent({ correct, options, correctIndex: options.findIndex(o => o.idiom === correct.idiom) }); setSelected(null); setLocked(false); }, [pool]); const generateRegister = useCallback(() => { if (!pool.length) return; const item = pool[Math.floor(Math.random() * pool.length)]; setCurrent({ item }); setSelected(null); setLocked(false); }, [pool]); useEffect(() => { if (mode === 'mcq') generateMCQ(); else if (mode === 'register') generateRegister(); }, [mode, generateMCQ, generateRegister]); const chooseMCQ = (i) => { if (locked) return; setSelected(i); setLocked(true); setStats(s => ({ correct: s.correct + (i === current.correctIndex ? 1 : 0), total: s.total + 1 })); }; const chooseRegister = (answer) => { if (locked) return; const isCorrect = answer === current.item.register; setSelected(answer); setLocked(true); setStats(s => ({ correct: s.correct + (isCorrect ? 1 : 0), total: s.total + 1 })); }; const next = () => { mode === 'mcq' ? generateMCQ() : generateRegister(); }; const accuracy = stats.total > 0 ? Math.round(stats.correct / stats.total * 100) : 0; return (
Idioms · {window.IDIOMS.length} entries

Idiomatic range.

Examiners score "idiomatic range" directly. Learn idioms that sound natural — and know where they belong.

⚠️ Idioms suit Speaking and informal writing. Avoid them in formal Task 2 essays — examiners expect more formal, academic language there.
{/* Controls */}
{['mcq', 'register', 'browse'].map(m => ( ))}
{window.IDIOM_CATEGORIES.map(c => ( ))}
{/* Session bar */} {mode !== 'browse' && (
{stats.correct}/{stats.total} correct {accuracy}% accuracy
)} {/* MCQ mode */} {mode === 'mcq' && current && current.correct && (
{current.correct.cat}
Which idiom means this?
{current.correct.meaning}
{current.correct.b}
{current.options.map((opt, i) => { const isCorrect = i === current.correctIndex; const isSelected = i === selected; let bg = 'var(--bg-elevated)', border = 'var(--line)'; if (locked) { if (isCorrect) { bg = 'var(--success-soft)'; border = 'var(--success)'; } else if (isSelected) { bg = 'var(--danger-soft)'; border = 'var(--danger)'; } } return ( ); })}
{locked && (
{selected === current.correctIndex ? '✓ Correct!' : '✗ Not quite'}
✅ {current.correct.idiom} — {current.correct.meaning}
{current.correct.ex &&
"{current.correct.ex}"
}
)}
)} {/* Register mode */} {mode === 'register' && current && current.item && (
Informal, or safe more broadly?
"{current.item.idiom}"
{current.item.meaning}
{current.item.ex &&
"{current.item.ex}"
}
{!locked && (
)} {locked && (
{selected === current.item.register ? '✓ Correct!' : '✗ Not quite'}
This idiom is {current.item.register} — {current.item.register === 'informal' ? 'keep it to Speaking Part 3 / casual contexts.' : 'safe to use more broadly, but still not for formal Task 2 essays.'}
)}
)} {/* Browse mode */} {mode === 'browse' && (
{pool.map((c, i) => (
{c.idiom}
{c.meaning}
{c.b}
{c.ex?.slice(0, 60)}{c.ex?.length > 60 ? '…' : ''}
{c.register}
))}
)}
); } Object.assign(window, { IdiomPractice });