Learning Management System
The digital learning engine of NexusOne — course management, lesson delivery, assignments, quizzes, coding lab, progress tracking, and learning analytics.
LMS Architecture
Basic Tier Features
BasicCourse Management (§11.4–11.8)
- 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
- 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
- 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
- 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)
- 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)
- 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
- 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
- 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
- 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)
- 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)
- 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
- 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
EliteRecommended Learning (§11.39) — Future
- 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
- 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
/api/coursesList published courses (all roles)
/api/coursesCreate course (teacher/admin)
/api/courses/:idUpdate course
/api/courses/:idGet single course
Lessons (New — Basic)
/api/courses/:courseId/lessonsList lessons for a course
/api/courses/:courseId/lessonsCreate lesson (teacher/admin)
/api/courses/:courseId/lessons/:idUpdate lesson
/api/courses/:courseId/lessons/:idDelete lesson
/api/courses/:courseId/lessons/progressGet student's lesson completion progress
/api/courses/:courseId/lessons/:id/completeMark lesson as complete (student)
LMS Analytics & Calendar (New — Basic)
/api/lms/dashboardAdmin LMS summary (courses, enrollments, completion rate)
/api/lms/calendarEvents calendar: assignments + quizzes with due dates
/api/lms/libraryResource library: search all course materials
/api/lms/analytics/course/:courseIdPer-course analytics (enrollment, lessons, quizzes)
/api/lms/progress/meCurrent student's full LMS progress
/api/lms/progress/:studentIdAny student's LMS progress (teacher/parent/admin)
Enrollment & Completion (New — Basic)
/api/courses/:courseId/enrollEnroll a student (self or admin-driven)
/api/enrollmentsCurrent user's enrollments
/api/enrollments/:enrollmentId/progressUpdate material progress
/api/course-completion/student/course/:courseId/progressStudent's completion progress + requirements
/api/course-completion/student/course/:courseId/request-completionStudent requests completion
/api/course-completion/teacher/course/:courseId/pending-approvalsTeacher's pending completion approvals
/api/course-completion/teacher/enrollment/:enrollmentId/approveApprove a student's completion
Assignments
/api/assignmentsList assignments
/api/assignmentsCreate assignment (teacher/admin)
/api/assignments/:id/submitStudent submits assignment
/api/assignments/:id/submissions/:sid/gradeTeacher grades submission
Quizzes & Questions
/api/quizzesList quizzes
/api/quizzesCreate quiz (teacher/admin)
/api/quizzes/:quizId/attemptStart timed quiz attempt (student)
/api/quiz-attempts/:attemptId/submitSubmit quiz answers
/api/questions/bulkBulk-create questions
/api/questions/importImport questions from an uploaded Excel/CSV file
Discussion Forums (New — Basic)
/api/courses/:courseId/discussionsList discussions for a course
/api/courses/:courseId/discussionsCreate a discussion post
/api/discussions/:id/replyReply to a discussion
/api/discussions/:id/replies/:replyId/mark-answerMark a reply as the accepted answer
Coding Lab
/api/programming-problemsList coding problems
/api/programming-problems/:problemId/testRun code against a public example
/api/programming-problems/:problemId/submitSubmit final coding solution — scored via Judge0
/api/code-submissions/:submissionIdGet submission result and test breakdown
Certificates
/api/certificates/my-certificatesStudent's own certificates
/api/certificates/teacher/generateTeacher/admin issues a certificate
/api/certificates/verify/:verificationCodePublic certificate verification
Frontend Pages
| Path | Role | Description | Tier |
|---|---|---|---|
| /dashboard/admin/lms | Admin | LMS Dashboard — 8-card summary | Basic |
| /dashboard/admin/lms/calendar | Admin | LMS Calendar (assignment + quiz events) | Basic |
| /dashboard/admin/resource-library | Admin/Teacher | Resource Library — all course materials | Basic |
| /dashboard/admin/learning-analytics | Admin | Learning Analytics — course drill-down | Basic |
| /dashboard/admin/courses | Admin | Course management CRUD | Basic |
| /dashboard/teacher/courses | Teacher | Teacher's courses list | Basic |
| /dashboard/teacher/courses/[id]/lessons | Teacher | Module/Lesson CRUD within a course | Basic |
| /dashboard/teacher/lms-calendar | Teacher | LMS Calendar for teacher's courses | Basic |
| /dashboard/teacher/assignments | Teacher | Create/grade assignments | Basic |
| /dashboard/teacher/quizzes | Teacher | Create/manage quizzes | Basic |
| /dashboard/teacher/programming | Teacher | Create coding problems | Basic |
| /dashboard/teacher/course-completions | Teacher | Pending course-completion approval queue | Basic |
| /dashboard/teacher/courses/[id]/discussions | Teacher | Course discussion forum | Basic |
| /dashboard/student/courses | Student | Enrolled courses list | Basic |
| /dashboard/student/courses/[id]/discussions | Student | Course discussion forum | Basic |
| /dashboard/student/course/[courseId]/lessons | Student | Lesson progress view + mark done | Basic |
| /dashboard/student/lms-calendar | Student | Student LMS Calendar | Basic |
| /dashboard/student/assignments | Student | View and submit assignments | Basic |
| /dashboard/student/quizzes | Student | Take quizzes, view results | Basic |
| /dashboard/student/progress | Student | Overall learning progress | Basic |
| /dashboard/student/programming | Student | Coding lab — solve problems | Basic |
| /dashboard/student/certificates | Student | Earned certificates | Basic |
Mobile Screens
(student)/courses.tsx(student)/assignments.tsx(student)/lms-progress.tsx(student)/quizzes.tsx(student)/certificates.tsx(teacher)/courses.tsx(teacher)/assignments.tsx(teacher)/quizzes.tsx(parent)/lms-progress.tsx