Public Access
feat: add retake attempt functionality and update translations for retake button
This commit is contained in:
1 parent
028c732716
commit
95cf0db5a4
5 files changed
+24
-2
No files matched your search
@@ -11,6 +11,7 @@ interface Props {
|
||||
onResume: () => void
|
||||
onClearHistory: () => void
|
||||
onReviewAttempt: (entry: HistoryEntry) => void
|
||||
onRetakeAttempt?: (entry: HistoryEntry) => void
|
||||
}
|
||||
|
||||
const SAMPLES = [
|
||||
@@ -19,7 +20,7 @@ const SAMPLES = [
|
||||
{ path: '/samples/mixed-demo.json', title: 'Mixed Demo — Every Question Type', meta: '4 questions · Untimed · Media', mark: '◇' },
|
||||
]
|
||||
|
||||
export default function Landing({ onLoadExam, history, onResume, onClearHistory, onReviewAttempt }: Readonly<Props>) {
|
||||
export default function Landing({ onLoadExam, history, onResume, onClearHistory, onReviewAttempt, onRetakeAttempt }: Readonly<Props>) {
|
||||
const { t } = useTranslation()
|
||||
const [err, setErr] = useState<string | null>(null)
|
||||
const [dragOver, setDragOver] = useState(false)
|
||||
@@ -483,6 +484,9 @@ Set a 20-minute time limit. Include explanations for each answer."
|
||||
</div>
|
||||
<div className="mono muted" style={{ fontSize: 12 }}>{formatTime(h.elapsedMs)}</div>
|
||||
<div className={`score-pill ${passed ? 'pass' : 'fail'}`}>{pct}%</div>
|
||||
{onRetakeAttempt && (
|
||||
<button className="btn btn-ghost btn-sm" onClick={() => onRetakeAttempt(h)}>{t('landing.retake')}</button>
|
||||
)}
|
||||
<button className="btn btn-ghost btn-sm" onClick={() => onReviewAttempt(h)}>{t('landing.review')}</button>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user