update them mockdata
All checks were successful
Deploy to Production / deploy (push) Successful in 8s
All checks were successful
Deploy to Production / deploy (push) Successful in 8s
This commit is contained in:
@@ -25772,8 +25772,8 @@ cr.getObjectRefTable = function () { return [
|
|||||||
cr.plugins_.Audio,
|
cr.plugins_.Audio,
|
||||||
cr.plugins_.Browser,
|
cr.plugins_.Browser,
|
||||||
cr.plugins_.Function,
|
cr.plugins_.Function,
|
||||||
cr.plugins_.Sprite,
|
|
||||||
cr.plugins_.SenaPlugin,
|
cr.plugins_.SenaPlugin,
|
||||||
|
cr.plugins_.Sprite,
|
||||||
cr.plugins_.Text,
|
cr.plugins_.Text,
|
||||||
cr.plugins_.Touch,
|
cr.plugins_.Touch,
|
||||||
cr.behaviors.Rex_MoveTo,
|
cr.behaviors.Rex_MoveTo,
|
||||||
@@ -25785,6 +25785,7 @@ cr.getObjectRefTable = function () { return [
|
|||||||
cr.behaviors.Fade,
|
cr.behaviors.Fade,
|
||||||
cr.behaviors.lunarray_Tween,
|
cr.behaviors.lunarray_Tween,
|
||||||
cr.system_object.prototype.cnds.OnLayoutStart,
|
cr.system_object.prototype.cnds.OnLayoutStart,
|
||||||
|
cr.plugins_.SenaPlugin.prototype.acts.Load,
|
||||||
cr.plugins_.Audio.prototype.acts.Play,
|
cr.plugins_.Audio.prototype.acts.Play,
|
||||||
cr.plugins_.Text.prototype.acts.SetPos,
|
cr.plugins_.Text.prototype.acts.SetPos,
|
||||||
cr.plugins_.Sprite.prototype.exps.X,
|
cr.plugins_.Sprite.prototype.exps.X,
|
||||||
@@ -25793,7 +25794,6 @@ cr.getObjectRefTable = function () { return [
|
|||||||
cr.plugins_.Sprite.prototype.acts.SetAnimFrame,
|
cr.plugins_.Sprite.prototype.acts.SetAnimFrame,
|
||||||
cr.system_object.prototype.acts.Wait,
|
cr.system_object.prototype.acts.Wait,
|
||||||
cr.plugins_.Sprite.prototype.acts.Destroy,
|
cr.plugins_.Sprite.prototype.acts.Destroy,
|
||||||
cr.plugins_.SenaPlugin.prototype.acts.Load,
|
|
||||||
cr.plugins_.SenaPlugin.prototype.cnds.OnLoad,
|
cr.plugins_.SenaPlugin.prototype.cnds.OnLoad,
|
||||||
cr.plugins_.SenaPlugin.prototype.acts.Start,
|
cr.plugins_.SenaPlugin.prototype.acts.Start,
|
||||||
cr.plugins_.SenaPlugin.prototype.cnds.OnStart,
|
cr.plugins_.SenaPlugin.prototype.cnds.OnStart,
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -81,7 +81,7 @@
|
|||||||
|
|
||||||
<!-- Construct 2 exported games require jQuery. -->
|
<!-- Construct 2 exported games require jQuery. -->
|
||||||
<script src="jquery-3.4.1.min.js"></script>
|
<script src="jquery-3.4.1.min.js"></script>
|
||||||
<script src="tdv_sdk.js"></script>
|
|
||||||
<script src="sena_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 |
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": 1771999605,
|
"version": 1772174207,
|
||||||
"fileList": [
|
"fileList": [
|
||||||
"data.js",
|
"data.js",
|
||||||
"c2runtime.js",
|
"c2runtime.js",
|
||||||
@@ -34,8 +34,6 @@
|
|||||||
"icon-128.png",
|
"icon-128.png",
|
||||||
"icon-256.png",
|
"icon-256.png",
|
||||||
"loading-logo.png",
|
"loading-logo.png",
|
||||||
"tdv_sdk.js",
|
|
||||||
"bg.mp4",
|
|
||||||
"sena_sdk.js"
|
"sena_sdk.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -118,6 +119,7 @@ SenaSDK.prototype.loadFromPostMessage = function (inputJson, callback) {
|
|||||||
console.warn("⚠️ Sena SDK: tdv_sdk not found, storing data locally");
|
console.warn("⚠️ Sena SDK: tdv_sdk not found, storing data locally");
|
||||||
self.data = inputJson.data;
|
self.data = inputJson.data;
|
||||||
self.correctAnswer = inputJson.answer;
|
self.correctAnswer = inputJson.answer;
|
||||||
|
self._parseGameCode(); // Thêm dòng này để SDK đọc đuôi thời gian T30
|
||||||
if (callback) callback(true);
|
if (callback) callback(true);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -333,7 +335,7 @@ SenaSDK.prototype.getTotalQuestions = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Settings cho postMessage waiting
|
// 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") {
|
SenaSDK.prototype.load = function (callback, template = "G2510S1T30") {
|
||||||
let self = this;
|
let self = this;
|
||||||
@@ -373,9 +375,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 +1179,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.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user