feat: implement content management dashboard and update proxy configurations to support AI-assisted learning material generation
This commit is contained in:
@@ -37,11 +37,14 @@ const Testen = () => {
|
||||
// ── Check for existing result ──
|
||||
useEffect(() => {
|
||||
if (currentUser) {
|
||||
const existing = getTestResult(currentUser.id, weekNumber);
|
||||
if (existing) {
|
||||
setResult(existing);
|
||||
setPhase('results');
|
||||
}
|
||||
const check = async () => {
|
||||
const existing = await getTestResult(currentUser.id, weekNumber);
|
||||
if (existing) {
|
||||
setResult(existing);
|
||||
setPhase('results');
|
||||
}
|
||||
};
|
||||
check();
|
||||
}
|
||||
}, [currentUser, weekNumber]);
|
||||
|
||||
@@ -98,7 +101,7 @@ const Testen = () => {
|
||||
};
|
||||
|
||||
// ── Finish quiz & score ──
|
||||
const finishQuiz = useCallback(() => {
|
||||
const finishQuiz = useCallback(async () => {
|
||||
clearInterval(timerRef.current);
|
||||
if (!quiz) return;
|
||||
|
||||
@@ -129,7 +132,7 @@ const Testen = () => {
|
||||
breakdown,
|
||||
};
|
||||
|
||||
const { pointsEarned } = saveTestResult(currentUser.id, weekNumber, testResult);
|
||||
const { pointsEarned } = await saveTestResult(currentUser.id, weekNumber, testResult);
|
||||
testResult.pointsEarned = pointsEarned;
|
||||
setResult(testResult);
|
||||
setPhase('results');
|
||||
|
||||
Reference in New Issue
Block a user