PairWordCard: partial correct selection counts as correct

A subset of correct words with no wrong selections now triggers confetti and marks the card as solved.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-01 10:46:49 +02:00
parent 1b44e004bd
commit 6b31fddb27

View File

@@ -126,9 +126,8 @@ export default function PairWordCard({ card, onComplete }) {
if (selectedIds.size === 0 || confirmed) return
setActiveChip(null)
const correctIds = new Set(options.filter(o => o.correct).map(o => o.id))
const allCorrectSelected = [...correctIds].every(id => selectedIds.has(id))
const noWrongSelected = [...selectedIds].every(id => correctIds.has(id))
const ok = allCorrectSelected && noWrongSelected
const ok = noWrongSelected
setIsCorrect(ok)
setConfirmed(true)
if (ok) triggerConfetti()