Add lesson content editor, quiz test endpoint, and lesson update API
All checks were successful
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Successful in 36s
CI / test-python-backend-compliance (push) Successful in 31s
CI / test-python-document-crawler (push) Successful in 23s
CI / test-python-dsms-gateway (push) Successful in 21s

- Backend: UpdateLesson handler (PUT /lessons/:id) for editing title, content, quiz questions
- Backend: TestQuiz handler (POST /lessons/:id/quiz-test) for quiz evaluation without enrollment
- Frontend: Content editor with markdown textarea, save, and approve-for-video workflow
- Frontend: Fix quiz endpoint to /lessons/:id/quiz-test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-02-26 17:57:15 +01:00
parent 1698912a27
commit 8acf1d2e12
5 changed files with 311 additions and 12 deletions

View File

@@ -321,11 +321,11 @@ export async function generateCertificate(enrollmentId: string): Promise<Certifi
// =============================================================================
/**
* Quiz-Antworten einreichen und auswerten
* Quiz-Antworten einreichen und auswerten (ohne Enrollment)
*/
export async function submitQuiz(lessonId: string, answers: SubmitQuizRequest): Promise<SubmitQuizResponse> {
return fetchWithTimeout<SubmitQuizResponse>(
`${ACADEMY_API_BASE}/lessons/${lessonId}/quiz`,
`${ACADEMY_API_BASE}/lessons/${lessonId}/quiz-test`,
{
method: 'POST',
body: JSON.stringify(answers)
@@ -333,6 +333,25 @@ export async function submitQuiz(lessonId: string, answers: SubmitQuizRequest):
)
}
/**
* Lektion aktualisieren (Content, Titel, Quiz-Fragen)
*/
export async function updateLesson(lessonId: string, update: {
title?: string
description?: string
content_url?: string
duration_minutes?: number
quiz_questions?: Array<{ question: string; options: string[]; correct_index: number; explanation: string }>
}): Promise<{ lesson: any }> {
return fetchWithTimeout(
`${ACADEMY_API_BASE}/lessons/${lessonId}`,
{
method: 'PUT',
body: JSON.stringify(update)
}
)
}
// =============================================================================
// STATISTICS
// =============================================================================