Skip to content

Conversation

@jeromehardaway
Copy link
Contributor

This pull request introduces significant improvements to the assignment submission workflow, including a full migration from mock data to database-driven assignment details, enhanced form validation and error handling, and a new API endpoint for fetching user submissions. The submission page now dynamically loads assignment data, enforces authentication and course enrollment, and provides a more informative and user-friendly interface for students.

Backend/API Enhancements:

  • Added a GET endpoint to /api/lms/submissions to allow authenticated users to fetch their submissions, with optional filtering by courseId or assignmentId. [1] [2]

Assignment Submission Page Improvements:

Navigation and Dashboard:

  • Added a "My Submissions" link to the user dashboard for easier access to submission history.

Assignment Submission Improvements:
- Connected submission form to /api/lms/submissions endpoint
- Added liveUrl field for deployed demo submissions
- Replaced mock data with real database queries (Prisma)
- Added server-side authentication and enrollment verification
- Display assignment details from database (instructions, due date, max points)
- Show required submission types (GitHub repo, live demo)
- Enhanced error handling and user feedback

Frontend Changes:
- Added error state and display for submission failures
- Updated form validation to support githubUrl, liveUrl, or file uploads
- Dynamic breadcrumbs using actual course data
- Improved UI to show assignment type and requirements
- Better formatting for instructions and assignment details

Backend Integration:
- Uses getServerSideProps for server-side rendering
- Verifies user authentication before page load
- Confirms user enrollment in course before allowing submission
- Fetches assignment with course relationship from database

Security:
- Server-side auth check prevents unauthorized access
- Enrollment verification ensures only enrolled students can submit
- Proper redirect to login with callback URL

Note: File upload to Cloudinary pending - currently stores file metadata only
Submission History Features:
- Created /submissions page to view all assignment submissions
- Added GET endpoint to /api/lms/submissions with filtering
- Filter submissions by status (all, pending, graded)
- Display submission details: GitHub URL, live demo, notes
- Show instructor feedback and grades when available
- Display submission timestamps and due dates
- Calculate and show percentage scores

API Enhancements:
- Extended /api/lms/submissions to handle GET requests
- Support filtering by courseId or assignmentId
- Include assignment and course details in response
- Order submissions by most recent first

UI Components:
- Status badges (SUBMITTED, GRADED, RETURNED)
- Clickable links to GitHub repos and live demos
- Instructor feedback display with timestamp
- Score display with percentage calculation
- Empty states for no submissions
- Filter buttons for quick navigation

Dashboard Integration:
- Added 'My Submissions' link to Quick Links sidebar
- Students can easily access submission history from dashboard

Student Benefits:
- Track all assignment submissions in one place
- View feedback and scores from instructors
- Access submitted GitHub repos and live demos
- See pending vs graded submissions at a glance
@jeromehardaway jeromehardaway requested a review from Copilot January 1, 2026 03:19
@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 3:25am

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 pull request migrates the assignment submission workflow from mock data to a database-driven implementation, adds a new submissions listing page, and introduces a GET endpoint for fetching user submissions. The changes ensure proper authentication, enrollment verification, and provide a comprehensive interface for students to submit and track their assignments.

Key Changes:

  • Added a GET endpoint to /api/lms/submissions for fetching user submissions with optional filtering by course or assignment
  • Replaced mock assignment data with real database queries in the submission page, including authentication and enrollment checks
  • Created a new submissions page (/submissions/index.tsx) for viewing submission history with filtering and detailed feedback display

Reviewed changes

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

File Description
src/pages/submissions/index.tsx New page for displaying user submissions with filtering options and detailed submission information
src/pages/dashboard.tsx Added navigation link to the new submissions page
src/pages/assignments/submit/[assignmentId].tsx Migrated from mock data to database queries with authentication/enrollment checks and enhanced form validation
src/pages/api/lms/submissions/index.ts Added GET endpoint for fetching submissions with filtering capabilities

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

{ path: "/", label: "home" },
{ path: "/courses", label: "courses" },
{ path: "/courses/web-development", label: "web development" },
{ path: `/courses/${assignment.course.id}`, label: assignment.course.title },
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 breadcrumb label uses the full course title directly, which may be too long for breadcrumb display. Consider truncating long course titles or using a shorter identifier for better UI presentation.

Suggested change
{ path: `/courses/${assignment.course.id}`, label: assignment.course.title },
{
path: `/courses/${assignment.course.id}`,
label:
assignment.course.title.length > 40
? `${assignment.course.title.slice(0, 39).trimEnd()}…`
: assignment.course.title,
},

Copilot uses AI. Check for mistakes.
<p className="tw-text-xs tw-text-gray-500">
{assignment.allowedFormats.join(", ")} up to{" "}
{assignment.maxFileSize}
Common formats: ZIP, PDF, images
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 file format guidance is vague. Consider specifying the actual allowed file extensions (e.g., .zip, .pdf, .png, .jpg) and maximum file size to provide clearer guidance to users.

Suggested change
Common formats: ZIP, PDF, images
Allowed formats: .zip, .pdf, .png, .jpg (max 25 MB per file)

Copilot uses AI. Check for mistakes.
try {
const { courseId, assignmentId } = req.query;

const where: any = { userId };
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.

Using 'any' type defeats TypeScript's type safety. Define a proper type for the where clause (e.g., Prisma.SubmissionWhereInput) to maintain type safety.

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.

TypeScript error fix - session variable was declared but never used
@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 bd22d37 into master Jan 1, 2026
5 checks passed
@jeromehardaway jeromehardaway deleted the feat/phase-2-core-features branch January 1, 2026 03:27
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