-
-
Notifications
You must be signed in to change notification settings - Fork 68
Feat/phase 2 core features #848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this 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/submissionsfor 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 }, |
Copilot
AI
Jan 1, 2026
There was a problem hiding this comment.
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.
| { 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, | |
| }, |
| <p className="tw-text-xs tw-text-gray-500"> | ||
| {assignment.allowedFormats.join(", ")} up to{" "} | ||
| {assignment.maxFileSize} | ||
| Common formats: ZIP, PDF, images |
Copilot
AI
Jan 1, 2026
There was a problem hiding this comment.
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.
| Common formats: ZIP, PDF, images | |
| Allowed formats: .zip, .pdf, .png, .jpg (max 25 MB per file) |
| try { | ||
| const { courseId, assignmentId } = req.query; | ||
|
|
||
| const where: any = { userId }; |
Copilot
AI
Jan 1, 2026
There was a problem hiding this comment.
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.
|
🔍 Code Quality Score Breakdown:
💡 Recommendations:
|
TypeScript error fix - session variable was declared but never used
|
🔍 Code Quality Score Breakdown:
💡 Recommendations:
|
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:
GETendpoint to/api/lms/submissionsto allow authenticated users to fetch their submissions, with optional filtering bycourseIdorassignmentId. [1] [2]Assignment Submission Page Improvements:
getServerSideProps, including authentication and course enrollment checks. This ensures only enrolled users can access the submission page for a given assignment. (src/pages/assignments/submit/[assignmentId].tsxR5-R26, src/pages/assignments/submit/[assignmentId].tsxL366-R498)Navigation and Dashboard: