CH 11Basic

Learning Management System

The digital learning engine of NexusOne — course management, lesson delivery, assignments, quizzes, coding lab, progress tracking, and learning analytics.

LMS Architecture

CurriculumSubjectCourseModuleLessonActivityAssessment

Basic Tier Features

Basic

Course Management (§11.4–11.8)

Basic
  • Course model: title, subject, class, academic year, instructor, status, modules[]
  • Status lifecycle: draft → published → archived → retired
  • Ownership: school-owned, teacher-managed, student-accessible
  • Course hierarchy: Course → Module → Lesson → Resource
  • GET/POST/PATCH/DELETE /api/courses — full CRUD
  • Admin UI: /dashboard/admin/courses (create/edit/delete)
  • Teacher UI: /dashboard/teacher/courses (my courses)
  • Student UI: /dashboard/student/courses (enrolled courses)

Enrollment & Course Completion

Basic
  • Self-enrollment (allowSelfEnrollment) or admin-driven enrollment; optional requireApproval gate before status becomes active
  • Per-material progress tracking (timeSpent, completed) recalculates overallProgress on every update
  • Student requests completion once ready; completion mode can be automatic, teacher_controlled, or hybrid
  • Teacher approves (single or bulk) pending completions; approval can auto-issue a Certificate
  • GET/PATCH /api/enrollments, /api/course-completion/student/... and /api/course-completion/teacher/...
  • Teacher UI: /dashboard/teacher/course-completions — pending approval queue

Lesson Management (§11.9–11.10) — New

Basic
  • Lesson model: title, type, moduleTitle, moduleIndex, order, estimatedMinutes, status
  • Lesson types: introduction, concept, practice, assessment, summary, video, reading, activity
  • LessonProgress model: tracks per-student completion + time spent
  • POST/GET/PATCH/DELETE /api/courses/:courseId/lessons
  • GET /api/courses/:courseId/lessons/progress — per-student completion %
  • POST /api/courses/:courseId/lessons/:id/complete — mark done
  • Teacher UI: /dashboard/teacher/courses/[id]/lessons — full module/lesson CRUD
  • Student UI: /dashboard/student/course/[courseId]/lessons — progress + mark done

Content & Resource Library (§11.11–11.18) — New

Basic
  • Content types: PDF, Video, Audio, Presentation, Worksheet, Link, Document, Image
  • Course materials uploaded to Cloudinary via /api/courses/:courseId/materials
  • GET /api/lms/library — search all course materials by type, subject, class
  • Admin/Teacher UI: /dashboard/admin/resource-library — searchable material grid
  • Paginated results with type filter chips (pdf/video/audio/link/image/document)

Assignment Management (§11.19–11.23)

Basic
  • Assignment model: title, description, course, school, dueDate, maxMarks, rubric, attachments
  • Assignment types: essay, worksheet, project, research, presentation, coding
  • Status lifecycle: draft → published → closed
  • Submission workflow: student submits → teacher reviews → graded with feedback
  • GET/POST/PATCH/DELETE /api/assignments with role-based access
  • POST /api/assignments/:id/submit — student submission with file/text/link
  • PATCH /api/assignments/:id/submissions/:sid/grade — teacher grading
  • Teacher UI: /dashboard/teacher/assignments (create, grade submissions)
  • Student UI: /dashboard/student/assignments (view, submit)
  • Mobile teacher: (teacher)/assignments.tsx — grouped by status
  • Mobile student: (student)/assignments.tsx — inline text submission + due badge

Quiz Management (§11.24–11.29)

Basic
  • Quiz model with question bank integration
  • Question types: MCQ, True/False, Fill in the blank, Short answer, Essay, Coding
  • Quiz configuration: duration, attempts, passing marks, negative marking, randomization
  • Evaluation: automatic (MCQ), manual (essay), hybrid
  • GET/POST /api/quizzes — teacher creates, student takes
  • POST /api/quizzes/:quizId/attempt — start a timed quiz session
  • POST /api/quiz-attempts/:attemptId/submit — auto-score or queue for manual review
  • Question bank: /api/questions for reusable question repository
  • Teacher UI: /dashboard/teacher/quizzes (create/manage)
  • Student UI: /dashboard/student/quizzes (take quiz, view results)
  • Mobile teacher: (teacher)/quizzes.tsx
  • Mobile student: (student)/quizzes.tsx

Discussion Forums

Basic
  • Course-scoped discussion threads for students, teachers, and admins
  • Replies, upvoting, pin, lock, and mark-as-answer on a reply
  • GET/POST /api/courses/:courseId/discussions, /api/discussions/:id/reply
  • Teacher UI: /dashboard/teacher/courses/[id]/discussions
  • Student UI: /dashboard/student/courses/[id]/discussions

Learning Progress & Dashboards (§11.30–11.33) — New

Basic
  • GET /api/lms/dashboard — admin summary: courses, enrollments, completion rate, certificates
  • GET /api/lms/progress/me — student progress: lessons done, quiz scores, certificates
  • GET /api/lms/progress/:studentId — teacher/parent/admin view of a student's progress
  • GET /api/lms/analytics/course/:courseId — per-course: enrollment, lesson completions, quiz avg
  • Admin LMS Dashboard: /dashboard/admin/lms — 8-card summary + recent courses + quick links
  • Student Progress: /dashboard/student/progress — enrollment + lesson + assignment stats
  • Learning Analytics: /dashboard/admin/learning-analytics — course picker + drill-down
  • Mobile student: (student)/lms-progress.tsx — full progress summary
  • Mobile parent: (parent)/lms-progress.tsx — multi-child LMS progress view

LMS Calendar (§11.34) — New

Basic
  • GET /api/lms/calendar — unified event feed: assignments + quizzes with due dates
  • Filtered by role: students see enrolled course events, teachers see their courses only
  • Date range filtering: ?startDate=&endDate= parameters
  • Admin calendar: /dashboard/admin/lms/calendar
  • Teacher calendar: /dashboard/teacher/lms-calendar
  • Student calendar: /dashboard/student/lms-calendar
  • Interactive calendar grid: click day to see events; upcoming events sidebar
  • Color-coded: blue = assignment, purple = quiz

Coding Lab (§11.40–11.49)

Basic
  • Powered by Judge0 CE code execution engine
  • Phase 1: Python; Future: Java, JavaScript, C++, Go, Rust
  • Programming problem model: statement, input/output spec, constraints, examples, test cases
  • Public test cases (student sees), private test cases (hidden)
  • Code editor: write → run → save draft → submit
  • POST /api/programming-problems/:problemId/test — run code against a public example
  • POST /api/programming-problems/:problemId/submit — final submission, scored against all test cases
  • GET /api/code-submissions/:submissionId — polling endpoint for async Judge0 result
  • Teacher UI: /dashboard/teacher/programming (create problems, define test cases)
  • Student UI: /dashboard/student/programming (solve, run, submit)
  • Analytics: attempts, pass rate, completion rate, language usage

Certificates (§11.36)

Basic
  • Generated for: course completion, assessment completion, skill completion
  • Certificate model linked to student, course, school, and issuing date; auto-generated verificationCode
  • GET /api/certificates/my-certificates — student's own certificates
  • POST /api/certificates/teacher/generate — teacher/admin issues a certificate
  • GET /api/certificates/verify/:verificationCode — public verification, no auth required
  • Teacher UI: /dashboard/teacher/certificates (issue certificates)
  • Student UI: /dashboard/student/certificates (view & download)
  • Mobile student: (student)/certificates.tsx
  • Mobile parent: (parent)/certificates.tsx

Teachers of a Subject (Main Teacher & Co-Teachers) — New

Basic
  • A subject has one main teacher (Course.instructor) and up to 6 co-teachers (Course.assistantInstructors). Co-teachers have the same rights as the main teacher: class and students, attendance, marks, the shared grade card sheet, materials, quizzes, discussions and messages. The main teacher is the one shown on the timetable and in notifications
  • Only an admin can change them: PATCH /api/courses/:id with instructor and assistantInstructors (a JSON array of user ids). Every teacher must be an active teacher of the same school; the main teacher is never listed as a co-teacher
  • Class access (students, attendance, homework) follows the instructor live through getTeacherScope, so it moves at once. Timetable periods of the subject move to the new teacher and teacherName is refreshed
  • utils/subjectTeacherChange compares the old and new set of teachers: it keeps the main teacher out of assistantInstructors, hands createdBy to the admin if a removed teacher created the subject, and passes unfinished grade card sheets (draft, pending, rejected) whose last editor was removed to the main teacher. Approved marks stay as the record of who entered them
  • A removed teacher loses course attendance and exam marks access straight away (utils/courseAccess.teachesCourse and teacherIdsOf, Chapters 10 and 12)
  • Written to AuditLog as SUBJECT_TEACHER_CHANGED with the old and new main teacher and co-teachers. Each added teacher gets a subject_teacher_changed notification; a removed teacher is not sent one
  • The response carries teacherChange { from, to, added[], removed[], teachers[], gradeCardSheetsMoved }
  • Web: Admin → Subjects → Teachers (components/courses/ChangeTeacherModal) with a main-teacher select and co-teacher checkboxes. Mobile: (admin)/course-form.tsx has a Co-teachers picker when editing, and warns and asks for confirmation before saving. The subject list shows the main teacher plus a "+ N more" count

Elite Tier Features

Elite

Recommended Learning (§11.39) — Future

Elite
  • AI-powered course, lesson, and practice material suggestions
  • Personalized to each student's progress and weak areas
  • Requires active Elite subscription

AI Tutors & Adaptive Learning (§11.58) — Future

Elite
  • Student AI Tutor: answers academic questions via WhatsApp/app
  • Adaptive learning paths that adjust to student performance
  • Gamification: badges, leaderboards, achievements
  • Powered by Google Gemini — Elite tier only

API Reference — Chapter 11

Courses

GET/api/courses

List published courses (all roles)

POST/api/courses

Create course (teacher/admin)

PATCH/api/courses/:id

Update course

GET/api/courses/:id

Get single course

Lessons (New — Basic)

GET/api/courses/:courseId/lessons

List lessons for a course

POST/api/courses/:courseId/lessons

Create lesson (teacher/admin)

PATCH/api/courses/:courseId/lessons/:id

Update lesson

DELETE/api/courses/:courseId/lessons/:id

Delete lesson

GET/api/courses/:courseId/lessons/progress

Get student's lesson completion progress

POST/api/courses/:courseId/lessons/:id/complete

Mark lesson as complete (student)

LMS Analytics & Calendar (New — Basic)

GET/api/lms/dashboard

Admin LMS summary (courses, enrollments, completion rate)

GET/api/lms/calendar

Events calendar: assignments + quizzes with due dates

GET/api/lms/library

Resource library: search all course materials

GET/api/lms/analytics/course/:courseId

Per-course analytics (enrollment, lessons, quizzes)

GET/api/lms/progress/me

Current student's full LMS progress

GET/api/lms/progress/:studentId

Any student's LMS progress (teacher/parent/admin)

Enrollment & Completion (New — Basic)

POST/api/courses/:courseId/enroll

Enroll a student (self or admin-driven)

GET/api/enrollments

Current user's enrollments

PATCH/api/enrollments/:enrollmentId/progress

Update material progress

GET/api/course-completion/student/course/:courseId/progress

Student's completion progress + requirements

POST/api/course-completion/student/course/:courseId/request-completion

Student requests completion

GET/api/course-completion/teacher/course/:courseId/pending-approvals

Teacher's pending completion approvals

POST/api/course-completion/teacher/enrollment/:enrollmentId/approve

Approve a student's completion

Assignments

GET/api/assignments

List assignments

POST/api/assignments

Create assignment (teacher/admin)

POST/api/assignments/:id/submit

Student submits assignment

PATCH/api/assignments/:id/submissions/:sid/grade

Teacher grades submission

Quizzes & Questions

GET/api/quizzes

List quizzes

POST/api/quizzes

Create quiz (teacher/admin)

POST/api/quizzes/:quizId/attempt

Start timed quiz attempt (student)

POST/api/quiz-attempts/:attemptId/submit

Submit quiz answers

POST/api/questions/bulk

Bulk-create questions

POST/api/questions/import

Import questions from an uploaded Excel/CSV file

Discussion Forums (New — Basic)

GET/api/courses/:courseId/discussions

List discussions for a course

POST/api/courses/:courseId/discussions

Create a discussion post

POST/api/discussions/:id/reply

Reply to a discussion

PUT/api/discussions/:id/replies/:replyId/mark-answer

Mark a reply as the accepted answer

Coding Lab

GET/api/programming-problems

List coding problems

POST/api/programming-problems/:problemId/test

Run code against a public example

POST/api/programming-problems/:problemId/submit

Submit final coding solution — scored via Judge0

GET/api/code-submissions/:submissionId

Get submission result and test breakdown

Certificates

GET/api/certificates/my-certificates

Student's own certificates

POST/api/certificates/teacher/generate

Teacher/admin issues a certificate

GET/api/certificates/verify/:verificationCode

Public certificate verification

Frontend Pages

PathRoleDescriptionTier
/dashboard/admin/lmsAdminLMS Dashboard — 8-card summaryBasic
/dashboard/admin/lms/calendarAdminLMS Calendar (assignment + quiz events)Basic
/dashboard/admin/resource-libraryAdmin/TeacherResource Library — all course materialsBasic
/dashboard/admin/learning-analyticsAdminLearning Analytics — course drill-downBasic
/dashboard/admin/coursesAdminCourse management CRUDBasic
/dashboard/teacher/coursesTeacherTeacher's courses listBasic
/dashboard/teacher/courses/[id]/lessonsTeacherModule/Lesson CRUD within a courseBasic
/dashboard/teacher/lms-calendarTeacherLMS Calendar for teacher's coursesBasic
/dashboard/teacher/assignmentsTeacherCreate/grade assignmentsBasic
/dashboard/teacher/quizzesTeacherCreate/manage quizzesBasic
/dashboard/teacher/programmingTeacherCreate coding problemsBasic
/dashboard/teacher/course-completionsTeacherPending course-completion approval queueBasic
/dashboard/teacher/courses/[id]/discussionsTeacherCourse discussion forumBasic
/dashboard/student/coursesStudentEnrolled courses listBasic
/dashboard/student/courses/[id]/discussionsStudentCourse discussion forumBasic
/dashboard/student/course/[courseId]/lessonsStudentLesson progress view + mark doneBasic
/dashboard/student/lms-calendarStudentStudent LMS CalendarBasic
/dashboard/student/assignmentsStudentView and submit assignmentsBasic
/dashboard/student/quizzesStudentTake quizzes, view resultsBasic
/dashboard/student/progressStudentOverall learning progressBasic
/dashboard/student/programmingStudentCoding lab — solve problemsBasic
/dashboard/student/certificatesStudentEarned certificatesBasic

Mobile Screens

(student)/courses.tsx
Enrolled courses with progress %
Basic
(student)/assignments.tsx
Assignments list + inline text submission
Basic
(student)/lms-progress.tsx
Full LMS progress: courses, lessons, quizzes, certificates
Basic
(student)/quizzes.tsx
Available quizzes and results
Basic
(student)/certificates.tsx
Earned certificates
Basic
(teacher)/courses.tsx
Teacher's assigned courses
Basic
(teacher)/assignments.tsx
Assignments grouped by status
Basic
(teacher)/quizzes.tsx
Quizzes with attempt counts
Basic
(parent)/lms-progress.tsx
Child's LMS progress with multi-child selector
Basic