- Klassenlehrer management: Assign/change responsible teacher, privilege badges - Vice principal management: Assign/remove VP role, admins list - Calendar exam integration: Exam countdown, print calendar, exam filter - Student portal: Exams tab with countdown, AI study tips, virtual character - Dashboard: Klassenlehrer section with pending illness/communications - API: PUT /api/users/role for role management - API: Enhanced classes GET to include responsibleTeacher - 90+ new i18n keys
990 lines
54 KiB
Markdown
990 lines
54 KiB
Markdown
# Worklog
|
|
|
|
## Task ID: 5 - Subject Content Builder
|
|
|
|
**Date:** 2025-01-21
|
|
**Agent:** Subject Content Builder
|
|
**Status:** Completed
|
|
|
|
### Summary
|
|
|
|
Built the Subject Content Management System for CompetenceTrack - a "Schlaukopf clone" educational content platform. Includes full CRUD API routes, comprehensive frontend component with role-based views, i18n support (90+ keys in DE+EN), and schlaukopf.de-style seed data.
|
|
|
|
### Files Created
|
|
|
|
1. `src/app/api/subject-categories/route.ts` - GET/POST for categories
|
|
2. `src/app/api/subject-categories/[id]/route.ts` - GET/PUT/DELETE for single category
|
|
3. `src/app/api/subject-contents/route.ts` - GET/POST for contents
|
|
4. `src/app/api/subject-contents/[id]/route.ts` - GET/PUT/DELETE for single content
|
|
5. `src/app/api/content-change-requests/route.ts` - GET/POST for change requests
|
|
6. `src/app/api/content-change-requests/[id]/route.ts` - PUT for approve/reject
|
|
7. `src/app/api/ai-settings/route.ts` - GET/PUT for AI settings
|
|
8. `src/app/api/ai-settings/[id]/route.ts` - GET/PUT/DELETE for single AI settings
|
|
9. `src/app/api/subject-seed/route.ts` - POST to seed schlaukopf-style data
|
|
10. `src/components/subjects-view.tsx` - Comprehensive frontend component (~1000 lines)
|
|
|
|
### Files Modified
|
|
|
|
1. `src/lib/i18n.ts` - Added 90+ i18n keys for subjects feature (DE + EN)
|
|
2. `src/lib/store.ts` - Added 'subjects' to ViewName union type
|
|
3. `src/components/app-layout.tsx` - Added SubjectsView import, navigation entry, and view rendering
|
|
|
|
### Key Features
|
|
|
|
- **Student**: Browse by grade level (Klasse 5-10, Oberstufe), practice exercises, track progress, search
|
|
- **Teacher**: Same browsing + request content changes, view own change requests
|
|
- **Admin**: Full CRUD, activate/deactivate, review change requests, manage AI settings, seed data
|
|
- **Seed data**: 7 categories, 11-13 subjects per class, 4-6 topics per subject (mirrors schlaukopf.de)
|
|
- **API**: Role-based access control, soft delete, nested content hierarchy, auto-apply approved changes
|
|
|
|
---
|
|
|
|
## Task ID: 9-b — Enhance dashboard styling
|
|
|
|
**Date:** 2025-01-21
|
|
**Agent:** styling-dashboard
|
|
**Status:** Completed
|
|
|
|
### Summary
|
|
|
|
Enhanced the main teacher dashboard view with more detailed styling, visual polish, and interactive elements. The dashboard is the primary view users see after logging in, so these improvements make it more professional and data-rich.
|
|
|
|
### Files Modified
|
|
|
|
1. **`src/components/dashboard-view.tsx`** — Main dashboard component
|
|
2. **`src/lib/i18n.ts`** — Added new i18n keys for German and English
|
|
|
|
### Changes Made
|
|
|
|
#### 1. Time-Based Greeting (`getTimeGreeting()`)
|
|
- Added a `getTimeGreeting()` helper function that returns a contextual greeting based on the hour of the day:
|
|
- Morning (before 12): "Guten Morgen" / "Good morning"
|
|
- Afternoon (12-18): "Guten Tag" / "Good afternoon"
|
|
- Evening (after 18): "Guten Abend" / "Good evening"
|
|
- Replaced the static "Willkommen" / "Welcome" greeting with the dynamic greeting
|
|
- Added spring animation to the welcome header icon
|
|
|
|
#### 2. Enhanced Stat Cards
|
|
- Added gradient top border (`h-1 bg-gradient-to-r`) to each stat card, replacing the previous `border-l-3` left border
|
|
- Added hover ring effect (`hover:ring-2 hover:ring-emerald-200/60`) for better interactivity
|
|
- Added `motion.div` with `whileHover` rotation on the icon container
|
|
- Added spring animation to the trend badge (scale + opacity)
|
|
- Used i18n key `dashboard.updated_at` for the "Updated" footer text instead of hardcoded locale string
|
|
|
|
#### 3. Animated Progress Bars for Competency Tracking
|
|
- Added animated progress bars below the radar chart showing competency progress per subject
|
|
- Each bar uses `motion.div` with `initial={{ width: 0 }}` to `animate={{ width: pct }}` for smooth entrance animation
|
|
- Color-coded gradient bars matching each subject's theme
|
|
|
|
#### 4. Recharts Animation Props
|
|
- Added `isAnimationActive`, `animationDuration`, and `animationEasing="ease-out"` to all chart components:
|
|
- Radar chart (current + target layers)
|
|
- Bar charts (enrollment trend, student grades)
|
|
- Pie chart (grade distribution)
|
|
|
|
#### 5. Class Overview Mini Card Grid
|
|
- Added a new "Class Overview Grid" section with mini cards for each class
|
|
- Each card features:
|
|
- Gradient top strip matching the class color
|
|
- Avatar initials with gradient background
|
|
- Animated fill progress bar showing student count relative to the largest class
|
|
- Hover scale/tap scale animations via framer-motion
|
|
- Click handler to navigate to the class
|
|
|
|
#### 6. Enhanced Recent Activity Timeline
|
|
- Added a vertical timeline connector line (gradient from teal to emerald)
|
|
- Added timeline dots (colored circles) at each entry's position
|
|
- Added staggered entrance animation (`initial={{ opacity: 0, x: -10 }}` with `delay: idx * 0.05`)
|
|
- Added descriptive subtitle for the section
|
|
|
|
#### 7. Paper Saved Counter with CountUp Animation
|
|
- Replaced the static `animate-count-up` class with the `CountUp` component for smooth number animation
|
|
- Added gradient top border to the card
|
|
- Calculated dynamic values for trees saved and CO2 reduced
|
|
- Added staggered entrance animations for the eco badges
|
|
- Used i18n keys for all text instead of hardcoded locale strings
|
|
|
|
#### 8. School Branding Section
|
|
- Added a new "School Profile" section at the bottom of the dashboard
|
|
- Features:
|
|
- Gradient top border (emerald → teal → violet)
|
|
- School icon with spring entrance animation
|
|
- School color palette display (5 colored dots)
|
|
- School stats summary (students + classes)
|
|
- Badge showing school name
|
|
|
|
#### 9. Enhanced Tip of the Day
|
|
- Added a subtle gradient glow behind the tip card
|
|
- Added a gentle wiggle animation on the tip icon (`rotate: [0, 10, -10, 0]` with repeat)
|
|
- Used i18n key `dashboard.daily_tip` instead of hardcoded locale string
|
|
|
|
#### 10. GradientBorderCard Component
|
|
- Added a reusable `GradientBorderCard` wrapper component that creates a gradient border effect using a 1.5px padding technique
|
|
|
|
### New i18n Keys Added
|
|
|
|
| Key | German | English |
|
|
|-----|--------|---------|
|
|
| `dashboard.greeting_morning` | Guten Morgen | Good morning |
|
|
| `dashboard.greeting_afternoon` | Guten Tag | Good afternoon |
|
|
| `dashboard.greeting_evening` | Guten Abend | Good evening |
|
|
| `dashboard.school_branding` | Schulprofil | School Profile |
|
|
| `dashboard.school_branding_desc` | Ihre Schule im Überblick | Your school at a glance |
|
|
| `dashboard.competency_progress` | Kompetenzfortschritt | Competency Progress |
|
|
| `dashboard.competency_progress_desc` | Aktuelle Entwicklung der Kompetenzniveaus | Current development of competency levels |
|
|
| `dashboard.paper_saved_pages` | Seiten | pages |
|
|
| `dashboard.paper_saved_trees` | Baeume gerettet | trees saved |
|
|
| `dashboard.paper_saved_co2` | kg CO2 eingespart | kg CO2 saved |
|
|
| `dashboard.daily_tip` | Tipp des Tages | Tip of the day |
|
|
| `dashboard.class_overview_grid` | Klassenuebersicht | Class Overview |
|
|
| `dashboard.class_overview_grid_desc` | Schnellzugriff auf alle Klassen | Quick access to all classes |
|
|
| `dashboard.activity_timeline` | Aktivitaetenverlauf | Activity Timeline |
|
|
| `dashboard.activity_timeline_desc` | Neueste Eintraege im Zeitverlauf | Latest entries over time |
|
|
| `dashboard.updated_at` | Aktualisiert | Updated |
|
|
|
|
### Lint Results
|
|
- ESLint: Passed (no errors in modified files)
|
|
- TypeScript: Pre-existing recharts type errors only (not introduced by these changes)
|
|
|
|
### Design Decisions
|
|
- Used Lucide icons exclusively (no emojis) — all new icons are from the existing import set
|
|
- Used framer-motion for all animations (spring, stagger, entrance)
|
|
- Used existing shadcn/ui components (Card, Badge, Button, Progress)
|
|
- All new text uses the i18n system via `t()` function
|
|
- Maintained responsive design patterns (grid breakpoints, flex-wrap)
|
|
- Kept existing functionality intact
|
|
|
|
---
|
|
Task ID: Round-20
|
|
Agent: main
|
|
Task: Round 20 — Database Fix, New Features, Styling Enhancements, Bug Fixes
|
|
|
|
Work Log:
|
|
- Verified database is working correctly at /home/z/my-project/db/custom.db (1.2MB)
|
|
- Confirmed DATABASE_URL=file:./db/custom.db resolves correctly
|
|
- QA tested with agent-browser: auth page, dashboard, student portal, district management
|
|
- Fixed i18n breadcrumb key: added `nav.student-portal` to both DE and EN sections
|
|
- Added userId field to Student model (Prisma schema migration with db:push)
|
|
- Added `userId String? @unique` with `@index([userId])` on Student model
|
|
- Added `student Student?` reverse relation on User model
|
|
- Fixed student-goals API 403 error for STUDENT role
|
|
- Root cause: Student records have null userId (legacy data), so userId check failed
|
|
- Added name-matching fallback: checks userId OR (firstName + lastName + schoolId) match
|
|
- Fixed in both route.ts and [id]/route.ts
|
|
- Added userId filter to students API (/api/students?userId=...)
|
|
- Supports OR condition for STUDENT role (userId OR name+school fallback)
|
|
- Handles conflict with existing search filter using AND/OR nesting
|
|
- Created Student Portal View (src/components/student-portal-view.tsx)
|
|
- 6 tabs: My Competencies, My Goals, My Achievements, My Schedule, My Homework, My Feedback
|
|
- Animated progress circles, streak counter, level-up progress bar
|
|
- Celebration particles on goal completion
|
|
- Time-based greeting, motivational messages
|
|
- Added to student navigation in app-layout.tsx
|
|
- Created StudentGoal model (Prisma schema) + full CRUD API
|
|
- /api/student-goals (GET, POST) and /api/student-goals/[id] (GET, PUT, DELETE)
|
|
- Role-based access control with name-matching fallback
|
|
- Created District Management View (src/components/district-management-view.tsx)
|
|
- District overview with stat cards, school grid, search
|
|
- District detail with tabs: Schools, Analytics, Activity
|
|
- Add/Edit/Delete district dialogs
|
|
- School assignment dialog
|
|
- Recharts bar charts for performance comparison
|
|
- Added to admin navigation in app-layout.tsx
|
|
- Enhanced auth page styling (src/components/auth-view.tsx)
|
|
- Animated gradient background with floating particles and geometric shapes
|
|
- Glassmorphism card effect, staggered entrance animations
|
|
- Enhanced role tabs with gradient active backgrounds and glow
|
|
- Features section below form
|
|
- Pulsing glow on primary button
|
|
- Enhanced dashboard styling (src/components/dashboard-view.tsx)
|
|
- Time-based greeting (Guten Morgen/Guten Tag/Guten Abend)
|
|
- Animated stat cards with gradient borders and hover effects
|
|
- Class overview mini card grid
|
|
- Enhanced activity timeline with vertical connector
|
|
- Animated paper saved counter with CountUp
|
|
- School branding section
|
|
- Recharts animation props
|
|
- Enhanced student portal styling (src/components/student-portal-view.tsx)
|
|
- Hero section with gradient banner, time-based greeting, motivational message
|
|
- SVG circular progress for competency levels
|
|
- Streak counter with 7-day spring-animated boxes
|
|
- Level-up progress bar with shimmer effect
|
|
- Animated number counter for points
|
|
- Celebration particles on goal completion
|
|
- Color-coded homework urgency indicators
|
|
- Teacher avatar with initials in feedback section
|
|
- Added 100+ i18n keys in both DE and EN sections
|
|
- All lint checks pass, dev server running without errors
|
|
|
|
Stage Summary:
|
|
- Database confirmed working at /home/z/my-project/db/custom.db
|
|
- Student model now has userId field for reliable student-user linking
|
|
- Student Portal view with 6 tabs, goal management, achievements, streaks
|
|
- District Management view with CRUD, analytics, school assignment
|
|
- Auth page, dashboard, and student portal all received major styling enhancements
|
|
- Student-goals API 403 bug fixed with name-matching fallback
|
|
- Students API now supports userId filter
|
|
- 100+ new i18n keys added
|
|
|
|
Unresolved issues / Next phase priorities:
|
|
- WebSocket connection timeout errors (Caddy proxy not forwarding WebSocket upgrades)
|
|
- Hydration warning in app (minor, non-blocking)
|
|
- Link demo student/parent users to Student records via userId field
|
|
- Add more page templates to notebooks (lab report, graph paper)
|
|
- Add image insertion to notebook pages
|
|
- Add inter-school competition federation
|
|
- Add parent portal enhancements
|
|
- Push to GitHub
|
|
|
|
---
|
|
|
|
## Task ID: 8-9 — Illness Reporting + Communication Builder
|
|
|
|
**Date:** 2025-01-21
|
|
**Agent:** illness-communication-builder
|
|
**Status:** Completed
|
|
|
|
### Summary
|
|
|
|
Built the **Illness Reporting with Parent Approval** and **Student-Teacher Communication Rooms** features for CompetenceTrack. These are critical features for a German school platform: illness reports require parent approval before becoming visible to teachers (privacy compliance), and communication rooms provide private student-teacher conversation channels.
|
|
|
|
### Files Created
|
|
|
|
1. **`/src/app/api/illness-reports/route.ts`** — GET, POST endpoints
|
|
2. **`/src/app/api/illness-reports/[id]/route.ts`** — GET, PUT, DELETE endpoints
|
|
3. **`/src/app/api/illness-reports/approve/route.ts`** — POST endpoint for parent approval
|
|
4. **`/src/app/api/communication-rooms/route.ts`** — GET, POST endpoints
|
|
5. **`/src/app/api/communication-rooms/[id]/route.ts`** — GET, PUT, DELETE endpoints
|
|
6. **`/src/app/api/communication-rooms/[id]/messages/route.ts`** — GET, POST endpoints
|
|
7. **`/src/components/illness-reporting-view.tsx`** — Full illness reporting UI
|
|
8. **`/src/components/communication-view.tsx`** — Full communication rooms UI
|
|
|
|
### Files Modified
|
|
|
|
1. **`/src/lib/i18n.ts`** — Added 80+ i18n keys (DE + EN) for illness and communication
|
|
2. **`/src/lib/store.ts`** — Added `'illness'` and `'communication'` to ViewName type
|
|
3. **`/src/components/app-layout.tsx`** — Added nav items and view rendering for illness and communication
|
|
|
|
### Changes Made
|
|
|
|
#### 1. Illness Reporting API Routes
|
|
|
|
**GET `/api/illness-reports`** — List illness reports with role-based access:
|
|
- STUDENT: See own reports only
|
|
- PARENT: See reports for their children (via ParentStudentLink)
|
|
- TEACHER: See only approved reports (isVisibleToTeacher = true)
|
|
- SCHOOL_ADMIN/VICE_PRINCIPAL: See all approved reports
|
|
- SUPER_ADMIN: See all reports
|
|
|
|
**POST `/api/illness-reports`** — Create illness report:
|
|
- STUDENT can report (reporterType: "student") — needs parent approval, not visible to teachers
|
|
- PARENT can report (reporterType: "parent") — auto-approved, visible to teachers/admin
|
|
- Student reports: parentApprovalStatus = "pending", isVisibleToTeacher = false, isVisibleToAdmin = false
|
|
- Parent reports: parentApprovalStatus = "approved", isVisibleToTeacher = true, isVisibleToAdmin = true
|
|
|
|
**PUT `/api/illness-reports/[id]`** — Update report:
|
|
- PARENT can approve/reject pending reports
|
|
- STUDENT can update own pending reports (before parent approval)
|
|
- SCHOOL_ADMIN/VICE_PRINCIPAL can also approve/reject
|
|
|
|
**DELETE `/api/illness-reports/[id]`** — Only the reporter or admin can delete
|
|
|
|
**POST `/api/illness-reports/approve`** — Parent approves/rejects a student's illness report:
|
|
- Sets parentApprovalStatus, isVisibleToTeacher, isVisibleToAdmin
|
|
- Records parentApprovedBy and parentApprovedAt
|
|
|
|
#### 2. Communication Rooms API Routes
|
|
|
|
**GET `/api/communication-rooms`** — List rooms for the user:
|
|
- STUDENT: See own rooms (studentId = userId)
|
|
- TEACHER: See own rooms (teacherId = userId)
|
|
- PARENT: See rooms for their children
|
|
- ADMIN: See all rooms in school
|
|
|
|
**POST `/api/communication-rooms`** — Student requests a conversation:
|
|
- Only students can request conversations
|
|
- Automatically finds the student's class responsible teacher (Klassenlehrer)
|
|
- Creates room with status "requested"
|
|
- Creates room members (student + teacher)
|
|
- If reason provided, sends it as first message
|
|
|
|
**PUT `/api/communication-rooms/[id]`** — Teacher accepts/rejects/closes room:
|
|
- status: "active" when accepted, "closed" when rejected/closed
|
|
- Records acceptedAt, closedAt, closeReason
|
|
|
|
**DELETE `/api/communication-rooms/[id]`** — Admin can delete rooms
|
|
|
|
**GET `/api/communication-rooms/[id]/messages`** — List messages (paginated):
|
|
- Marks messages as read for the current user
|
|
- Includes sender info
|
|
|
|
**POST `/api/communication-rooms/[id]/messages`** — Send a message:
|
|
- Only student and teacher can send messages (not admin/parent)
|
|
- Supports text, voice, file, note_share message types
|
|
|
|
#### 3. Illness Reporting Component
|
|
|
|
**For STUDENT:**
|
|
- Report illness form (date range, reason, description, medical certificate upload)
|
|
- See own reports with approval status badges
|
|
- Pending reports shown with warning badge
|
|
- Note: "Deine Krankmeldung muss von einem Elternteil bestaetigt werden"
|
|
- Calendar view and list view toggle
|
|
- Stats cards (pending, approved, rejected, total absences)
|
|
|
|
**For PARENT:**
|
|
- See all children's illness reports
|
|
- Approve/reject pending student reports with one-click buttons
|
|
- Report illness for children (auto-approved)
|
|
- Dashboard showing pending approvals needed
|
|
|
|
**For TEACHER:**
|
|
- See approved illness reports for their classes
|
|
- Calendar view of absences
|
|
- Cannot see pending (unapproved) reports
|
|
|
|
**For ADMIN/VICE_PRINCIPAL:**
|
|
- See all approved reports across the school
|
|
- Statistics on absences
|
|
- Delete functionality
|
|
|
|
#### 4. Communication Component
|
|
|
|
**For STUDENT:**
|
|
- Request conversation with class teacher
|
|
- See active conversations
|
|
- Send messages (text only for students)
|
|
- Share notes with teacher
|
|
- Voice note recording (Web Audio API)
|
|
- See conversation history
|
|
|
|
**For TEACHER:**
|
|
- See incoming conversation requests
|
|
- Accept/reject requests
|
|
- Active conversations with students
|
|
- Take notes during conversations (teacher notes panel)
|
|
- Send messages (text, voice, files)
|
|
- Close conversations
|
|
|
|
**For ADMIN/VICE_PRINCIPAL:**
|
|
- See all communication rooms
|
|
- Monitor (read-only) for safety
|
|
- Cannot send messages
|
|
|
|
**Features:**
|
|
- Real-time feel (polling every 5 seconds for new messages)
|
|
- Message bubbles with timestamps
|
|
- Voice note recording (using Web Audio API)
|
|
- Note sharing from notebook
|
|
- Teacher notes panel
|
|
- Mobile responsive (full-screen overlay on mobile)
|
|
|
|
#### 5. i18n Keys
|
|
|
|
Added 80+ keys to both DE and EN sections:
|
|
- Illness: title, report, my_reports, pending_approval, approved, rejected, parent_approval_needed, parent_approval_desc, start_date, end_date, reason, illness, doctor_visit, other, description, medical_certificate, approve, reject, auto_approved, not_visible_teacher, visible_teacher, statistics, calendar_view, list_view, no_reports, create_first, pending_reports, approved_reports, rejected_reports, total_absences, days_absent, reported_by, reported_on, approved_by, approved_on, children_reports, pending_approvals, approve_confirm, reject_confirm, rejection_reason, student_report, parent_report, no_pending, class_absences, all_reports, from_date, to_date, upload_certificate, delete_confirm, edit_report, status_pending, status_approved, status_rejected, absence_overview, report_success, approve_success, reject_success, delete_success, update_success, error_create, error_approve, error_reject
|
|
- Communication: title, request_conversation, active_conversations, pending_requests, accept, reject, close, send_message, type_message, share_notes, voice_note, attach_file, teacher_notes, conversation_with, no_conversations, requested, active, closed, no_messages, message_sent, request_sent, conversation_accepted, conversation_rejected, conversation_closed, select_conversation, new_conversation, with_teacher, your_teacher, request_reason, optional_reason, incoming_requests, student_requests, accept_confirm, reject_confirm, close_confirm, close_reason, teacher_notes_placeholder, all_rooms, monitor, read_only, room_status, last_message, participants, no_active_rooms, no_pending_requests, file_shared, note_shared, voice_message, recording, stop_recording, start_recording, typing, error_send, error_create, today, yesterday
|
|
|
|
### Design Decisions
|
|
|
|
- Used Lucide icons exclusively (Heart for illness, MessageSquare for communication)
|
|
- Used framer-motion for all animations (entrance, hover, expand)
|
|
- Used existing shadcn/ui components (Card, Badge, Button, Dialog, Input, Select, Textarea, Tabs, ScrollArea)
|
|
- All text uses the i18n system via `t()` function
|
|
- Maintained responsive design patterns (mobile-first, grid breakpoints)
|
|
- Used emerald green (#10b981) as accent color throughout
|
|
- Privacy-first: student illness reports are NOT visible to teachers until parent approves
|
|
- Communication rooms are private: only student and teacher can see messages
|
|
- Admin can monitor for safety but not participate
|
|
- Polling every 5 seconds for real-time feel in communication rooms
|
|
- Database schema already had the models (IllnessReport, CommunicationRoom, CommunicationRoomMember, CommunicationMessage) — no schema changes needed
|
|
|
|
### Lint Results
|
|
- ESLint: Passed (no errors in new files)
|
|
- TypeScript: No type errors
|
|
- Database: Already in sync (no migration needed)
|
|
|
|
---
|
|
|
|
## Task ID: 10-11 — Counseling + Disciplinary + AI Test Builder
|
|
|
|
**Date:** 2025-01-21
|
|
**Agent:** counseling-disciplinary-ai-test-builder
|
|
**Status:** Completed
|
|
|
|
### Summary
|
|
|
|
Implemented the Counseling/Guidance System, Disciplinary Committee System, and AI Test Generation features for CompetenceTrack. This includes 12 API route files, 3 view components, 130+ i18n keys, and store/navigation updates.
|
|
|
|
### Files Created
|
|
|
|
#### API Routes (12 files)
|
|
1. `/src/app/api/counseling/route.ts` - GET (list appointments), POST (request appointment)
|
|
2. `/src/app/api/counseling/[id]/route.ts` - GET, PUT (schedule/update/complete), DELETE (cancel)
|
|
3. `/src/app/api/disciplinary-committees/route.ts` - GET (list committees), POST (create committee)
|
|
4. `/src/app/api/disciplinary-committees/[id]/route.ts` - GET, PUT, DELETE (deactivate)
|
|
5. `/src/app/api/disciplinary-cases/route.ts` - GET (list cases), POST (report case)
|
|
6. `/src/app/api/disciplinary-cases/[id]/route.ts` - GET, PUT (review/resolve)
|
|
7. `/src/app/api/ai-tests/route.ts` - GET (list tests), POST (generate test with AI)
|
|
8. `/src/app/api/ai-tests/[id]/route.ts` - GET, PUT (submit answers)
|
|
9. `/src/app/api/ai-tests/auto-generate/route.ts` - POST (auto-generate for upcoming exams)
|
|
10. `/src/app/api/grading-reviews/route.ts` - GET (list reviews), POST (trigger AI review)
|
|
11. `/src/app/api/grading-reviews/[id]/route.ts` - GET, PUT
|
|
12. `/src/app/api/grading-reviews/[id]/comments/route.ts` - GET, POST (add comment)
|
|
|
|
#### Components (3 files)
|
|
1. `/src/components/counseling-view.tsx` - Full counseling view with role-based tabs
|
|
2. `/src/components/disciplinary-view.tsx` - Full disciplinary committee view
|
|
3. `/src/components/ai-tests-view.tsx` - AI test generation and taking view
|
|
|
|
### Files Modified
|
|
1. `/src/lib/i18n.ts` - Added 130+ i18n keys for DE and EN sections
|
|
2. `/src/lib/store.ts` - Added 'counseling', 'disciplinary', 'ai-tests' to ViewName type
|
|
3. `/src/components/app-layout.tsx` - Added imports, navigation entries, and renderView cases
|
|
|
|
### Key Features
|
|
|
|
#### Counseling System
|
|
- Students can request counseling appointments (guidance, psychological, career, social)
|
|
- Counselors (teachers) can schedule appointments and add session notes
|
|
- Calendar integration (creates CalendarEvent when addToCalendar=true)
|
|
- Admin statistics view with type breakdown
|
|
- Private notes between student and counselor
|
|
|
|
#### Disciplinary Committee System
|
|
- Admin can create/deactivate committees with members
|
|
- Teachers can report disciplinary incidents (warning, minor/major violation, serious offense)
|
|
- Committee members can review/resolve/dismiss cases
|
|
- Role-based filtering (TEACHER sees own cases, COMMITTEE MEMBER sees committee cases, ADMIN sees all)
|
|
|
|
#### AI Test Generation
|
|
- Uses z-ai-web-dev-sdk for AI-powered question generation
|
|
- Generates questions in JSON format with question, options, correctAnswer, explanation
|
|
- Interactive quiz interface with progress tracking
|
|
- Auto-generate feature for upcoming exams (2 weeks before)
|
|
- Score tracking and result review with explanations
|
|
- Admin statistics and manual trigger
|
|
|
|
#### Grading Review
|
|
- AI-powered grading review using z-ai-web-dev-sdk
|
|
- Analyzes grading patterns for fairness and consistency
|
|
- Comment system for adding suggested grades and reasons
|
|
- Discrepancy detection
|
|
|
|
### i18n Keys Added
|
|
- 36 counseling keys (DE + EN)
|
|
- 36 disciplinary keys (DE + EN)
|
|
- 36 AI test keys (DE + EN)
|
|
- 22 grading review keys (DE + EN)
|
|
- Total: ~130 keys in each language
|
|
|
|
### Lint Results
|
|
- ESLint: Passed (no errors)
|
|
- Dev server: Running without errors
|
|
- All API endpoints return 401 for unauthenticated requests (correct behavior)
|
|
|
|
### Design Decisions
|
|
- Used emerald green (#10b981) as accent color throughout
|
|
- Used framer-motion for animations (entrance, stagger, hover effects)
|
|
- Used shadcn/ui components (Card, Badge, Button, Dialog, Select, etc.)
|
|
- Mobile-first responsive design with flex-wrap and grid breakpoints
|
|
- Role-based UI rendering (STUDENT, TEACHER, ADMIN/VICE_PRINCIPAL)
|
|
- Used existing Prisma models (no schema changes needed)
|
|
- AI test generation uses z-ai-web-dev-sdk on backend only
|
|
- Fallback placeholder questions when AI generation fails
|
|
|
|
---
|
|
|
|
## Task ID: 6-7 - AI Integration + Virtual Character Builder
|
|
|
|
**Date:** 2025-01-21
|
|
**Agent:** AI Integration
|
|
**Status:** Completed
|
|
|
|
### Summary
|
|
|
|
Implemented the complete AI Integration system and Virtual Character/Chatbot system for CompetenceTrack. This includes 6 API routes, 2 major frontend components, 100+ i18n keys, and integration into the app layout.
|
|
|
|
### Files Created
|
|
|
|
1. **`/src/app/api/ai/chat/route.ts`** - AI Chat API (POST for sending messages, GET for chat history)
|
|
2. **`/src/app/api/ai/image/route.ts`** - AI Image Generation API (admin/teacher only)
|
|
3. **`/src/app/api/ai/video/route.ts`** - AI Video Generation API (admin/teacher only)
|
|
4. **`/src/app/api/ai/generate-topics/route.ts`** - AI Topic Generation API (admin/teacher only)
|
|
5. **`/src/app/api/ai/settings/route.ts`** - AI Settings CRUD API
|
|
6. **`/src/app/api/ai/character/route.ts`** - Virtual Character CRUD API
|
|
7. **`/src/components/ai-chat-widget.tsx`** - Floating AI chat widget with quick actions
|
|
8. **`/src/components/virtual-character.tsx`** - Animated SVG virtual character with 5 types
|
|
9. **`/src/components/subjects-view.tsx`** - Missing subjects view placeholder (fix)
|
|
10. **`/src/lib/i18n.ts`** - Added 100+ i18n keys for AI and character features
|
|
|
|
### Files Modified
|
|
|
|
11. **`/src/components/app-layout.tsx`** - Added AIChatWidget + VirtualCharacter imports and rendering; fixed duplicate Heart import
|
|
|
|
### Key Features
|
|
|
|
- AI Chat: Student asks questions, AI explains but doesn't solve homework
|
|
- Rate limiting per user per day (configurable via AISettings)
|
|
- Helper modes: guided, full, restricted
|
|
- 5 SVG character types: Owl, Dragon, Robot, Cat, Wizard
|
|
- Character moods: happy, excited, thinking, sleepy, celebrating
|
|
- XP system: 5 XP per chat, 100 XP per level
|
|
- Speech bubbles with time-based greetings
|
|
- Quick actions: Explain Topic, Give Hint, Quiz Me
|
|
- Virtual character only shown for STUDENT/PARENT roles
|
|
- All text i18n-ized (DE + EN)
|
|
|
|
### Lint Results
|
|
- All new/modified files pass ESLint with no errors
|
|
- Dev server running without errors
|
|
|
|
|
|
---
|
|
Task ID: Round-21
|
|
Agent: main
|
|
Task: Round 21 — Major Feature Addition: Schlaukopf Clone, AI Integration, Virtual Character, Illness Reporting, Communication, Counseling, Disciplinary, AI Tests
|
|
|
|
Work Log:
|
|
- Database confirmed working at /home/z/my-project/db/custom.db
|
|
- Explored schlaukopf.de/gymnasium/ using page_reader to understand content structure
|
|
- Added 15 new Prisma models to schema (SubjectCategory, SubjectContent, ContentChangeRequest, AISettings, VirtualCharacter, ChatMessage, IllnessReport, CommunicationRoom, CommunicationRoomMember, CommunicationMessage, CounselingAppointment, DisciplinaryCommittee, DisciplinaryCommitteeMember, DisciplinaryCase, AITestGeneration, TeacherGradingReview, GradingReviewComment)
|
|
- Added VICE_PRINCIPAL role to User model and auth API
|
|
- Added responsibleTeacherId to ClassGroup model (Klassenlehrer)
|
|
- Added new relations to School, User, Student, Subject, Assessment, ClassGroup models
|
|
- Pushed schema to database successfully (db:push)
|
|
- Built Subject Content Management System (Schlaukopf clone):
|
|
- 8 API routes (subject-categories, subject-contents, content-change-requests, ai-settings, subject-seed)
|
|
- Subjects View component with role-based UI (student browse/practice, teacher edit requests, admin CRUD)
|
|
- Seeded 7 categories (Klasse 5-10 + Oberstufe) and 416 content items
|
|
- Content mirrors schlaukopf.de structure (Mathematik, Deutsch, Englisch, etc.)
|
|
- Built AI Integration (Pollination AI):
|
|
- 6 API routes (ai/chat, ai/image, ai/video, ai/generate-topics, ai/settings, ai/character)
|
|
- AI Chat Widget component (floating chat with AI assistant)
|
|
- Uses z-ai-web-dev-sdk for backend AI features
|
|
- AI helper explains concepts but won't do homework
|
|
- Admin can configure Pollination, OpenAI, Anthropic providers
|
|
- Built Virtual Character System:
|
|
- VirtualCharacter component (5 characters: Owl, Dragon, Robot, Cat, Wizard)
|
|
- Animated SVG characters with moods and idle animations
|
|
- XP/level system, speech bubbles, motivational messages
|
|
- Only shown for STUDENT/PARENT roles
|
|
- Admin can disable via AISettings
|
|
- Built Illness Reporting with Parent Approval:
|
|
- 3 API routes (illness-reports, illness-reports/[id], illness-reports/approve)
|
|
- Students report illness → needs parent approval
|
|
- Parents report illness → auto-approved
|
|
- Unapproved reports NOT visible to teachers/admin
|
|
- Role-based views (student, parent, teacher, admin)
|
|
- Built Student-Teacher Communication Rooms:
|
|
- 3 API routes (communication-rooms, communication-rooms/[id], communication-rooms/[id]/messages)
|
|
- Students request conversations with Klassenlehrer
|
|
- Teachers accept/reject, then active chat room
|
|
- Support for text, voice, file, note sharing
|
|
- Real-time polling (every 5 seconds)
|
|
- Admin monitoring (read-only)
|
|
- Built Counseling/Guidance System:
|
|
- 2 API routes (counseling, counseling/[id])
|
|
- 4 counseling types: guidance, psychological, career, social
|
|
- Calendar integration (creates CalendarEvent when scheduled)
|
|
- Private notes between student and counselor
|
|
- Admin assigns counselor teachers
|
|
- Built Disciplinary Committee System:
|
|
- 4 API routes (disciplinary-committees, disciplinary-committees/[id], disciplinary-cases, disciplinary-cases/[id])
|
|
- Admin creates committees with lead teachers
|
|
- 4 severity levels: warning, minor_violation, major_violation, serious_offense
|
|
- Committee members review and resolve cases
|
|
- Built AI Test Generation:
|
|
- 3 API routes (ai-tests, ai-tests/[id], ai-tests/auto-generate)
|
|
- AI-powered question generation using z-ai-web-dev-sdk
|
|
- Interactive quiz interface with progress tracking
|
|
- Auto-generate practice tests 2 weeks before exams
|
|
- Built Teacher Grading Review (AI Audit):
|
|
- 3 API routes (grading-reviews, grading-reviews/[id], grading-reviews/[id]/comments)
|
|
- AI analyzes grading patterns for fairness
|
|
- Comment system with suggested grades and reasons
|
|
- Added VICE_PRINCIPAL role to auth API, demo accounts, and i18n
|
|
- Added 400+ i18n keys across all new features
|
|
- All lint checks pass
|
|
- All API routes verified working (curl tests)
|
|
- Subject content seeded (7 categories, 416 content items)
|
|
|
|
Stage Summary:
|
|
- 15 new Prisma models added (total 80+ models)
|
|
- 30+ new API route files created
|
|
- 8 new frontend components (subjects, ai-chat-widget, virtual-character, illness-reporting, communication, counseling, disciplinary, ai-tests)
|
|
- Schlaukopf.de content structure cloned (7 grade levels, 416 topics)
|
|
- AI integration with Pollination/OpenAI/Anthropic via z-ai-web-dev-sdk
|
|
- Virtual character system with 5 animated characters
|
|
- Illness reporting with parent approval (privacy-first)
|
|
- Student-teacher communication rooms with real-time chat
|
|
- Counseling/guidance system with calendar integration
|
|
- Disciplinary committee system with case management
|
|
- AI test generation with auto-generate before exams
|
|
- Teacher grading review with AI audit
|
|
- VICE_PRINCIPAL role with same privileges as SCHOOL_ADMIN
|
|
- Class responsible teacher (Klassenlehrer) field added
|
|
|
|
Unresolved issues / Next phase priorities:
|
|
- Agent-browser element finding issues (minor, may need different selectors)
|
|
- Need to add exam calendar integration for teachers (create exam events)
|
|
- Need to add teacher tablet grading with stylus annotation
|
|
- Need to improve styling with more details across all views
|
|
- Need to verify all functions work end-to-end
|
|
- Need to push to GitHub
|
|
- WebSocket connection timeout errors (Caddy proxy not forwarding WebSocket upgrades)
|
|
- Hydration warning in app (minor, non-blocking)
|
|
|
|
## Task ID: 17 - Styling Enhancer
|
|
|
|
**Date:** 2025-01-21
|
|
**Agent:** Styling Enhancer
|
|
**Status:** Completed
|
|
|
|
### Summary
|
|
|
|
Enhanced the visual design and polish of 8 components across CompetenceTrack. Focused on adding gradient headers, animated progress bars, skeleton loading states, empty state illustrations, typing indicators, online/offline status indicators, circular progress visualizations, shimmer effects, and improved message bubbles. All changes are purely visual - no functionality was modified.
|
|
|
|
### Files Modified
|
|
|
|
1. `src/components/subjects-view.tsx` - Enhanced with gradient header banner, skeleton loading states, animated progress bars, question navigation dots, circular score visualization, question count badges, empty state illustrations, animated breadcrumb transitions
|
|
2. `src/components/illness-reporting-view.tsx` - Enhanced with animated counter stats cards, date range visualization (timeline bars), improved medical certificate upload area with drag-and-drop styling
|
|
3. `src/components/communication-view.tsx` - Enhanced with online/offline status indicators, unread message count badges, typing indicator with bouncing dots, gradient message bubbles, improved chat header with gradient background
|
|
4. `src/components/counseling-view.tsx` - Enhanced with empty state illustrations, counselor avatar with initials, time slot visualization, improved date/time display
|
|
5. `src/components/disciplinary-view.tsx` - Enhanced with empty state illustrations, case status timeline, evidence file attachment cards, committee member role badges with color coding
|
|
6. `src/components/ai-tests-view.tsx` - Enhanced with circular score visualization, quiz progress bar with animated fill, question navigation dots, test result celebration animation, empty state illustrations
|
|
7. `src/components/virtual-character.tsx` - Enhanced with XP progress bar with shimmer effect, improved speech bubble animation
|
|
8. `src/components/ai-chat-widget.tsx` - Enhanced with patterned gradient header, improved message bubble animations, typing indicator with bouncing dots, quick action button hover/tap animations
|
|
|
|
### Key Visual Improvements
|
|
|
|
- **Gradient Header Banners**: Added emerald-to-teal gradient headers with dot pattern overlays for subjects view and AI chat header
|
|
- **Skeleton Loading States**: Replaced simple spinner with structured skeleton cards matching the actual content layout
|
|
- **Circular Progress Visualizations**: Added SVG-based circular progress for practice completion scores and AI test results
|
|
- **Animated Progress Bars**: Replaced static Progress components with animated gradient fills using framer-motion
|
|
- **Question Navigation Dots**: Added dot-based navigation indicators for practice mode and AI tests
|
|
- **Empty State Illustrations**: Added animated circular backgrounds with icons for all empty states
|
|
- **Typing Indicators**: Added bouncing dots animation for communication chat and AI chat widget
|
|
- **Online/Offline Status**: Added green/amber/gray status dots on user avatars in communication rooms
|
|
- **Date Range Visualization**: Added colored bars showing illness duration on report cards
|
|
- **Time Slot Visualization**: Added small blocks representing 15-minute intervals for counseling appointments
|
|
- **Shimmer Effect**: Added animated shimmer on XP progress bar in virtual character
|
|
- **Role Badges**: Added color-coded badges for committee members (chair=emerald, lead=amber)
|
|
- **Case Status Timeline**: Added visual step indicator showing open/under_review/resolved progression
|
|
- **Evidence Cards**: Added styled file attachment cards for disciplinary case evidence
|
|
|
|
## Task ID: 4, 5 - Teacher Grading + Deep Styling Builder
|
|
|
|
**Date:** 2025-01-21
|
|
**Agent:** Teacher Grading + Deep Styling Builder
|
|
**Status:** Completed
|
|
|
|
### Summary
|
|
|
|
Enhanced the CompetenceTrack platform with teacher grading features (annotation, AI review, bulk grading) and deep styling improvements across all major components.
|
|
|
|
### Files Created
|
|
|
|
1. `src/app/api/grading/annotate/route.ts` - POST/GET API for grading annotations (DrawingCanvas data linked to AssessmentResult)
|
|
|
|
### Files Modified
|
|
|
|
1. `prisma/schema.prisma` - Added `annotationData` and `annotationImage` fields to AssessmentResult model
|
|
2. `src/lib/i18n.ts` - Added 60+ i18n keys for DE and EN (grading, dashboard, settings, layout, attendance, assessments, auth)
|
|
3. `src/lib/api.ts` - Added `fetchGradingAnnotation` and `saveGradingAnnotation` API helpers
|
|
4. `src/components/grading-view.tsx` - Added annotation Sheet with DrawingCanvas, AI Review dialog, bulk grading mode, annotation indicator badges
|
|
5. `src/components/dashboard-view.tsx` - Added upcoming exams section with countdown badges, AI tips section
|
|
6. `src/components/settings-view.tsx` - Added AI Settings tab and Management tab
|
|
7. `src/components/app-layout.tsx` - Added Favorites section at top of sidebar, notification badges
|
|
8. `src/components/auth-view.tsx` - Enhanced FeaturesSection with feature showcase descriptions
|
|
9. `src/components/attendance-view.tsx` - Added illness report button (Krankmeldung)
|
|
10. `src/components/assessments-view.tsx` - Added Plan Exam button, Generate AI Test button
|
|
|
|
### Key Features
|
|
|
|
- **Scratch Pad / Annotation**: Opens a Sheet panel with DrawingCanvas for stylus annotations on student assessments
|
|
- **AI Review**: Triggers AI grading review, shows discrepancies and feedback in a dialog
|
|
- **Bulk Grading Mode**: Toggle bulk mode, select students, apply grade value to all selected
|
|
- **Upcoming Exams**: Countdown badges showing days until exam
|
|
- **AI Tips**: Actionable tips about AI grading review, test generation, bulk grading, annotations
|
|
- **AI Settings Tab**: AI provider selection, API key, model selection, virtual character toggle
|
|
- **Management Tab**: Responsible teacher, vice principal, disciplinary committee, data import
|
|
- **Favorites Section**: Quick access to Dashboard, Grading, Attendance at top of sidebar
|
|
- **Notification Badges**: Sparkles badge on Grading, AlertTriangle badge on Attendance
|
|
- **Illness Report Button**: Krankmeldung button for reporting student illness
|
|
|
|
## Task ID: 3, 6, 7 - Exam Calendar + Parent Portal + Deep Content Builder
|
|
|
|
**Date:** 2025-01-21
|
|
**Agent:** Exam Calendar + Parent Portal + Deep Content Builder
|
|
**Status:** Completed
|
|
|
|
### Summary
|
|
|
|
Built three major features: Exam Calendar Integration, Parent Portal, and Deep Schlaukopf Content Crawling.
|
|
|
|
### Files Created
|
|
|
|
1. `src/app/api/calendar-events/exams/route.ts` - GET/POST for exam events
|
|
2. `src/app/api/subject-contents/crawl/route.ts` - POST crawl schlaukopf.de pages
|
|
3. `src/app/api/parent-portal/route.ts` - GET parent dashboard data
|
|
4. `src/components/parent-portal-view.tsx` - Parent portal view (~600 lines)
|
|
|
|
### Files Modified
|
|
|
|
1. `prisma/schema.prisma` - Added assessmentId field, eventType index
|
|
2. `src/lib/i18n.ts` - Added 88+ i18n keys (DE + EN)
|
|
3. `src/lib/api.ts` - Added 'exam' to CalendarEventItemType
|
|
4. `src/lib/store.ts` - Added 'parent-portal' to ViewName
|
|
5. `src/components/calendar-view.tsx` - Exam planning, filter, countdown badges
|
|
6. `src/components/subjects-view.tsx` - Crawl dialog
|
|
7. `src/components/app-layout.tsx` - ParentPortalView, navigation
|
|
|
|
### Key Features
|
|
|
|
- **Exam Calendar**: Plan Exam button (teachers), exam filter toggle, countdown badges, exam sidebar
|
|
- **Parent Portal**: Child selector, pending approvals, tabbed views (exams/grades/attendance/illness/counseling/disciplinary), quick actions
|
|
- **Content Crawl**: z-ai-web-dev-sdk page_reader, AI topic extraction, fallback generation, admin-only
|
|
- **Plan Exam / Generate AI Test**: Buttons for exam planning and AI test generation
|
|
|
|
---
|
|
Task ID: Round-22
|
|
Agent: main
|
|
Task: Round 22 - Exam Calendar, Parent Portal, Teacher Grading, Deep Styling
|
|
|
|
Work Log:
|
|
- Fixed schoolId auto-detect in counseling and disciplinary-committees APIs
|
|
- Added MessageSquare import to settings-view.tsx
|
|
- Built Exam Calendar Integration:
|
|
- API: /api/calendar-events/exams (GET/POST)
|
|
- Calendar view: Plan Exam button, exam filter toggle, countdown badges
|
|
- Exam type badge in calendar legend
|
|
- Red-themed exam visual config with GraduationCap icon
|
|
- Built Parent Portal:
|
|
- API: /api/parent-portal (GET)
|
|
- Parent portal view: children overview, illness approvals, grades, attendance
|
|
- Quick actions: Report illness, Request conversation
|
|
- Navigation: Added to parent role
|
|
- Built Deep Schlaukopf Content Crawling:
|
|
- API: /api/subject-contents/crawl (POST, admin-only)
|
|
- Uses z-ai-web-dev-sdk page_reader + AI to extract topics
|
|
- Crawl button in subjects-view admin section
|
|
- Built Teacher Grading Enhancements:
|
|
- Annotation API: /api/grading/annotate (GET/POST)
|
|
- Grading view: Scratch pad with DrawingCanvas, AI review button, bulk grading
|
|
- Annotation indicator on graded items
|
|
- Built Deep Styling Improvements:
|
|
- Dashboard: Upcoming exams section, AI tips section
|
|
- Settings: AI provider config, virtual character toggle, management tabs
|
|
- Layout: Favorites section, notification badges on sidebar
|
|
- Auth: VICE_PRINCIPAL demo account, feature showcase
|
|
- Attendance: Illness report integration button
|
|
- Assessments: Plan exam button, AI test generation button
|
|
- Added 150+ i18n keys
|
|
- All lints pass, dev server running
|
|
|
|
Stage Summary:
|
|
- 6 new API route files created
|
|
- 1 new component (parent-portal-view.tsx)
|
|
- 8 components enhanced with new features
|
|
- Exam calendar integration with countdown badges
|
|
- Parent portal with children overview and illness approvals
|
|
- Teacher grading with stylus annotation and AI review
|
|
- Deep schlaukopf.de content crawling
|
|
- Pushed to GitHub
|
|
|
|
Unresolved issues / Next phase priorities:
|
|
- Need to verify all features work end-to-end in the browser
|
|
- Need to add more schlaukopf.de content (crawl deeper pages)
|
|
- Need to add more practice exercises with actual questions
|
|
- Need to enhance the virtual character with more animations
|
|
- Need to add inter-school competition federation
|
|
- Need to add parent portal enhancements (communication with teachers)
|
|
- WebSocket connection timeout errors (Caddy proxy not forwarding WebSocket upgrades)
|
|
|
|
## Task ID: 9-b - Inter-School Competitions + Enhanced Communication Builder
|
|
|
|
**Date:** 2025-01-21
|
|
**Agent:** Inter-School Competitions + Enhanced Communication Builder
|
|
**Status:** Completed
|
|
|
|
### Summary
|
|
|
|
Built the Inter-School Competition Federation system and Enhanced Communication System for CompetenceTrack. The federation system allows schools in the same district to compete against each other with school rankings and team scores. The enhanced communication system adds voice chat, note sharing, file sharing, and teacher notes to the existing communication rooms.
|
|
|
|
### Files Created
|
|
|
|
1. `src/app/api/competitions/federation/route.ts` - GET/POST for federation competitions
|
|
2. `src/app/api/communication-rooms/[id]/share-notes/route.ts` - GET/POST for sharing notebooks in communication rooms
|
|
|
|
### Files Modified
|
|
|
|
1. `prisma/schema.prisma` - Added `isFederation` and `federationSchedule` fields to Competition model
|
|
2. `src/lib/i18n.ts` - Added 70+ i18n keys for federation and communication features (DE + EN)
|
|
3. `src/lib/api.ts` - Added `FederationLeaderboardEntry` interface, `fetchFederationCompetitions` and `createFederationCompetition` functions, updated `CompetitionData` interface with `isFederation`, `federationSchedule`, and `primaryColor` fields
|
|
4. `src/components/competitions-view.tsx` - Added Federation tab with school leaderboard, federation competition cards, create/join functionality, and category/schedule filters
|
|
5. `src/components/communication-view.tsx` - Complete rewrite with voice chat (Web Audio API), file sharing (drag-and-drop), notebook sharing, and teacher notes panel
|
|
|
|
### Key Features
|
|
|
|
#### Inter-School Competition Federation
|
|
- Schools in the same district compete against each other
|
|
- Federation leaderboard showing school rankings with team scores (sum of top 10 student scores)
|
|
- Competition types: Math Olympiad, Science Bowl, Language Quiz, General Knowledge
|
|
- Schedule: Weekly, Monthly, Quarterly competitions
|
|
- Admin/teacher can create federation competitions
|
|
- Students can join competitions with "Join Competition" button
|
|
- Federation-specific competition cards with category icons
|
|
- Create Federation Competition dialog with all fields
|
|
|
|
#### Enhanced Communication System
|
|
- **Voice Chat**: Record and send voice messages using Web Audio API, with playback controls (play/pause), duration display, and waveform visualization
|
|
- **Note Sharing**: Students can share their notebook with the teacher via the share-notes API, select notebook dialog with color-coded notebook cards
|
|
- **File Sharing**: Drag-and-drop file upload, file input button, supports PDF/images/documents, files stored as base64 in message metadata, file size validation (10 MB max)
|
|
- **Teacher Notes Panel**: Teachers can take private notes during conversations, notes are saved via TeacherNote model, notes are NOT visible to students, expandable panel in chat header
|
|
|
|
### i18n Keys Added (70+ keys)
|
|
- Federation: `federation.title`, `federation.leaderboard`, `federation.school_ranking`, `federation.team_score`, `federation.join`, `federation.create`, `federation.math_olympiad`, `federation.science_bowl`, `federation.language_quiz`, `federation.general_knowledge`, `federation.weekly`, `federation.monthly`, `federation.quarterly`, etc.
|
|
- Communication: `communication.voice_call`, `communication.voice_message`, `communication.play`, `communication.share_notes`, `communication.select_notebook`, `communication.shared_notes`, `communication.upload_file`, `communication.drag_drop`, `communication.teacher_notes`, `communication.private_notes`, `communication.save_note`, `communication.notes_saved`, etc.
|
|
|
|
## Task ID: 9-a - Practice Exercises + Enhanced Virtual Character Builder
|
|
|
|
**Date:** 2025-01-21
|
|
**Agent:** Practice Exercises + Enhanced Virtual Character Builder
|
|
**Status:** Completed
|
|
|
|
### Summary
|
|
|
|
Built two major features: (1) Practice Exercises with AI-generated multiple-choice questions and (2) Enhanced Virtual Character with animations, accessories, AI chat, and interactions.
|
|
|
|
### Files Created
|
|
|
|
1. `src/app/api/subject-contents/exercises/route.ts` - API route for generating practice exercises with AI (POST) and fetching existing questions (GET)
|
|
- Uses z-ai-web-dev-sdk to generate multiple-choice questions
|
|
- Rate limit: max 10 requests per day per user
|
|
- Saves generated questions to SubjectContent's `content` field as JSON
|
|
- Awards XP to virtual character for generating exercises
|
|
|
|
2. `src/app/api/subject-contents/exercises/` directory - Created for the exercises API
|
|
|
|
### Files Modified
|
|
|
|
1. `src/lib/i18n.ts` - Added 100+ i18n keys for practice exercises and enhanced virtual character (DE + EN)
|
|
2. `src/components/subjects-view.tsx` - Enhanced with full practice exercise mode (real AI questions, score tracking, celebration, retry incorrect)
|
|
3. `src/components/virtual-character.tsx` - Complete rewrite with animations, accessories, AI chat, and interactions
|
|
4. `src/app/api/ai/character/route.ts` - Updated to support accessories field
|
|
|
|
### Key Features
|
|
|
|
- **Practice Exercises**: AI-generated multiple-choice questions, score tracking, detailed breakdown, retry incorrect, confetti celebration on high scores
|
|
- **Enhanced Virtual Character**: 5 character types with accessories (hat, glasses, scarf, cape, wand), AI chat, mood animations, daily tips, level-up celebrations
|
|
- **100+ i18n keys** added in both DE and EN
|
|
|
|
---
|
|
Task ID: Round-23
|
|
Agent: main
|
|
Task: Round 23 - Practice Exercises, Enhanced Virtual Character, Inter-School Federation, Voice Chat
|
|
|
|
Work Log:
|
|
- Built Practice Exercises with AI-Generated Questions:
|
|
- API: /api/subject-contents/exercises (GET/POST)
|
|
- Uses z-ai-web-dev-sdk to generate multiple choice questions
|
|
- Practice mode with score tracking, correct/incorrect feedback
|
|
- Results screen with circular progress, confetti on high scores
|
|
- Retry incorrect questions option
|
|
- Enhanced Virtual Character:
|
|
- More animations: idle floating, thinking, celebrating, sleeping, talking
|
|
- Accessories: Hat (Level 2), Glasses (Level 3), Scarf (Level 5), Cape (Level 7), Wand (Level 10)
|
|
- AI chat integration via character
|
|
- Color presets for quick customization
|
|
- Daily tips and encouragement messages
|
|
- Built Inter-School Competition Federation:
|
|
- API: /api/competitions/federation (GET/POST)
|
|
- School leaderboard with team scores
|
|
- Federation competitions between schools in same district
|
|
- Competition types: Math Olympiad, Science Bowl, Language Quiz, General Knowledge
|
|
- Schedule: Weekly, Monthly, Quarterly
|
|
- Added isFederation and federationSchedule fields to Competition model
|
|
- Enhanced Communication System:
|
|
- Voice chat: Web Audio API recording, play/pause controls
|
|
- File sharing: Drag-and-drop upload, 10MB limit
|
|
- Note sharing: Share notebooks with teacher
|
|
- API: /api/communication-rooms/[id]/share-notes (GET/POST)
|
|
- Teacher notes panel: Private notes during conversations
|
|
- Added 170+ i18n keys
|
|
- All lints pass, dev server running
|
|
- Pushed to GitHub
|
|
|
|
Stage Summary:
|
|
- 3 new API route files
|
|
- 4 components enhanced
|
|
- 2 new Prisma schema fields (isFederation, federationSchedule)
|
|
- Practice exercises with AI question generation
|
|
- Enhanced virtual character with accessories and animations
|
|
- Inter-school federation competitions
|
|
- Voice chat, file sharing, note sharing in communication
|
|
- Pushed to GitHub
|
|
|
|
Unresolved issues / Next phase priorities:
|
|
- Need to verify all features work end-to-end in the browser
|
|
- Need to add more practice questions for each topic
|
|
- Need to add more virtual character animations
|
|
- Need to add more inter-school competition features
|
|
- WebSocket connection timeout errors (Caddy proxy)
|
|
|
|
---
|
|
|
|
## Task ID: 10 - Class Management + Responsible Teacher + Deep Styling
|
|
|
|
**Date:** 2025-01-21
|
|
**Agent:** Class Management + Responsible Teacher + Deep Styling
|
|
**Status:** Completed
|
|
|
|
### Summary
|
|
|
|
Built the Responsible Teacher (Klassenlehrer) management, Vice Principal management, enhanced calendar exam integration, student portal exam/study tips, and dashboard Klassenlehrer section for CompetenceTrack. Includes full API routes, comprehensive frontend components with role-based views, i18n support (90+ keys in DE+EN), and deep styling improvements.
|
|
|
|
### Files Created
|
|
|
|
1. `src/app/api/classes/[id]/route.ts` - GET/PUT/DELETE for single class with responsibleTeacherId support
|
|
2. `src/app/api/users/role/route.ts` - PUT for changing user roles (admin only, VICE_PRINCIPAL support)
|
|
|
|
### Files Modified
|
|
|
|
1. `src/lib/i18n.ts` - Added 90+ i18n keys for Klassenlehrer, Vice Principal, Calendar Exams, Dashboard, and Student Portal features (DE + EN)
|
|
2. `src/lib/api.ts` - Added `responsibleTeacher`, `responsibleTeacherId`, `assessmentCount` fields to ClassGroup interface
|
|
3. `src/app/api/classes/route.ts` - Added responsibleTeacher include and assessmentCount to GET response
|
|
4. `src/app/api/users/[id]/route.ts` - Added VICE_PRINCIPAL to role enum
|
|
5. `src/components/classes-view.tsx` - Added Klassenlehrer badge in class list, Klassenlehrer section in class detail, assign/change responsible teacher dialog, student count progress bar, assessment count card
|
|
6. `src/components/settings-view.tsx` - Added VicePrincipalManager sub-component with current admins list, assign/remove VP role, confirm dialog
|
|
7. `src/components/calendar-view.tsx` - Added Printer icon import and print calendar button
|
|
8. `src/components/student-portal-view.tsx` - Added StudentExamSection sub-component, upcoming exams tab with countdown badges, AI study tips section, virtual character/AI assistant section
|
|
9. `src/components/dashboard-view.tsx` - Added KlassenlehrerDashboard sub-component with my classes, pending illness reports, upcoming exams, quick actions
|
|
|
|
### Key Features
|
|
|
|
- **Klassenlehrer Management**: Admin can assign/change responsible teacher for each class; shows privilege badges (illness access, communication access, counseling access, disciplinary access)
|
|
- **Vice Principal Management**: Admin can assign/remove VP role; shows current admins list; confirm dialog for role changes
|
|
- **Calendar Exam Integration**: Print calendar button; exam mode filter; plan exam button; exam countdown badges
|
|
- **Student Portal**: Upcoming exams with countdown badges (urgency-colored); AI study tips; virtual character/AI assistant
|
|
- **Dashboard Klassenlehrer Section**: Shows classes where user is responsible teacher; pending illness reports; upcoming exams; quick action buttons
|
|
|
|
### i18n Keys Added (90+)
|
|
|
|
- `classes.responsible_teacher`, `classes.klassenlehrer`, `classes.assign_teacher`, `classes.change_teacher`, `classes.teacher_privileges`, `classes.illness_access`, `classes.communication_access`, `classes.counseling_access`, `classes.disciplinary_access`, `classes.no_responsible_teacher`, `classes.teacher_assigned`, `classes.teacher_changed`, `classes.select_teacher`, `classes.class_statistics`, `classes.student_progress`, `classes.class_color`, `classes.avg_mastery`, `classes.total_students`, `classes.active_assessments`, `classes.teacher_badge`, `classes.privileges_info`
|
|
- `settings.vice_principal`, `settings.vice_principal_short`, `settings.assign_vice_principal`, `settings.remove_vice_principal`, `settings.current_admins`, `settings.admin_list`, `settings.role_changed`, `settings.role_removed`, `settings.confirm_role_change`, `settings.confirm_role_remove`, `settings.vice_principal_desc`, `settings.manage_roles`, `settings.user_role`
|
|
- `calendar.exam_mode`, `calendar.exam_marker`, `calendar.print`, `calendar.exam_details`, `calendar.plan_exam`, `calendar.exam_filter`, `calendar.exam_countdown`, `calendar.exam_today`, `calendar.exam_tomorrow`, `calendar.exam_in_days`, `calendar.exam_in_weeks`, `calendar.no_exams`, `calendar.exam_subject`, `calendar.exam_class`, `calendar.exam_teacher`, `calendar.exam_type`, `calendar.exam_notes`, `calendar.exam_created`, `calendar.show_all`, `calendar.show_exams_only`
|
|
- `dashboard.klassenlehrer_section`, `dashboard.pending_illness`, `dashboard.pending_communications`, `dashboard.class_overview`, `dashboard.upcoming_exams`, `dashboard.my_classes`, `dashboard.no_illness_reports`, `dashboard.no_communications`, `dashboard.quick_actions`
|
|
- `portal.upcoming_exams`, `portal.study_tips`, `portal.practice_recommendations`, `portal.ai_assistant`, `portal.exam_countdown`, `portal.days_left`, `portal.prepare_exam`, `portal.no_exams_scheduled`, `portal.ai_study_tip`, `portal.recommended_exercises`, `portal.start_practice`, `portal.virtual_character`, `portal.ask_ai`, `portal.exam_ready`, `portal.study_progress`, `portal.focus_areas`, `portal.motivation_message`
|
|
|
|
### Technical Notes
|
|
|
|
- Used emerald green (#10b981) as the accent color throughout
|
|
- All components are responsive (mobile-first)
|
|
- Used framer-motion for animations
|
|
- Used shadcn/ui components (Badge, Card, Button, Dialog, Select, Tooltip, etc.)
|
|
- All text is i18n-ized (DE + EN)
|
|
- Used cookie-based auth via `getSession` from `@/lib/auth`
|
|
- Used `apiGet`, `apiPut`, `apiPost`, `apiDelete` from `@/lib/api` for API calls
|
|
|