Add show explanation button in QuizRunner component

This commit is contained in:
2026-01-08 01:11:01 +01:00
parent 6c28ad9f81
commit 8a4b3a4cf3

View File

@@ -433,13 +433,20 @@ export default function QuizRunner({ defaultMode = 'all', defaultEntryId, autoSt
</> </>
)} )}
{showResult && ( {showResult && (
<button className="button button--primary" onClick={goNext}> <>
{currentIndex + 1 === questions.length ? 'Finish' : 'Next'} {lastCorrect && !showExplanation && (
</button> <button className="button button--ghost" onClick={() => setShowExplanation(true)}>
Show explanation
</button>
)}
<button className="button button--primary" onClick={goNext}>
{currentIndex + 1 === questions.length ? 'Finish' : 'Next'}
</button>
</>
)} )}
</div> </div>
{showResult && !lastCorrect && <ExplanationPanel question={currentQuestion} targets={targets} />} {shouldShowExplanation && <ExplanationPanel question={currentQuestion} targets={targets} />}
</div> </div>
); );
} }