Commit bd22d37
authored
Feat/phase 2 core features (#848)
* feat: complete assignment submission system with database integration
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
* feat: add submission history view for students
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
* fix: remove unused session variable from submissions page
TypeScript error fix - session variable was declared but never used1 parent 399ce0f commit bd22d37
File tree
4 files changed
+558
-95
lines changed- src/pages
- api/lms/submissions
- assignments/submit
- submissions
4 files changed
+558
-95
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
7 | 12 | | |
| 13 | + | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
| |||
16 | 22 | | |
17 | 23 | | |
18 | 24 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
27 | 76 | | |
28 | 77 | | |
29 | 78 | | |
30 | 79 | | |
31 | 80 | | |
32 | 81 | | |
33 | | - | |
34 | 82 | | |
35 | 83 | | |
36 | 84 | | |
| |||
0 commit comments