// Collocation Practice โ€” drills on natural word combinations. // Two modes: "pick the correct collocation" MCQ and "spot the error" correction. function CollocationPractice({ state, update }) { const [category, setCategory] = useState('all'); const [mode, setMode] = useState('mcq'); // 'mcq' | 'error' | '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 [browseIdx, setBrowseIdx] = useState(0); const pool = useMemo(() => { if (category === 'all') return window.COLLOCATIONS; return window.COLLOCATIONS.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 collocations const others = window.COLLOCATIONS.filter(c => c.col !== correct.col); const distractors = []; while (distractors.length < 3 && others.length > distractors.length) { const pick = others[Math.floor(Math.random() * others.length)]; if (!distractors.find(d => d.col === pick.col)) distractors.push(pick); } // Extract the verb/adjective part for the quiz const options = [correct, ...distractors].sort(() => Math.random() - 0.5); setCurrent({ correct, options, correctIndex: options.findIndex(o => o.col === correct.col) }); setSelected(null); setLocked(false); }, [pool]); const generateError = useCallback(() => { if (!pool.length) return; const item = pool[Math.floor(Math.random() * pool.length)]; // Show the WRONG version and ask user to spot + fix it const showWrong = Math.random() > 0.4; // 60% show wrong, 40% show correct setCurrent({ item, showWrong, displayed: showWrong ? item.wrong : item.col }); setSelected(null); setLocked(false); }, [pool]); useEffect(() => { if (mode === 'mcq') generateMCQ(); else if (mode === 'error') generateError(); }, [mode, generateMCQ, generateError]); 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 chooseError = (answer) => { if (locked) return; const isCorrect = (answer === 'wrong' && current.showWrong) || (answer === 'correct' && !current.showWrong); setSelected(answer); setLocked(true); setStats(s => ({ correct: s.correct + (isCorrect ? 1 : 0), total: s.total + 1 })); }; const next = () => { mode === 'mcq' ? generateMCQ() : generateError(); }; const accuracy = stats.total > 0 ? Math.round(stats.correct / stats.total * 100) : 0; return (
Collocations ยท {window.COLLOCATIONS.length} entries

Word combinations.

Natural English uses specific word pairs. Getting these right jumps you from band 6 to band 7.

{/* Controls */}
{['mcq', 'error', 'browse'].map(m => ( ))}
{window.COLLOCATION_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 is the correct collocation?
{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.col} โ€” not "{current.correct.wrong}"
{current.correct.ex &&
"{current.correct.ex}"
}
)}
)} {/* Error-spotting mode */} {mode === 'error' && current && current.item && (
Is this collocation correct or wrong?
"{current.displayed}"
{current.item.b}
{!locked && (
)} {locked && (
{((selected === 'wrong' && current.showWrong) || (selected === 'correct' && !current.showWrong)) ? 'โœ“ Correct!' : 'โœ— Nope'}
{current.showWrong ? <>โŒ "{current.item.wrong}" is wrong. โœ… The correct form is "{current.item.col}" : <>โœ… "{current.item.col}" is correct! }
{current.item.ex &&
"{current.item.ex}"
}
)}
)} {/* Browse mode */} {mode === 'browse' && (
{pool.map((c, i) => (
โœ… {c.col}
โŒ {c.wrong}
{c.b}
{c.ex?.slice(0, 60)}{c.ex?.length > 60 ? 'โ€ฆ' : ''}
))}
)}
); } Object.assign(window, { CollocationPractice });