A comprehensive web-based platform for secure homework distribution and collection with advanced copy protection and academic integrity features.
The Homework Assignment System enables teachers to create, distribute, and collect homework assignments while maintaining academic integrity through robust copy-protection mechanisms. Students can access assignments using simple codes, save their work as drafts, and submit final answers - all without requiring individual accounts.
- Advanced Copy Protection: Prevents copying, pasting, and text selection on assignment content
- Keyboard Shortcut Blocking: Disables Ctrl+C, Ctrl+V, Ctrl+A, and developer tools access
- Secure Content Delivery: Protected question display with selection prevention
- Simple Authentication: Username/password login with account lockout protection
- Rich Text Assignment Creation: Advanced text editor with markdown formatting support
- Live Preview: Real-time preview of formatted assignments as students will see them
- Capacity Management: Maximum 3 active assignments per teacher, 30 students per assignment
- Real-time Monitoring: Track student progress, draft vs. final submissions
- Enhanced Bulk Downloads: Robust ZIP downloads with error handling and compression
- Code-based Access: No individual accounts required - access via assignment codes
- Save & Continue: Work on assignments across multiple sessions
- Auto-save: Automatic draft saving every 30 seconds
- Word Count Tracking: Real-time word counting and progress indicators
- Final Submission: Secure one-time submission with confirmation
- Node.js 18+
- PostgreSQL database
- Yarn package manager
-
Clone and Setup
cd homework_assignment_system/app yarn install -
Configure Environment
cp .env.example .env # Update DATABASE_URL and SESSION_SECRET in .env -
Database Setup
npx prisma db push npx prisma db seed
-
Start Development Server
yarn dev
-
Access Application
- Main site:
http://localhost:3000 - Teacher login:
http://localhost:3000/teacher/login - Student access:
http://localhost:3000/student
- Main site:
Teacher Account:
- Username:
demo_teacher - Password:
demo_password
Sample Assignment:
- Code:
DEMO01 - Title: "Sample Essay Assignment"
-
Create Account
- Visit
/teacher/register - Choose username (3+ characters) and password (8+ characters)
- Account created instantly
- Visit
-
Create Assignment
- Login and access dashboard
- Click "Create Assignment" (if under 3 active assignments)
- Enter title, content (paste text or upload file), and optional instructions
- Assignment receives unique 6-character code
- Share code with students
-
Monitor Progress
- Dashboard shows all assignments with real-time student counts
- Track draft vs. submitted status for each student
- Download individual or bulk submissions
- Close/reopen assignments as needed
-
Access Assignment
- Visit
/student - Enter your full name and assignment code from teacher
- Access granted if assignment active and under capacity
- Visit
-
Complete Work
- Read copy-protected assignment content
- Write answer in provided text area
- Work automatically saved every 30 seconds
- Save drafts manually anytime
-
Submit Final Answer
- Review your work before submission
- Click "Submit Final Answer" when ready
- Confirm submission (cannot be undone)
- Receive confirmation of successful submission
DATABASE_URL="postgresql://user:password@host:port/database"
SESSION_SECRET="your-secure-session-secret-key"- Teacher Sessions: 3 active assignments maximum
- Assignment Capacity: 30 students per assignment
- Session Duration: Teacher sessions expire after 2 hours
app/
βββ prisma/
β βββ schema.prisma # Database schema
βββ app/
β βββ api/ # API routes
β β βββ auth/ # Authentication endpoints
β β βββ assignments/ # Assignment management
β β βββ student/ # Student operations
β βββ teacher/ # Teacher interface pages
β βββ student/ # Student interface pages
β βββ globals.css # Styles with copy protection
βββ lib/
β βββ auth.ts # Authentication logic
β βββ session.ts # Session management
βββ scripts/
βββ seed.ts # Database seeding
- Password Security: bcrypt hashing with 12 salt rounds
- Session Management: JWT tokens with HTTP-only cookies
- Failed Login Protection: 5 attempts maximum, 15-minute lockout
- Input Validation: Server-side validation on all endpoints
- Copy Protection: Multi-layered content protection system
POST /api/auth/register- Create teacher accountPOST /api/auth/login- Teacher loginPOST /api/auth/logout- Logout
GET /api/assignments- List teacher assignmentsPOST /api/assignments- Create new assignmentPATCH /api/assignments/[id]- Update assignment statusDELETE /api/assignments/[id]- Delete assignmentGET /api/assignments/[id]/download- Download submissions
POST /api/student/access- Access assignmentPOST /api/student/save- Save draftPOST /api/student/submit- Submit final answer
Database Connection Errors
- Verify DATABASE_URL is correct
- Ensure PostgreSQL is running
- Check database permissions
Assignment Code Not Found
- Verify code is exactly 6 characters
- Ensure assignment is in 'active' status
- Check for typos (codes are case-insensitive)
Copy Protection Not Working
- Ensure JavaScript is enabled
- Check browser compatibility
- Clear browser cache
- Supported: Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
- Mobile: Tablet support (768px+ width)
- Requirements: JavaScript enabled for copy protection
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For technical support or questions:
- Check troubleshooting section above
- Review API documentation in
TECH_SPEC.md - Consult architecture overview in
ARCHITECTURE.md
Built with β€οΈ for academic integrity and educational excellence.