BIN
New-project/images/5sosarahtakesoff-sheet0.png
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
BIN
New-project/images/btn_check-sheet0.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
New-project/images/btn_music-sheet0.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
New-project/images/btn_music-sheet1.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
New-project/images/btn_pause-sheet0.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
New-project/images/btn_setting-sheet0.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
New-project/images/checker_wrong_correct-sheet0.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
New-project/images/checker_wrong_correct-sheet1.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
New-project/images/layer-sheet0.png
Normal file
|
After Width: | Height: | Size: 109 KiB |
BIN
New-project/images/newwordpng-sheet0.png
Normal file
|
After Width: | Height: | Size: 162 KiB |
BIN
New-project/images/panel-sheet0.png
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
New-project/images/panel_pause-sheet0.png
Normal file
|
After Width: | Height: | Size: 168 B |
|
Before Width: | Height: | Size: 155 B After Width: | Height: | Size: 155 B |
BIN
New-project/images/senaaikhoi-sheet0.png
Normal file
|
After Width: | Height: | Size: 225 KiB |
BIN
New-project/images/slot-sheet0.png
Normal file
|
After Width: | Height: | Size: 35 KiB |
BIN
New-project/images/txt_question.png
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
New-project/images/txt_texttimer.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
BIN
New-project/images/txt_worditem.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
@@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
<!-- The canvas the project will render to. If you change its ID, don't forget to change the
|
<!-- The canvas the project will render to. If you change its ID, don't forget to change the
|
||||||
ID the runtime looks for in the jQuery events above (ready() and cr_sizeCanvas()). -->
|
ID the runtime looks for in the jQuery events above (ready() and cr_sizeCanvas()). -->
|
||||||
<canvas id="c2canvas" width="854" height="480">
|
<canvas id="c2canvas" width="1200" height="1200">
|
||||||
<!-- This text is displayed if the visitor's browser does not support HTML5.
|
<!-- This text is displayed if the visitor's browser does not support HTML5.
|
||||||
You can change it, but it is a good idea to link to a description of a browser
|
You can change it, but it is a good idea to link to a description of a browser
|
||||||
and provide some links to download some popular HTML5-compatible browsers. -->
|
and provide some links to download some popular HTML5-compatible browsers. -->
|
||||||
|
|||||||
BIN
New-project/media/click.ogg
Normal file
BIN
New-project/media/correct.ogg
Normal file
BIN
New-project/media/error-010-206498.ogg
Normal file
BIN
New-project/media/immersivecontrol-button-click-sound-463065.ogg
Normal file
@@ -1,18 +1,40 @@
|
|||||||
{
|
{
|
||||||
"version": 1769247218,
|
"version": 1769506337,
|
||||||
"fileList": [
|
"fileList": [
|
||||||
"data.js",
|
"data.js",
|
||||||
"c2runtime.js",
|
"c2runtime.js",
|
||||||
"jquery-3.4.1.min.js",
|
"jquery-3.4.1.min.js",
|
||||||
"offlineClient.js",
|
"offlineClient.js",
|
||||||
"images/correct-sheet0.png",
|
"images/btn_check-sheet0.png",
|
||||||
"images/wrong-sheet0.png",
|
"images/wrong-sheet0.png",
|
||||||
|
"images/pause-sheet0.png",
|
||||||
|
"images/slot-sheet0.png",
|
||||||
|
"images/txt_texttimer.png",
|
||||||
|
"images/txt_worditem.png",
|
||||||
|
"images/5sosarahtakesoff-sheet0.png",
|
||||||
|
"images/senaaikhoi-sheet0.png",
|
||||||
|
"images/checker_wrong_correct-sheet0.png",
|
||||||
|
"images/checker_wrong_correct-sheet1.png",
|
||||||
|
"images/btn_setting-sheet0.png",
|
||||||
|
"images/panel-sheet0.png",
|
||||||
|
"images/txt_question.png",
|
||||||
|
"images/btn_pause-sheet0.png",
|
||||||
|
"images/btn_music-sheet0.png",
|
||||||
|
"images/btn_music-sheet1.png",
|
||||||
|
"images/panel_pause-sheet0.png",
|
||||||
|
"images/layer-sheet0.png",
|
||||||
|
"images/newwordpng-sheet0.png",
|
||||||
|
"media/click.ogg",
|
||||||
|
"media/correct.ogg",
|
||||||
|
"media/error-010-206498.ogg",
|
||||||
|
"media/immersivecontrol-button-click-sound-463065.ogg",
|
||||||
"icon-16.png",
|
"icon-16.png",
|
||||||
"icon-32.png",
|
"icon-32.png",
|
||||||
"icon-114.png",
|
"icon-114.png",
|
||||||
"icon-128.png",
|
"icon-128.png",
|
||||||
"icon-256.png",
|
"icon-256.png",
|
||||||
"loading-logo.png",
|
"loading-logo.png",
|
||||||
|
"tdv_sdk.js",
|
||||||
"sena_sdk.js"
|
"sena_sdk.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -3,11 +3,11 @@
|
|||||||
* @param {Object} config - Configuration object for the SDK
|
* @param {Object} config - Configuration object for the SDK
|
||||||
* @param {Object} config.data - Quiz data containing question, options, and answer
|
* @param {Object} config.data - Quiz data containing question, options, and answer
|
||||||
*/
|
*/
|
||||||
function SenaSDK(gid = 'G2510S1T30') {
|
function SenaSDK(gid) {
|
||||||
// Initialize data
|
// Initialize data
|
||||||
this.data = null;
|
this.data = null;
|
||||||
this.correctAnswer = null;
|
this.correctAnswer = null;
|
||||||
this.gameCode = gid;
|
this.gameCode = gid || window.SENA_GAME_CODE || 'G2510S1T30';
|
||||||
// Initialize properties
|
// Initialize properties
|
||||||
this.timeLimit = 0;
|
this.timeLimit = 0;
|
||||||
this.shuffle = true;
|
this.shuffle = true;
|
||||||
@@ -35,14 +35,10 @@ SenaSDK.prototype.shuffleArray = function(array) {
|
|||||||
[array[i], array[j]] = [array[j], array[i]];
|
[array[i], array[j]] = [array[j], array[i]];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
SenaSDK.prototype.load = function(callback,template = 'G2510S1T30') {
|
SenaSDK.prototype.load = function(callback,template) {
|
||||||
let self = this;
|
let self = this;
|
||||||
// get parameter LID from URL
|
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
self.gameCode = self.gameCode || window.SENA_GAME_CODE || template;
|
||||||
const LID = urlParams.get('LID');
|
|
||||||
if (LID) {
|
|
||||||
self.gameCode = LID;
|
|
||||||
};
|
|
||||||
fetch(`https://senaai.tech/sample/${self.gameCode}.json`)
|
fetch(`https://senaai.tech/sample/${self.gameCode}.json`)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
|||||||
25
New-project/tdv_sdk.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
(function () {
|
||||||
|
// Default game code
|
||||||
|
var DEFAULT_GAME_CODE = 'G2510S1T30';
|
||||||
|
|
||||||
|
var gameCode = DEFAULT_GAME_CODE;
|
||||||
|
|
||||||
|
// 1️⃣ Trường hợp: ?gid=G2510S1T30
|
||||||
|
var params = new URLSearchParams(window.location.search);
|
||||||
|
if (params.has('gid')) {
|
||||||
|
gameCode = params.get('gid');
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2️⃣ Trường hợp: ?G2510S1T30 (không key)
|
||||||
|
else if (window.location.search.length > 1) {
|
||||||
|
var raw = window.location.search.substring(1);
|
||||||
|
if (/^G\d+/.test(raw)) {
|
||||||
|
gameCode = raw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Expose globally
|
||||||
|
window.SENA_GAME_CODE = gameCode;
|
||||||
|
|
||||||
|
console.log('[SENA] Game code detected:', gameCode);
|
||||||
|
})();
|
||||||