# Bộ Tài Liệu Kỹ Thuật: Phân Hệ Quản Lý Danh Sách Học Viên Đến Lịch Thi
> **Module Identifier**: `web_exam_schedule` | **Menu Path**: Quản lý thi ➔ Quản lý DSHV đến lịch thi | **Route**: `exam-schedule.index`

---

## 📌 Giới Thiệu Tổng Quan

Phân hệ **Quản lý danh sách học viên đến lịch thi** (`web_exam_schedule`) là trung tâm điều phối và kiểm soát toàn bộ kế hoạch thi cử, kiểm tra định kỳ và mocktest của học viên trên nền tảng LMS. Hệ thống kết nối chặt chẽ giữa cấu trúc học trình Moodle Core, công cụ chấm điểm LMS và hệ sinh thái học tập Zeus / ICL.

---

## 📂 Cấu Trúc Bộ Tài Liệu

Bộ tài liệu được tổ chức thành 6 phần chuyên sâu kèm mã nguồn và sơ đồ trực quan:

| STT | Tài liệu | Nội dung chính | Liên kết |
| :---: | :--- | :--- | :--- |
| **01** | **Use Case & Luồng Hoạt Động** | • Tổng quan tác nhân (Actor)<br>• Sơ đồ Use Case tổng thể<br>• Chi tiết 6 Use Case cốt lõi (Tra cứu, Tạo lịch, Đổi lịch, Gia hạn, Xóa, Xuất báo cáo) kèm Sequence Diagram | [Xem chi tiết](file:///var/www/html/lms_hocmai/van-hanh-thi/dshv-den-lich-thi/01_use_case_va_luong_hoat_dong.md) |
| **02** | **Quy Tắc Nghiệp Vụ (Business Logic)** | • Phân loại yêu cầu (`requirement_type`: Đúng lộ trình, Thi lại, Thi sớm)<br>• Quản lý trạng thái lịch thi (`status`: Mở/Đóng)<br>• Logic tính toán thời gian mở/đóng thực tế (`effective time`)<br>• Tính bất biến khi đổi lịch & Audit log<br>• Quy tắc cấp thêm lượt thi (`processRetakeAllowance`)<br>• Phân loại học viên VIP vs Thường<br>• Tích hợp Zeus & Whitelist an toàn | [Xem chi tiết](file:///var/www/html/lms_hocmai/van-hanh-thi/dshv-den-lich-thi/02_business_logic.md) |
| **03** | **Sơ Đồ Chức Năng & Thiết Kế** | • Kiến trúc thành phần (Component Architecture)<br>• Sơ đồ luồng (Flowchart) cho từng hàm controller<br>• Quy trình xuất file nền (Queue Batching + Polling)<br>• Đặc tả chi tiết 8 API Endpoints (Request params, Response JSON, Error codes) | [Xem chi tiết](file:///var/www/html/lms_hocmai/van-hanh-thi/dshv-den-lich-thi/03_function_diagram_va_function_design.md) |
| **04** | **Cơ Sở Dữ Liệu & Schema** | • Sơ đồ thực thể liên kết (ERD)<br>• Từ điển dữ liệu (Data Dictionary) chi tiết kèm comment từng cột cho các bảng `student_exam_schedules`, `student_exam_schedule_histories`, `student_exam_schedule_icl_logs`<br>• Các bảng liên kết: `user_quiz_attempts`, `course_student`, `zeus_session_completions` | [Xem chi tiết](file:///var/www/html/lms_hocmai/van-hanh-thi/dshv-den-lich-thi/04_database_va_database_schema.md) |
| **05** | **Kịch Bản Kiểm Thử (Test Cases)** | • Ma trận kiểm thử chức năng giao diện (Search, Create, Update, Extend, Delete, Export, Remind)<br>• Kịch bản kiểm thử chi tiết P0-P2 (Tiền điều kiện, Các bước trên UI, Kết quả mong đợi)<br>• Kiểm thử biên & Ngoại lệ (Edge cases) | [Xem chi tiết](file:///var/www/html/lms_hocmai/van-hanh-thi/dshv-den-lich-thi/05_test_cases_va_kiem_thu.md) |
| **06** | **Hướng Dẫn Vận Hành & Sự Cố** | • Quy trình thao tác chuẩn (SOP) từng bước cho Cán bộ Vận hành và Giáo vụ<br>• Cẩm nang xử lý sự cố thường gặp (Troubleshooting & FAQ trên giao diện Web UI)<br>• Checklist công việc vận hành hàng ngày và hàng tuần | [Xem chi tiết](file:///var/www/html/lms_hocmai/van-hanh-thi/dshv-den-lich-thi/06_huong_dan_van_hanh_va_troubleshooting.md) |

---

## 🛠️ Ma Trận File & Thành Phần Kỹ Thuật (Source Code Mapping)

| Khối Chức Năng | File Mã Nguồn Liên Quan |
| :--- | :--- |
| **Cấu hình Quyền & Menu** | • [config/tenant_groups.php](file:///var/www/html/lms_hocmai/config/tenant_groups.php#L850-L890) |
| **Định tuyến (Routes)** | • [routes/web.php](file:///var/www/html/lms_hocmai/routes/web.php#L655-L665) (`prefix: exam-schedule`) |
| **Controller** | • [app/Http/Controllers/ExamScheduleController.php](file:///var/www/html/lms_hocmai/app/Http/Controllers/ExamScheduleController.php) |
| **Background Queue Job** | • [app/Jobs/ExportExamScheduleJob.php](file:///var/www/html/lms_hocmai/app/Jobs/ExportExamScheduleJob.php) |
| **Models (Eloquent)** | • [app/Models/StudentExamSchedule.php](file:///var/www/html/lms_hocmai/app/Models/StudentExamSchedule.php)<br>• [app/Models/StudentExamScheduleHistory.php](file:///var/www/html/lms_hocmai/app/Models/StudentExamScheduleHistory.php)<br>• [app/Models/StudentExamScheduleIclLog.php](file:///var/www/html/lms_hocmai/app/Models/StudentExamScheduleIclLog.php)<br>• [app/Models/UserQuizAttempt.php](file:///var/www/html/lms_hocmai/app/Models/UserQuizAttempt.php) |
| **Database Migrations** | • `database/migrations/2026_06_04_064857_create_student_exam_schedules_table.php`<br>• `database/migrations/2026_06_23_041500_add_denormalized_fields_to_student_exam_schedules_table.php`<br>• `database/migrations/2026_07_03_043857_add_reminder_flags_to_student_exam_schedules_table.php`<br>• `database/migrations/2026_06_04_072158_create_student_exam_schedule_histories_table.php`<br>• `database/migrations/2026_07_06_100000_create_student_exam_schedule_icl_logs_table.php` |
| **Giao diện (Blade Views)** | • [resources/views/exam-schedule/index.blade.php](file:///var/www/html/lms_hocmai/resources/views/exam-schedule/index.blade.php)<br>• [resources/views/exam-schedule/modal/exam-schedule-modal.blade.php](file:///var/www/html/lms_hocmai/resources/views/exam-schedule/modal/exam-schedule-modal.blade.php)<br>• [resources/views/exam-schedule/modal/extend-deadline-modal.blade.php](file:///var/www/html/lms_hocmai/resources/views/exam-schedule/modal/extend-deadline-modal.blade.php) |
| **Frontend Logic (JS)** | • [public/js/exam-schedule/exam-schedule.js](file:///var/www/html/lms_hocmai/public/js/exam-schedule/exam-schedule.js) |
| **Helpers & Services** | • [app/Helpers/Helper.php](file:///var/www/html/lms_hocmai/app/Helpers/Helper.php#L7430) (`sendMocktestRemindingManualWithLog`)<br>• [app/Services/ApiMoodleService.php](file:///var/www/html/lms_hocmai/app/Services/ApiMoodleService.php) |
