add
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user