Add show explanation button in QuizRunner component
This commit is contained in:
@@ -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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user