update font and fix timer bug
All checks were successful
Deploy to Production / deploy (push) Successful in 5s

This commit is contained in:
Đặng Minh Quang
2026-02-27 10:21:41 +07:00
parent cc66edd9a2
commit 3da319e41d
5 changed files with 15 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
{ {
"version": 1772105708, "version": 1772161641,
"fileList": [ "fileList": [
"data.js", "data.js",
"c2runtime.js", "c2runtime.js",

View File

@@ -50,6 +50,7 @@ function SenaSDK(gid = "G2510S1T30") {
// 'preview' - Timeout 5s rồi fallback sample (testing với data thật) // 'preview' - Timeout 5s rồi fallback sample (testing với data thật)
// 'dev' - Load sample ngay lập tức (development) // 'dev' - Load sample ngay lập tức (development)
this.mode = "preview"; // Default mode this.mode = "preview"; // Default mode
this.role = "student"; // Default role
} }
/** /**
@@ -373,9 +374,15 @@ SenaSDK.prototype.load = function (callback, template = "G2510S1T30") {
self.mode = urlMode.toLowerCase(); self.mode = urlMode.toLowerCase();
} }
// THÊM 2 DÒNG NÀY: Lấy role từ URL
const urlRole = urlParams.get("role");
if (urlRole) self.role = urlRole.toLowerCase();
console.log( console.log(
"🎮 Sena SDK: Mode =", "🎮 Sena SDK: Mode =",
self.mode.toUpperCase(), self.mode.toUpperCase(),
"| Role =",
self.role || "student",
"| GameCode =", "| GameCode =",
self.gameCode, self.gameCode,
); );
@@ -1171,7 +1178,12 @@ SenaSDK.prototype.end = function (answer, callback) {
// ----------------------------------------------------------- // -----------------------------------------------------------
// [BƯỚC 1] Kiểm tra Time Limit TRƯỚC (Sửa biến isCorrect) // [BƯỚC 1] Kiểm tra Time Limit TRƯỚC (Sửa biến isCorrect)
// ----------------------------------------------------------- // -----------------------------------------------------------
if (self.timeLimit > 0 && duration > self.timeLimit) { // THÊM ĐIỀU KIỆN: Nếu là teacher thì bỏ qua kiểm tra thời gian
if (
self.role !== "teacher" &&
self.timeLimit > 0 &&
duration > self.timeLimit
) {
isCorrect = false; // CHỈ sửa biến boolean, KHÔNG gọi result.isCorrect isCorrect = false; // CHỈ sửa biến boolean, KHÔNG gọi result.isCorrect
console.log("🎮 Sena SDK: Time Limit Exceeded -> Result set to False"); console.log("🎮 Sena SDK: Time Limit Exceeded -> Result set to False");
} }

Binary file not shown.