Skip to main content

Syllabus & Knowledge Base

Admin uploads syllabus PDFs in the Syllabus Knowledge Base (Board → Class → Subject → Document). The backend processes each upload into vector embeddings the AI uses to answer questions. Students, parents, and teachers all browse the same subject → chapter → module hierarchy, with progress tracking woven through the student view.

At a glance

Who can do thisAdmin uploads & manages documents · Students / Teachers / Parents browse
Where it livesAdmin /dashboard/syllabus-knowledge-base · Student app /dashboard/syllabus, /dashboard/syllabus/:subjectsForSchoolClassId, …/:chapterId, …/:moduleId · Parent app /syllabus, /syllabus/:subjectId, /syllabus/:subjectId/chapters/:chapterId · Admin AI sandbox /dashboard/vector-search-test
HierarchyBoard → Class → Subject → Document → (parsed) Chapter → Module
Triggers notifications?No (background processing only — embedding-progress socket events update the admin UI)
Related featuresAI Tutor · Chapter Tests · Yearly to Weekly Plan

How it flows

Status lifecycle

This applies to a single uploaded document on the admin side.

The StatusTag component in the documents table renders these four states. Live updates arrive via the embedding-progress socket event.

Step-by-step

1. Admin opens the Knowledge Base

  • App / route: Admin → /dashboard/syllabus-knowledge-base (page title: Syllabus Knowledge Base).
  • Tabs: CBSE, ICSE, State Board (boards are hardcoded keys but mapped to the live board IDs on load).
  • Each board tab shows a 12-class grid (Class 1 – Class 12). Tapping a class navigates to /dashboard/syllabus-knowledge-base/:boardKey/class-:N/subjects?classId=:dbId.
  • Top-right Upload Document button opens the global drawer (board → class → subject → file picker).

2. Admin picks a subject

  • App / route: /dashboard/syllabus-knowledge-base/:boardKey/:classKey/subjects?classId=… (SubjectsPage).
  • Lists all subjects mapped to that class.
  • Tapping a subject navigates to /dashboard/syllabus-knowledge-base/:boardKey/:classKey/subject/:subjectId/documents?classId=….

3. Admin uploads a document

  • App / route: documents page → Upload Document drawer (SimpleUploadDrawer).
  • Inputs:
    • File (single PDF — accept=".pdf"; size visible during upload).
    • Academic year (auto-filled from getCurrentAcademicYear()).
    • Board key, class id, subject id (carried from the route).
  • Upload progress is reported live; on success the drawer closes and the table refreshes.
  • The new row shows processingStatus = pendingprocessingcompleted/failed. The admin does not need to refresh — the page subscribes to the embedding-progress socket event and patches the row in place.
  • Row actions: Download (S3 URL), Delete (with confirm popconfirm).
  • App / route: Admin → /dashboard/vector-search-test (VectorSearchTest).
  • Admin types a question; backend streams a structured LLM answer over the indexed embeddings.
  • The page exposes searchStream which surfaces token streaming, then a "generating sections" phase, then a final structured response. Useful for sanity-checking that newly uploaded PDFs are queryable.

5. Student browses

  • App / route: Student app → /dashboard/syllabus (SyllabusPage).
  • Uses the student's class to load the subjects grid (3 columns, with subject icon + colour). Hero illustration on first load.
  • Tapping a subject → /dashboard/syllabus/:subjectsForSchoolClassId (SubjectDetailPage) — list of chapters with progress per chapter, locked/unlocked state.
  • Tapping a chapter → /dashboard/syllabus/:subjectsForSchoolClassId/:chapterId (ChapterDetailPage) — chapter modules + chapter test card.
  • Tapping a module → /dashboard/syllabus/:subjectsForSchoolClassId/:chapterId/:moduleId (ModuleContentPage), or a video module → VideoPlayerPage.
  • Module completion bumps chapter progress, which bumps subject progress, which bumps overall syllabus progress.

6. Parent browses

  • App / route: Parent app → /syllabus (SyllabusContext + SubjectListPage) — picks the active linked student, then renders subjects + overall progress card (Total subjects · X/Y chapters).
  • Tapping a subject → /syllabus/:subjectId (SubjectDetailPage) — chapters with selected_chapters count and per-chapter circular progress.
  • Tapping a chapter → /syllabus/:subjectId/chapters/:chapterId (ChapterDetailPage) — modules with completion state, weekly plan, yearly plan summary.
  • Same data shape as the student app (SyllabusResponse), but driven by the parent's selected child.

7. Teacher browses

  • Teacher app surfaces the same subject hierarchy through the Home / Subjects entries. Teachers see syllabus to plan against (yearly / weekly) and to create assignments and tests aligned to chapters.

Edge cases & things to test

  • Class not yet mapped: the admin landing page hardcodes 12 classes per board, but classMapping only fills entries that exist in the DB. Tapping a class with no DB id should log an error and not navigate.
  • Roman-numeral class names: the page supports "Class VIII" → 8 mapping. Mix of "Class 8" and "Grade VIII" in the same board should both resolve.
  • Upload non-PDF: drawer accepts .pdf only; uploading .docx should be blocked client-side.
  • Upload during embedding of previous file: two consecutive uploads for the same subject — both should appear in the table with independent processingStatus rows.
  • Embedding failure: admin uploads a corrupt / scanned-image-only PDF — row status flips to failed; downloading the file should still work; AI Tutor should not surface that document's content.
  • Delete during processing: admin deletes a document that's still processing — should succeed; later embedding-progress events for that id should be ignored.
  • Student class change mid-year: student moves Class 7 → Class 8 — /dashboard/syllabus should immediately show the Class 8 subjects, not the cached Class 7 ones.
  • Subject with no chapters yet: subject card shows "0 chapters"; tapping should land on the subject detail with an empty state, not a crash.
  • Locked chapter: chapter rendered with isLocked = true — tapping should be a no-op or show a hint, not navigate.
  • Module progress rollback: a teacher resets a student's module — chapter and subject percentages should recalculate on next load.
  • Parent multi-child: switching active child must reload /syllabus against the new studentProfileId and not show stale subjects.
  • AI Tutor citing the document: ask the AI Tutor a question about a freshly uploaded PDF — citations should reference that document only after processingStatus = completed.
  • Vector Search Test consistency: a query in the admin sandbox and the same query through AI Tutor should return overlapping chunks (sanity check on the same index).
  • Academic year drift: upload right at the academic-year cutover (e.g. April) — getCurrentAcademicYear() should pick the new year and tag the document accordingly.