Modules
Students
Students with derived status, progress per enrolment, streaks, weekly study time and a timeline.
A student stores enrollments (courseId, enrolledAt, completedLessons) and an activity log (enrolled, lesson, quiz with score, certificate, each with minutes and a local YYYY-MM-DDTHH:mm date). The mock builds that log from each course’s real curriculum. Status (active, atRisk, completed), progress, certificates, quiz average, streak, weekly minutes and spend are derived.
Files
File | Role |
|---|---|
pages/learning/students/index.vue | The list. |
pages/learning/students/[id].vue | The profile. |
composables/useLearning.ts | findStudent, studentSummary, enroll, saveStudent, removeStudents. |
composables/useStudentForm.ts | The student and enrol forms. |
composables/useStudentTimeline.ts | The timeline items of the profile. |
components/pages/learning/ | LearningStudentQuickView, LearningStudentCourses, LearningStudentStatusChip, LearningEnrollmentCard, LearningStudentFormPanel. |
Configuration
STUDENT_VIEWS
The views of the list.
const STUDENT_VIEWS: StudentView[]
STUDENT_AT_RISK_DAYS
Days without activity before a student is at risk.
const STUDENT_AT_RISK_DAYS: 14
STUDENT_STATUS_TONES
The tone of each status.
const STUDENT_STATUS_TONES: Record<StudentStatus, StatusTone>
STUDENT_ACTIVITY_STYLES
The icon of each activity type.
const STUDENT_ACTIVITY_STYLES: Record<StudentActivityType, { icon: string; color: string; }>Rules
Pure functions in utils/, unit tested in tests/unit/. Statuses and segments are derived from the stored data, never stored themselves.
studentStatus()
The derived status.
studentStatus(student: Pick<Student, 'enrollments' | 'activity' | 'joinedAt'>, courses: CourseLookup, now: Date): StudentStatus
studentProgress()
Overall progress.
studentProgress(student: Pick<Student, 'enrollments'>, courses: CourseLookup): { done: number; total: number; percent: number; }donetotalpercentstudentStreak()
Study streak.
studentStreak(student: Pick<Student, 'activity'>, now: Date): number
studentWeeklyMinutes()
Minutes per week.
studentWeeklyMinutes(student: Pick<Student, 'activity'>, now: Date, weeks: number): number[]
enrollmentNextLesson()
The next lesson.
enrollmentNextLesson(enrollment: Enrollment, course: CourseOutline): { lesson: CourseLesson; module: CourseModule; moduleIndex: number; } | undefinedHow it works
- The list has no KPI cards: a warning
BaseAlertfor students at risk (show and send reminder), views asBaseToggleGroup compact fitand a row click that opensLearningStudentQuickView. - The profile shows five stats,
LearningEnrollmentCards (aBaseStepProgressper module and the next lesson), weekly study time asBaseSparkline type="column", aBaseTimelineand the profile facts. - Last activity and other date-only labels use
useDayLabel().