feat(teacher-tools): implement AI generation for lesson planning, revisions, and summarization - #279
Conversation
- Add Svelte interfaces for pedagogical planning, revision sheets, and document transcripts - Implement inline Markdown editing with dynamic full-width layouts - Add FastAPI backend to orchestrate LLMs and save ContentResources
|
Hi @ZakariaElamrani Your PR description follows the right format (Added/Changed/Fixed sections)— that part is good. But the project rule requires that documentation is submitted with your code in the same Pull Request. For three features with a visible UI (curriculum planning, revision sheets, document summarization), this means at minimum:
Could you add these in docs/ before this is ready for review? |
📋 Backend Review — Request Changes 🔴Thanks for this — the three teacher tools are a nice idea, and the LLM wiring is actually done the right way (model resolution through 🔴 Must fix (breaks build/runtime):
🔴 Security: 🟠 Architecture / data: 🟡 Also: French → English throughout, replace |
|
Hi, thk for contuning dev. |
There was a problem hiding this comment.
Pull request overview
This PR adds a new “teacher content” feature slice that lets teachers generate and edit AI-produced pedagogical assets (annual curriculum planning, revision sheets, and document transcript summaries) from the Svelte teacher workspace, backed by new FastAPI endpoints and persistence models (ContentResource / QuestionItem).
Changes:
- Added three new teacher UI pages for curriculum planning, revision sheet generation, and transcript/document summarization (with inline Markdown preview/edit flows).
- Added a new frontend API client module (
$lib/apis/teacher-content) and a new backend router (/api/v1/teacher/content/*) to orchestrate LLM calls and save generated content. - Added new SQLAlchemy models and a repository for storing teacher-generated content resources and question items.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/routes/teacher/content/transcripts/+page.svelte | New UI flow to extract document text and generate an AI summary with preview/edit/copy. |
| ui/src/routes/teacher/content/revisions/+page.svelte | New UI flow to generate revision sheets from teacher-provided “frequent errors”. |
| ui/src/routes/teacher/content/curriculum/+page.svelte | New UI flow to upload a syllabus and generate a week-by-week curriculum timeline plus scenario generation modal. |
| ui/src/lib/apis/teacher-content/index.ts | New TS API client for teacher content endpoints (generation + question bank + extraction). |
| gateway/http/routers/teacher_content.py | New FastAPI router implementing upload/indexing, LLM generation, extraction, and question bank endpoints. |
| gateway/http/app.py | Registers the new teacher_content router with the application. |
| data/repositories/content_resource_repository.py | New repository for CRUD operations over ContentResource and QuestionItem. |
| data/models/content_resources.py | New ORM models for persisted teacher content resources and question items. |
| data/models/init.py | Registers the new ORM models for metadata/table creation. |
| file_path = os.path.join(teacher_dir, file.filename) | ||
| with open(file_path, "wb") as buffer: | ||
| shutil.copyfileobj(file.file, buffer) |
| repo = ContentResourceRepository(db) | ||
| resources = repo.get_by_classroom(classroom_id) | ||
|
|
||
| # Filtrer uniquement les RAG documents | ||
| rag_docs = [r for r in resources if r.resource_type == ResourceType.RAG_DOCUMENT] |
|
|
||
| results = [repo.db.query(QuestionItem).filter(QuestionItem.id == qid).first() for qid in question_ids] | ||
| results = [r for r in results if r is not None] |
| tags=q.tags, | ||
| created_by=user.id | ||
| ) | ||
| question = repo.add_question(question) |
| } | ||
| vector_store.index_question(question.id, q.question_text, metadata) | ||
|
|
||
| return content |
| const response = await generateRevisionSheet(token, { | ||
| classroom_id: 1, // Mock | ||
| frequent_errors: frequentErrors, | ||
| model_id: selectedModel | ||
| }); |
| const response = await generateTranscriptSummary(token, { | ||
| classroom_id: 1, // Mock classroom ID for now | ||
| transcription: transcriptionText, | ||
| model_id: selectedModel | ||
| }); |
| > | ||
| <input | ||
| type="file" | ||
| accept=".pdf,.txt,.docx" |
| <p class="text-sm font-medium text-gray-900 dark:text-white"> | ||
| {$i18n.t('Cliquez ou glissez-déposez le document')} | ||
| </p> | ||
| <p class="text-xs text-gray-500 mt-1">PDF, TXT, DOCX</p> |
| export interface RevisionSheetResponse { | ||
| resource_id: number; | ||
| content: string; | ||
| } | ||
|
|
Description
ContentResources.Added
curriculum), revision sheets (revisions), and document transcripts (transcripts).teacher_content) to proxy LLM requests and orchestrate content generation.ContentResourcedatabase models and repositories to persistently save generated pedagogical assets.Changed
Deprecated
Removed
Fixed
subjectfield dependency when saving revision sheets.Security
Breaking Changes
Additional Information
Screenshots
1. Curriculum Planning

2. Revision Sheets

3. Document Summarization