Skip to content

Conversation

@jeromehardaway
Copy link
Contributor

…ntegration

Progress API Auto-Completion:

  • Extended /api/lms/progress to automatically calculate course completion
  • Count total lessons and completed lessons per course
  • Calculate progress percentage on each lesson completion
  • Auto-update enrollment progress field (0-100%)
  • Automatically mark enrollment as COMPLETED when progress reaches 100%
  • Set completedAt timestamp when course is finished
  • Return course progress data in API response

Dashboard Real-Time Stats:

  • Fetch actual enrollment data on page load
  • Calculate real stats: enrolled courses, completed courses, total hours
  • Compute average progress across all enrollments
  • Replace hardcoded stats with dynamic calculations

Dashboard Course Display:

  • Show all enrolled courses with real progress data
  • Dynamic progress bars reflecting actual completion percentages
  • Completion badges (Active vs Completed) based on enrollment status
  • Display completion date for finished courses
  • Conditional CTAs: "Continue Learning" for active, "View Course" for completed
  • Empty state when no enrollments exist
  • Enroll in More Courses CTA

Student Benefits:

  • Automatic course completion without manual intervention
  • Real-time progress updates as lessons are completed
  • Accurate dashboard stats reflecting actual progress
  • Clear visual indicators of completion status
  • Foundation for certificates and achievements
  • Course completion history with dates

…ntegration

Progress API Auto-Completion:
- Extended /api/lms/progress to automatically calculate course completion
- Count total lessons and completed lessons per course
- Calculate progress percentage on each lesson completion
- Auto-update enrollment progress field (0-100%)
- Automatically mark enrollment as COMPLETED when progress reaches 100%
- Set completedAt timestamp when course is finished
- Return course progress data in API response

Dashboard Real-Time Stats:
- Fetch actual enrollment data on page load
- Calculate real stats: enrolled courses, completed courses, total hours
- Compute average progress across all enrollments
- Replace hardcoded stats with dynamic calculations

Dashboard Course Display:
- Show all enrolled courses with real progress data
- Dynamic progress bars reflecting actual completion percentages
- Completion badges (Active vs Completed) based on enrollment status
- Display completion date for finished courses
- Conditional CTAs: "Continue Learning" for active, "View Course" for completed
- Empty state when no enrollments exist
- Enroll in More Courses CTA

Student Benefits:
- Automatic course completion without manual intervention
- Real-time progress updates as lessons are completed
- Accurate dashboard stats reflecting actual progress
- Clear visual indicators of completion status
- Foundation for certificates and achievements
- Course completion history with dates
@jeromehardaway jeromehardaway requested a review from Copilot January 1, 2026 04:07
@jeromehardaway jeromehardaway self-assigned this Jan 1, 2026
@vercel
Copy link
Contributor

vercel bot commented Jan 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
vets-who-code-app Ready Ready Preview, Comment Jan 1, 2026 4:09am

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements automatic course completion tracking with dashboard integration, enabling real-time progress monitoring without manual intervention. The system automatically calculates course completion percentages based on lesson progress and updates enrollment status accordingly.

Key Changes:

  • Progress API now auto-calculates course completion by counting completed lessons versus total lessons, automatically updating enrollment status to COMPLETED at 100% and setting completion timestamps
  • Dashboard displays dynamic statistics (enrolled courses, completed courses, total hours, average progress) calculated from actual enrollment data
  • Course cards show real-time progress bars, completion badges, and conditional CTAs based on enrollment status

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/pages/dashboard.tsx Fetches and displays real enrollment data with dynamic stats, progress bars, completion badges, and conditional CTAs
src/pages/api/lms/progress/index.ts Auto-calculates course progress on lesson completion and updates enrollment status/timestamp when reaching 100%

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

progress: progressPercentage,
lastActivity: new Date(),
status: isComplete ? 'COMPLETED' : 'ACTIVE',
completedAt: isComplete ? new Date() : null,
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting completedAt to null when a course is not complete will overwrite any existing completion date if a user uncompletes a lesson after finishing a course. Consider only setting completedAt when isComplete is true, without explicitly setting it to null.

Suggested change
completedAt: isComplete ? new Date() : null,
...(isComplete && { completedAt: new Date() }),

Copilot uses AI. Check for mistakes.
Comment on lines +60 to +62
// Calculate stats from enrollments
const stats = {
enrolled: enrollments.filter((e) => e.status === "ACTIVE" || e.status === "COMPLETED").length,
Copy link

Copilot AI Jan 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filter condition e.status === \"ACTIVE\" || e.status === \"COMPLETED\" is duplicated multiple times (lines 62, 158, 161, 262). Consider extracting this into a helper function or constant to reduce duplication and improve maintainability.

Suggested change
// Calculate stats from enrollments
const stats = {
enrolled: enrollments.filter((e) => e.status === "ACTIVE" || e.status === "COMPLETED").length,
const isActiveOrCompleted = (e: Enrollment) =>
e.status === "ACTIVE" || e.status === "COMPLETED";
// Calculate stats from enrollments
const stats = {
enrolled: enrollments.filter(isActiveOrCompleted).length,

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented Jan 1, 2026

🔍 Code Quality Score Breakdown:

  • 📖 Readability: 2/10
  • 📈 Scalability: 5/10
  • 🚀 Performance: 5/10
  • 🛠️ Maintainability: 8/10
  • ✅ Overall Score: 5.0/10

💡 Recommendations:

  • 🧹 Reduce ESLint warnings to improve readability.
  • 📦 Break up complex functions or components.
  • ⚙️ Consider splitting large files or lazy-loading.
  • 🔁 Refactor to increase your overall score next cycle.

@jeromehardaway jeromehardaway merged commit 7706120 into master Jan 1, 2026
5 checks passed
@jeromehardaway jeromehardaway deleted the feat/phase-2-course-completion branch January 1, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants