This commit is contained in:
2026-06-30 11:51:34 +07:00
parent fd08bee7ab
commit 0abf48ea2d
28 changed files with 3514 additions and 37 deletions

View File

@@ -225,6 +225,24 @@ func GetAllowedAppsHandler(db *gorm.DB) fiber.Handler {
studentIDStr := c.Query("studentId", "0")
studentID, _ := strconv.ParseInt(studentIDStr, 10, 64)
// Phòng thi ưu tiên hơn lịch học
if studentID > 0 {
if examInfo := internalDb.FindActiveExamForStudent(db, studentID); examInfo != nil {
keywords := strings.TrimSpace(examInfo.Room.AllowedApps)
if keywords == "" {
keywords = defaultExamAllowedApps
}
return c.JSON(fiber.Map{
"classRkId": rkID,
"keywords": keywords,
"exit": false,
"examMode": true,
"examRoomId": examInfo.Room.ID,
})
}
}
if studentID > 0 {
resolvedClassID := internalDb.FindActiveClassForStudent(db, studentID)
if resolvedClassID > 0 {