@@ -26020,10 +26020,10 @@ cr.getObjectRefTable = function () { return [
|
||||
cr.plugins_.Audio,
|
||||
cr.plugins_.Browser,
|
||||
cr.plugins_.Function,
|
||||
cr.plugins_.Sprite,
|
||||
cr.plugins_.SenaPlugin,
|
||||
cr.plugins_.Touch,
|
||||
cr.plugins_.Sprite,
|
||||
cr.plugins_.Text,
|
||||
cr.plugins_.Touch,
|
||||
cr.behaviors.Rex_MoveTo,
|
||||
cr.behaviors.Fade,
|
||||
cr.behaviors.DragnDrop,
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 168 B |
|
Before Width: | Height: | Size: 183 KiB |
|
Before Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 527 KiB |
|
Before Width: | Height: | Size: 530 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 155 B |
|
Before Width: | Height: | Size: 145 KiB |
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": 1772435608,
|
||||
"version": 1772438376,
|
||||
"fileList": [
|
||||
"data.js",
|
||||
"c2runtime.js",
|
||||
@@ -22,7 +22,6 @@
|
||||
"images/black-sheet0.png",
|
||||
"images/hint-sheet0.png",
|
||||
"images/imageframe-sheet0.png",
|
||||
"images/newwords-sheet0.png",
|
||||
"media/alert-234711.ogg",
|
||||
"media/bubble-pop-389501.ogg",
|
||||
"media/button-124476.ogg",
|
||||
|
||||
@@ -1087,7 +1087,7 @@ SenaSDK.prototype.canReloadData = function () {
|
||||
|
||||
/**
|
||||
* End the game and check answer
|
||||
* [UPDATE] Support Unordered Answers & Auto-cleanup empty strings
|
||||
* [UPDATE] Support Unordered Answers, Auto-cleanup empty strings & Post GAME_RESULT to FE
|
||||
*/
|
||||
SenaSDK.prototype.end = function (answer, callback) {
|
||||
let self = this;
|
||||
@@ -1217,11 +1217,25 @@ SenaSDK.prototype.end = function (answer, callback) {
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------
|
||||
// [BƯỚC 3] Log và Return
|
||||
// [BƯỚC 3] Log và Return (KÈM BẮN POST MESSAGE CHO FE)
|
||||
// -----------------------------------------------------------
|
||||
console.log(`Time spent: ${duration}s`);
|
||||
console.log(`Result: ${isCorrect ? "CORRECT" : "INCORRECT"}`);
|
||||
|
||||
// THÊM MỚI: Bắn tín hiệu GAME_RESULT lên cho hệ thống FE tính điểm
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "GAME_RESULT",
|
||||
payload: {
|
||||
game_id: self.gameID || self.gameCode,
|
||||
result: isCorrect ? "CORRECT" : "INCORRECT",
|
||||
time_spent: duration,
|
||||
},
|
||||
},
|
||||
"*",
|
||||
);
|
||||
console.log("📤 Sena SDK: GAME_RESULT sent successfully for Quiz/Sort/Fill");
|
||||
|
||||
if (callback) callback(result.isCorrect);
|
||||
return result; // Return full object for debug
|
||||
};
|
||||
|
||||