Fix logic for determining canSubmit in QuizRunner

This commit is contained in:
2026-01-08 02:11:16 +01:00
parent 6d5e788764
commit 540b544eed

View File

@@ -467,10 +467,10 @@ export default function QuizRunner({ defaultMode = 'all', defaultEntryId, autoSt
lastCorrect={lastCorrect} lastCorrect={lastCorrect}
canSubmit={Boolean( canSubmit={Boolean(
(currentQuestion.type === 'cloze' && response && String(response).trim().length > 0) || (currentQuestion.type === 'cloze' && response && String(response).trim().length > 0) ||
(currentQuestion.type === 'match' && response && Object.values(response).every((v) => v)) || (currentQuestion.type === 'match' && response && Object.values(response).every((v) => v)) ||
((currentQuestion.type || '').startsWith('mc') && typeof response === 'number') || ((currentQuestion.type || '').startsWith('mc') && typeof response === 'number') ||
(currentQuestion.type === 'choose_best_reply' && typeof response === 'number') || (currentQuestion.type === 'choose_best_reply' && typeof response === 'number') ||
(!currentQuestion.type && typeof response === 'number') (!currentQuestion.type && typeof response === 'number')
)} )}
/> />