feat: implement content management dashboard and update proxy configurations to support AI-assisted learning material generation
This commit is contained in:
@@ -53,14 +53,14 @@ const Leren = () => {
|
||||
}
|
||||
}, [state.currentUser, state.weekNumber]);
|
||||
|
||||
const handleOpenTopic = (topic) => {
|
||||
const handleOpenTopic = async (topic) => {
|
||||
setActiveTopic(topic);
|
||||
setView('detail');
|
||||
setSessionDone(false);
|
||||
setError(null);
|
||||
setFeedbackText('');
|
||||
setFeedbackPrompted(false);
|
||||
const cached = getCachedContent(topic.id);
|
||||
const cached = await getCachedContent(topic.id);
|
||||
if (cached) {
|
||||
setContent(cached);
|
||||
} else {
|
||||
|
||||
@@ -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