update them mockdata
All checks were successful
Deploy to Production / deploy (push) Successful in 8s

This commit is contained in:
Đặng Minh Quang
2026-02-27 13:39:07 +07:00
parent 93a6a17379
commit 7586ea20cb
9 changed files with 20 additions and 9 deletions

View File

@@ -25772,8 +25772,8 @@ cr.getObjectRefTable = function () { return [
cr.plugins_.Audio,
cr.plugins_.Browser,
cr.plugins_.Function,
cr.plugins_.Sprite,
cr.plugins_.SenaPlugin,
cr.plugins_.Sprite,
cr.plugins_.Text,
cr.plugins_.Touch,
cr.behaviors.Rex_MoveTo,
@@ -25785,6 +25785,7 @@ cr.getObjectRefTable = function () { return [
cr.behaviors.Fade,
cr.behaviors.lunarray_Tween,
cr.system_object.prototype.cnds.OnLayoutStart,
cr.plugins_.SenaPlugin.prototype.acts.Load,
cr.plugins_.Audio.prototype.acts.Play,
cr.plugins_.Text.prototype.acts.SetPos,
cr.plugins_.Sprite.prototype.exps.X,
@@ -25793,7 +25794,6 @@ cr.getObjectRefTable = function () { return [
cr.plugins_.Sprite.prototype.acts.SetAnimFrame,
cr.system_object.prototype.acts.Wait,
cr.plugins_.Sprite.prototype.acts.Destroy,
cr.plugins_.SenaPlugin.prototype.acts.Load,
cr.plugins_.SenaPlugin.prototype.cnds.OnLoad,
cr.plugins_.SenaPlugin.prototype.acts.Start,
cr.plugins_.SenaPlugin.prototype.cnds.OnStart,

File diff suppressed because one or more lines are too long

View File

@@ -81,7 +81,7 @@
<!-- Construct 2 exported games require jQuery. -->
<script src="jquery-3.4.1.min.js"></script>
<script src="tdv_sdk.js"></script>
<script src="sena_sdk.js"></script>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 376 KiB

After

Width:  |  Height:  |  Size: 352 KiB

View File

@@ -1,5 +1,5 @@
{
"version": 1771999605,
"version": 1772174207,
"fileList": [
"data.js",
"c2runtime.js",
@@ -34,8 +34,6 @@
"icon-128.png",
"icon-256.png",
"loading-logo.png",
"tdv_sdk.js",
"bg.mp4",
"sena_sdk.js"
]
}

View File

@@ -50,6 +50,7 @@ function SenaSDK(gid = "G2510S1T30") {
// 'preview' - Timeout 5s rồi fallback sample (testing với data thật)
// 'dev' - Load sample ngay lập tức (development)
this.mode = "preview"; // Default mode
this.role = "student"; // Default role
}
/**
@@ -118,6 +119,7 @@ SenaSDK.prototype.loadFromPostMessage = function (inputJson, callback) {
console.warn("⚠️ Sena SDK: tdv_sdk not found, storing data locally");
self.data = inputJson.data;
self.correctAnswer = inputJson.answer;
self._parseGameCode(); // Thêm dòng này để SDK đọc đuôi thời gian T30
if (callback) callback(true);
}
return true;
@@ -333,7 +335,7 @@ SenaSDK.prototype.getTotalQuestions = function () {
};
// Settings cho postMessage waiting
SenaSDK.prototype.POSTMESSAGE_TIMEOUT_MS = 3000; // 5 giây (chỉ dùng cho preview mode)
SenaSDK.prototype.POSTMESSAGE_TIMEOUT_MS = 1000; // 5 giây (chỉ dùng cho preview mode)
SenaSDK.prototype.load = function (callback, template = "G2510S1T30") {
let self = this;
@@ -373,9 +375,15 @@ SenaSDK.prototype.load = function (callback, template = "G2510S1T30") {
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(
"🎮 Sena SDK: Mode =",
self.mode.toUpperCase(),
"| Role =",
self.role || "student",
"| GameCode =",
self.gameCode,
);
@@ -1171,7 +1179,12 @@ SenaSDK.prototype.end = function (answer, callback) {
// -----------------------------------------------------------
// [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
console.log("🎮 Sena SDK: Time Limit Exceeded -> Result set to False");
}

Binary file not shown.

Binary file not shown.

Binary file not shown.