diff --git a/definition_spelling_sequence_sentence/appmanifest.json b/definition_spelling_sequence_sentence/appmanifest.json index 3824f32..e0dea54 100644 --- a/definition_spelling_sequence_sentence/appmanifest.json +++ b/definition_spelling_sequence_sentence/appmanifest.json @@ -1,6 +1,6 @@ { - "name": "Sequence", - "short_name": "Sequence", + "name": "definition_spelling_sequence_sentence", + "short_name": "definition_spelling_sequence_sentence", "start_url": "index.html", "display": "fullscreen", "orientation": "any", diff --git a/definition_spelling_sequence_sentence/c2runtime.js b/definition_spelling_sequence_sentence/c2runtime.js index 55e5b44..2902e4d 100644 --- a/definition_spelling_sequence_sentence/c2runtime.js +++ b/definition_spelling_sequence_sentence/c2runtime.js @@ -19321,373 +19321,1111 @@ cr.plugins_.Function = function(runtime) }()); ; ; -cr.plugins_.SenaPlugin = function (runtime) { +cr.plugins_.JSON = function(runtime) +{ this.runtime = runtime; + this.references = {}; }; -(function () { - var pluginProto = cr.plugins_.SenaPlugin.prototype; - pluginProto.Type = function (plugin) { +(function () +{ + /*! (C) WebReflection Mit Style License */ + var CircularJSON=function(e,t){function l(e,t,o){var u=[],f=[e],l=[e],c=[o?n:"[Circular]"],h=e,p=1,d;return function(e,v){return t&&(v=t.call(this,e,v)),e!==""&&(h!==this&&(d=p-a.call(f,this)-1,p-=d,f.splice(p,f.length),u.splice(p-1,u.length),h=this),typeof v=="object"&&v?(a.call(f,v)<0&&f.push(h=v),p=f.length,d=a.call(l,v),d<0?(d=l.push(v)-1,o?(u.push((""+e).replace(s,r)),c[d]=n+u.join(n)):c[d]=c[0]):v=c[d]):typeof v=="string"&&o&&(v=v.replace(r,i).replace(n,r))),v}}function c(e,t){for(var r=0,i=t.length;r 0) { - for (var i = 0; i < count; i += rowBreak) { - rows.push(Math.min(rowBreak, count - i)); - } - } else { - if (count <= 5) { - rows.push(count); + if (path_.length === 0) { + deleteIfValid(this.data,ROOT_KEY); } else { - var top = Math.ceil((count + 1) / 2); - var bottom = count - top; - rows.push(top); - rows.push(bottom); + deleteIfValid( + this.getValueFromPath( + false, + path_.slice(0,path_.length-1) // go through all property but the last one + ), + path_[path_.length-1] + ); } - } - var baseY = 0; - if (type === "word") { - baseY = rowGap * rows.length; // word luôn nằm dưới slot - } - var index = 0; - for (var r = 0; r < rows.length; r++) { - var itemsInRow = rows[r]; - var rowWidth = itemsInRow * objectWidth + (itemsInRow - 1) * margin; - var startX = (maxWidth - rowWidth) / 2; - for (var i = 0; i < itemsInRow; i++) { - this.calculatedPositions.push({ - x: startX + i * (objectWidth + margin) + objectWidth / 2, - y: baseY + r * rowGap - }); - index++; + }; + Acts.prototype.Clear = function (from_current,path) + { + var path_; + if(from_current) { + path_ = this.curPath.concat(path); + } else { + path_ = path; } - } -}; + function clearIfValid(obj,prop) { + if ( obj !== undefined && obj !== null && + (typeof obj === "object")){ + var t = type(obj[prop]); + if(t === "array") { + obj[prop].length = 0; + } else if (t === "object") { + for (var p in obj[prop]){ + if (Object.prototype.hasOwnProperty.call(obj[prop],p)) { + delete obj[prop][p]; + } + } + } else { + delete obj[prop]; // in this case it's working like Delete + } + } else { + logInvalidPath(path_); + } + } + if (path_.length === 0) { + clearIfValid(this.data,ROOT_KEY); + } else { + clearIfValid( + this.getValueFromPath( + false, + path_.slice(0,path_.length-1) // go through all property but the last one + ), + path_[path_.length-1] + ); + } + }; + instanceProto.LoadJSON = function(json,from_current,path) { + try { + this.setValueFromPath(from_current,path,CircularJSON.parse(json)); + } catch (e) { + console.warn("LoadJSON error:",e); + this.runtime.trigger(cr.plugins_.JSON.prototype.cnds.OnJSONParseError, this); + } + }; + Acts.prototype.LoadJSON = function (json,from_current,path) + { + this.LoadJSON(json,from_current,path); + }; + Acts.prototype.LogData = function () + { + var grouping = console.groupCollapsed !== undefined && console.groupEnd !== undefined; + if(grouping) { + console.groupCollapsed(ROOT_KEY+":"); + console.log(CircularJSON.stringify(this.data[ROOT_KEY],null,2)); + console.groupEnd(); + } else { + console.log(ROOT_KEY+":",CircularJSON.stringify(this.data[ROOT_KEY],null,2)); + } + console.log("Current Path:", CircularJSON.stringify(this.curPath)); + if (grouping) { + console.group("References:"); + } else { + console.log("References:"); + } + var ref = this.type.plugin.references; + for (var name in ref) { + if (Object.prototype.hasOwnProperty.call(ref,name)) { + if(grouping) { + console.groupCollapsed(name); + console.log(CircularJSON.stringify(ref[name].value,null,2)); + console.groupEnd(); + } else { + console.log("["+name+"]",CircularJSON.stringify(ref[name].value,null,2)); + } + } + } + if (grouping) { + console.groupEnd(); + } + console.log(""); // just a blank line for clarity + }; + Acts.prototype.SetCurrentPath = function(from_current,path) { + if(from_current) { + this.curPath = this.curPath.concat(path); + } else { + this.curPath = path.slice(); + } + }; + Acts.prototype.PushPathNode = function(node) { + this.curPath.push(node); + }; + Acts.prototype.PopPathNode = function() { + this.curPath.pop(); + }; + Acts.prototype.SaveReference = function(name,from_current,path) { + this.type.plugin.references[name] = { + value: this.getValueFromPath(from_current===1, path), + origin: this + }; + }; + Acts.prototype.LoadReference = function(name,from_current,path) { + this.setValueFromPath(from_current===1,path,this.type.plugin.references[name].value); + }; + Acts.prototype.DeleteReference = function(name) { + delete this.type.plugin.references[name]; + }; + Acts.prototype.DeleteAllReferences = function(name) { + this.type.plugin.references = {}; + }; pluginProto.acts = new Acts(); - function Exps() { - }; - Exps.prototype.getQuestionValue = function (ret) { - if (this.sdk) { - ret.set_string(this.sdk.getQuestionValue() || ""); - } else { - ret.set_string(""); - } - }; - Exps.prototype.getQuestionType = function (ret) { - if (this.sdk) { - ret.set_string(this.sdk.getQuestionType() || "text"); - } else { - ret.set_string("text"); - } - }; - Exps.prototype.getRequestValue = function (ret) { - if (this.sdk) { - ret.set_string(this.sdk.getRequestValue() || ""); - } else { - ret.set_string(""); - } - }; - Exps.prototype.getRequestType = function (ret) { - if (this.sdk) { - ret.set_string(this.sdk.getRequestType() || "text"); - } else { - ret.set_string("text"); - } - }; - Exps.prototype.getOptionsCount = function (ret) { - if (this.sdk) { - ret.set_int(this.sdk.getOptionsCount() || 0); - } else { - ret.set_int(0); - } - }; - Exps.prototype.getOptionsType = function (ret) { - if (this.sdk) { - ret.set_string(this.sdk.getOptionsType() || "text"); - } else { - ret.set_string("text"); - } - }; - Exps.prototype.getOptionsValue = function (ret, index) { - if (this.sdk) { - var value = this.sdk.getOptionsValue(index); - if (value && typeof value === 'object') { - ret.set_string(JSON.stringify(value)); - } else { - ret.set_string(value || ""); + function Exps() {} + Exps.prototype.Size = function (ret) + { + var path = Array.prototype.slice.call(arguments); + path.shift(); // ret + var from_current = path.shift(); + var value = this.getValueFromPath(from_current===1,path); + var t = type(value); + if (t === "array") { + ret.set_int(value.length); + } else if (t === "object") { + var size = 0; + for (var p in value) + { + if (Object.prototype.hasOwnProperty.call(value,p)) { + size++; + } } + ret.set_int(size); } else { - ret.set_string(""); + ret.set_int(-1); } }; - Exps.prototype.getHintType = function (ret) { - if (this.sdk) { - ret.set_string(this.sdk.getHintType() || ""); + Exps.prototype.Value = function (ret) + { + var path = Array.prototype.slice.call(arguments); + path.shift(); + var from_current = path.shift(); + var value = this.getValueFromPath(from_current===1,path); + var t = type(value); + if (t === "number" || t === "string") { + ret.set_any(value); + } else if (t === "boolean") { + ret.set_any((value) ? 1 : 0); } else { - ret.set_string(""); + ret.set_any(t); } }; - Exps.prototype.getHintCount = function (ret) { - if (this.sdk) { - ret.set_int(this.sdk.getHintCount() || 0); + Exps.prototype.AsJson = function (ret) + { + var path = Array.prototype.slice.call(arguments); + path.shift(); + var from_current = path.shift(); + var value = this.getValueFromPath(from_current===1,path); + var t = type(value); + if(t === "undefined") { + ret.set_string(t); } else { - ret.set_int(0); + ret.set_string(CircularJSON.stringify(value)); } }; - Exps.prototype.getHintValue = function (ret, index) { - if (this.sdk) { - var value = this.sdk.getHintValue(index); - if (value === null) { - ret.set_string(""); - } else if (typeof value === 'object') { - ret.set_string(JSON.stringify(value)); - } else { - ret.set_string(value.toString()); - } + Exps.prototype.TypeOf = function (ret) + { + var path = Array.prototype.slice.call(arguments); + path.shift(); + var from_current = path.shift(); + var value = this.getValueFromPath(from_current===1,path); + ret.set_string(type(value)); + }; + Exps.prototype.CurrentKey = function (ret) + { + ret.set_string(this.curKey); + }; + Exps.prototype.CurrentValue = function (ret) + { + var value = this.curValue; + var t = type(value); + if (t === "number" || t === "string") { + ret.set_any(value); + } else if (t === "boolean") { + ret.set_any((value) ? 1 : 0); } else { - ret.set_string(""); + ret.set_any(t); } }; - Exps.prototype.getTimeLimit = function (ret) { - if (this.sdk) { - ret.set_int(this.sdk.timeLimit || 0); - } else { - ret.set_int(0); - } - }; - Exps.prototype.getShuffle = function (ret) { - if (this.sdk) { - ret.set_int(this.sdk.shuffle ? 1 : 0); - } else { - ret.set_int(1); - } - }; - Exps.prototype.getGameCode = function (ret) { - if (this.sdk) { - ret.set_string(this.sdk.gameCode || ""); - } else { - ret.set_string(""); - } - }; - Exps.prototype.getGuide = function (ret) { - if (this.sdk && this.sdk.guide) { - ret.set_string(this.sdk.guide() || ""); - } else { - ret.set_string(""); - } - }; - Exps.prototype.isVoicePlaying = function (ret) { - if (this.sdk && this.sdk.isSpeaking) { - ret.set_int(this.sdk.isSpeaking() ? 1 : 0); - } else { - ret.set_int(0); - } - }; - Exps.prototype.isMusicPlaying = function (ret) { - ret.set_int(this.bgMusicPlaying ? 1 : 0); - }; - Exps.prototype.isMusicPaused = function (ret) { - ret.set_int(this.bgMusicPaused ? 1 : 0); - }; - Exps.prototype.isGamePaused = function (ret) { - ret.set_int(this.isPaused ? 1 : 0); - }; - Exps.prototype.getElapsedTime = function (ret) { - if (this.sdk && this.sdk.startTime) { - var elapsed = (Date.now() - this.sdk.startTime - this.totalPausedTime) / 1000; - if (this.isPaused) { - elapsed -= (Date.now() - this.pauseTime) / 1000; - } - ret.set_float(Math.max(0, elapsed)); - } else { - ret.set_float(0); - } - }; - Exps.prototype.getPosXbyIndex = function (ret, index) { - if (this.calculatedPositions[index]) { - ret.set_float(this.calculatedPositions[index].x); - } else { - ret.set_float(0); - } -}; -Exps.prototype.getPosYbyIndex = function (ret, index) { - if (this.calculatedPositions[index]) { - ret.set_float(this.calculatedPositions[index].y); - } else { - ret.set_float(0); - } -}; pluginProto.exps = new Exps(); }()); ; ; +cr.plugins_.SenaPlugin = function (runtime) { + this.runtime = runtime; +}; +(function () { + var pluginProto = cr.plugins_.SenaPlugin.prototype; + pluginProto.Type = function (plugin) { + this.plugin = plugin; + this.runtime = plugin.runtime; + }; + var typeProto = pluginProto.Type.prototype; + typeProto.onCreate = function () {}; + pluginProto.Instance = function (type) { + this.type = type; + this.runtime = type.runtime; + }; + var instanceProto = pluginProto.Instance.prototype; + instanceProto.onCreate = function () { + console.log("🔥 LOAD CALLBACK FIRED"); + window["SenaTrigger"] = this; + this.widthArray = []; + this.slotInstances = []; + this.slotPositions = []; + this.sdk = null; + this.isPaused = false; + this.pauseTime = 0; + this.totalPausedTime = 0; + this.bgMusic = null; + this.bgMusicPlaying = false; + this.bgMusicPaused = false; + this.calculatedPositions = []; + this.customData = { + data1: "", + data2: "", + data3: "", + data4: "", + data5: "" + }; + this.lastMessageData = null; + this.lastSenderUUID = ""; + }; + instanceProto.onDestroy = function () { + if (this.sdk) { + this.sdk.destroy(); + } + if (this.bgMusic) { + this.bgMusic.pause(); + this.bgMusic = null; + } + }; + function Cnds() {} + Cnds.prototype.OnLoad = function () { + return true; + }; + Cnds.prototype.OnStart = function () { + return true; + }; + Cnds.prototype.OnCorrect = function () { + return true; + }; + Cnds.prototype.OnWrong = function () { + return true; + }; + Cnds.prototype.OnPause = function () { + return true; + }; + Cnds.prototype.OnResume = function () { + return true; + }; + Cnds.prototype.OnPairCorrect = function () { + return true; + }; + Cnds.prototype.OnPairWrong = function () { + return true; + }; + Cnds.prototype.OnMessage = function () { + return true; + }; + Cnds.prototype.OnWordLayoutFinished = function () { + return true; + }; + Cnds.prototype.OnSlotLayoutFinished = function () { + return true; + }; + Cnds.prototype.OnSlotLayoutFinished2 = function () { + return true; +}; + pluginProto.cnds = new Cnds(); + function Acts() {} +Acts.prototype.Load = function () { + if (this.sdk) { + console.warn("SDK already initialized"); + return; + } + if (this.isLoading) { + console.warn("SDK is loading..."); + return; + } + this.isLoading = true; + var self = this; + var gameCode = this.properties[0] || "G2510S1T30"; + if (window["SenaSDK"]) { + this.sdk = new window["SenaSDK"](gameCode); + this.sdk.onCustomMessage = function (data, senderUuid) { + self.lastMessageData = data; + self.lastSenderUUID = senderUuid; + self.runtime.trigger( + cr.plugins_.SenaPlugin.prototype.cnds.OnMessage, + self + ); + }; + this.sdk.load(function (success) { + self.isLoading = false; + if (success) { + console.log("SDK loaded successfully"); + self.runtime.trigger( + cr.plugins_.SenaPlugin.prototype.cnds.OnLoad, + self + ); + } else { + console.error("Failed to load SDK data"); + } + }, gameCode); + } else { + console.error("SenaSDK not found"); + this.isLoading = false; + } +}; +Acts.prototype.SetObjectWidth = function (index, width) { + if (!this.widthArray) { + this.widthArray = []; + } + this.widthArray[index] = width; +}; + Acts.prototype.Start = function () { + var self = this; + if (self.sdk) { + self.sdk.start(); + console.log("Game started"); + window["SenaTrigger"].runtime.trigger( + cr.plugins_.SenaPlugin.prototype.cnds.OnStart, + window["SenaTrigger"], + ); + } + }; + Acts.prototype.Finish = function (answer) { + var self = this; + if (this.sdk) { + this.sdk.end(answer, function (isCorrect) { + if (isCorrect) { + window["SenaTrigger"].runtime.trigger( + cr.plugins_.SenaPlugin.prototype.cnds.OnCorrect, + window["SenaTrigger"], + ); + } else { + window["SenaTrigger"].runtime.trigger( + cr.plugins_.SenaPlugin.prototype.cnds.OnWrong, + window["SenaTrigger"], + ); + } + }); + } + }; + Acts.prototype.PlayVoice = function (type) { + var self = this; + if (this.sdk && this.sdk.playVoice) { + this.sdk.playVoice(type); + } + }; + Acts.prototype.StopVoice = function () { + var self = this; + if (this.sdk && this.sdk.stopSound) { + this.sdk.stopSound(); + } + }; + Acts.prototype.PlayBGMusic = function () { + var self = this; + if (this.bgMusic) { + this.bgMusic.play(); + this.bgMusicPlaying = true; + this.bgMusicPaused = false; + } + }; + Acts.prototype.StopBGMusic = function () { + var self = this; + if (this.bgMusic) { + this.bgMusic.pause(); + this.bgMusic.currentTime = 0; + this.bgMusicPlaying = false; + this.bgMusicPaused = false; + } + }; + Acts.prototype.PauseBGMusic = function () { + var self = this; + if (this.bgMusic && this.bgMusicPlaying) { + this.bgMusic.pause(); + this.bgMusicPaused = true; + } + }; + Acts.prototype.ResumeBGMusic = function () { + var self = this; + if (this.bgMusic && this.bgMusicPaused) { + this.bgMusic.play(); + this.bgMusicPaused = false; + } + }; + Acts.prototype.PauseGame = function () { + var self = this; + if (!this.isPaused) { + this.isPaused = true; + this.pauseTime = Date.now(); + window["SenaTrigger"].runtime.trigger( + cr.plugins_.SenaPlugin.prototype.cnds.OnPause, + window["SenaTrigger"], + ); + } + }; + Acts.prototype.ResumeGame = function () { + var self = this; + if (this.isPaused) { + this.isPaused = false; + this.totalPausedTime += Date.now() - this.pauseTime; + window["SenaTrigger"].runtime.trigger( + cr.plugins_.SenaPlugin.prototype.cnds.OnResume, + window["SenaTrigger"], + ); + } + }; + Acts.prototype.ResetGame = function () { + var self = this; + if (this.sdk && this.sdk.reset) { + this.sdk.reset(); + this.isPaused = false; + this.pauseTime = 0; + this.totalPausedTime = 0; + } + }; +Acts.prototype.CalcObjectPositions = function ( + count, + objectWidth, + margin, + maxWidth, + rowBreak, + rowGap, + type, + groupGap +) { + var widthArray = this.widthArray || []; + if (!widthArray.length) { + console.warn("widthArray empty, fallback to objectWidth"); + widthArray = new Array(count).fill(objectWidth); + } + this.calculatedPositions = []; + if (count <= 0) { + this.runtime.trigger( + cr.plugins_.SenaPlugin.prototype.cnds.OnCalculateFinished, + this + ); + return; + } + var rows = []; + if (rowBreak > 0) { + for (var i = 0; i < count; i += rowBreak) { + rows.push(Math.min(rowBreak, count - i)); + } + } else { + if (count <= 5) { + rows.push(count); + } else { + var top = Math.ceil((count + 1) / 2); + var bottom = count - top; + rows.push(top); + rows.push(bottom); + } + } + var baseY = 0; + if (type === "word") { + baseY = groupGap || (rowGap * rows.length); + } + var index = 0; + for (var r = 0; r < rows.length; r++) { + var itemsInRow = rows[r]; + var rowWidth = 0; + for (var i = 0; i < itemsInRow; i++) { + rowWidth += widthArray[index + i] || objectWidth; + } + rowWidth += (itemsInRow - 1) * margin; + var startX = (maxWidth - rowWidth) / 2; + var currentX = startX; + for (var i = 0; i < itemsInRow; i++) { + var w = widthArray[index] || objectWidth; + this.calculatedPositions.push({ + x: currentX + w / 2, + y: baseY + r * rowGap + }); + currentX += w + margin; + index++; + } + } + console.log("Calculated positions:", this.calculatedPositions); + if (type === "word") { + this.runtime.trigger( + cr.plugins_.SenaPlugin.prototype.cnds.OnWordLayoutFinished, + this + ); + } else if (type === "slot") { + this.runtime.trigger( + cr.plugins_.SenaPlugin.prototype.cnds.OnSlotLayoutFinished, + this + ); + } + else if (type === "slot2") { + this.runtime.trigger( + cr.plugins_.SenaPlugin.prototype.cnds.OnSlotLayoutFinished2, + this + ); + } +}; + Acts.prototype.LoadLevelG5 = function (levelIndex) { + if (this.sdk && this.sdk.loadLevelG5) { + this.sdk.loadLevelG5(levelIndex); + } + }; + Acts.prototype.CheckPair = function (idx1, idx2) { + var self = this; + if (this.sdk && this.sdk.checkPair) { + this.sdk.checkPair(idx1, idx2, function (isMatch) { + if (isMatch) { + window["SenaTrigger"].runtime.trigger( + cr.plugins_.SenaPlugin.prototype.cnds.OnPairCorrect, + window["SenaTrigger"], + ); + } else { + window["SenaTrigger"].runtime.trigger( + cr.plugins_.SenaPlugin.prototype.cnds.OnPairWrong, + window["SenaTrigger"], + ); + } + }); + } + }; + Acts.prototype.SetData = function (data1, data2, data3, data4, data5) { + this.customData.data1 = data1 || ""; + this.customData.data2 = data2 || ""; + this.customData.data3 = data3 || ""; + this.customData.data4 = data4 || ""; + this.customData.data5 = data5 || ""; + console.log('Custom data set:', this.customData); + }; + Acts.prototype.PostMessage = function () { + if (this.sdk && this.sdk.sendMessageToParent) { + var dataToSend = { + data1: this.customData.data1, + data2: this.customData.data2, + data3: this.customData.data3, + data4: this.customData.data4, + data5: this.customData.data5 + }; + this.sdk.sendMessageToParent(dataToSend); + console.log('Posted message to parent:', dataToSend); + } else { + console.error('SDK not initialized or sendMessageToParent not available'); + } + }; + pluginProto.acts = new Acts(); + function Exps() {} + Exps.prototype.getObjectWidthByIndex = function (ret, index) { + if (!this.runtime) { + ret.set_float(0); + return; + } + var instances = this.runtime.getCurrentEventStack().current_event.solModifiers; + if (!instances) { + ret.set_float(0); + return; + } + if (this.widthArray && this.widthArray[index] !== undefined) { + ret.set_float(this.widthArray[index]); + } else { + ret.set_float(0); + } + }; + Exps.prototype.getQuestionValue = function (ret) { + if (this.sdk) { + ret.set_string(this.sdk.getQuestionValue() || ""); + } else { + ret.set_string(""); + } + }; + Exps.prototype.getQuestionType = function (ret) { + if (this.sdk) { + ret.set_string(this.sdk.getQuestionType() || "text"); + } else { + ret.set_string("text"); + } + }; + Exps.prototype.getRequestValue = function (ret) { + if (this.sdk) { + ret.set_string(this.sdk.getRequestValue() || ""); + } else { + ret.set_string(""); + } + }; + Exps.prototype.getRequestType = function (ret) { + if (this.sdk) { + ret.set_string(this.sdk.getRequestType() || "text"); + } else { + ret.set_string("text"); + } + }; + Exps.prototype.getOptionsCount = function (ret) { + if (this.sdk) { + ret.set_int(this.sdk.getOptionsCount() || 0); + } else { + ret.set_int(0); + } + }; + Exps.prototype.getOptionsType = function (ret) { + if (this.sdk) { + ret.set_string(this.sdk.getOptionsType() || "text"); + } else { + ret.set_string("text"); + } + }; + Exps.prototype.getOptionsValue = function (ret, index) { + if (this.sdk) { + var value = this.sdk.getOptionsValue(index); + if (value && typeof value === "object") { + ret.set_string(JSON.stringify(value)); + } else { + ret.set_string(value || ""); + } + } else { + ret.set_string(""); + } + }; + Exps.prototype.getHintType = function (ret) { + if (this.sdk) { + ret.set_string(this.sdk.getHintType() || ""); + } else { + ret.set_string(""); + } + }; + Exps.prototype.getHintCount = function (ret) { + if (this.sdk) { + ret.set_int(this.sdk.getHintCount() || 0); + } else { + ret.set_int(0); + } + }; + Exps.prototype.getHintValue = function (ret, index) { + if (this.sdk) { + var value = this.sdk.getHintValue(index); + if (value === null) { + ret.set_string(""); + } else if (typeof value === "object") { + ret.set_string(JSON.stringify(value)); + } else { + ret.set_string(value.toString()); + } + } else { + ret.set_string(""); + } + }; + Exps.prototype.getTimeLimit = function (ret) { + if (this.sdk) { + ret.set_int(this.sdk.timeLimit || 0); + } else { + ret.set_int(0); + } + }; + Exps.prototype.getShuffle = function (ret) { + if (this.sdk) { + ret.set_int(this.sdk.shuffle ? 1 : 0); + } else { + ret.set_int(1); + } + }; + Exps.prototype.getGameCode = function (ret) { + if (this.sdk) { + ret.set_string(this.sdk.gameCode || ""); + } else { + ret.set_string(""); + } + }; + Exps.prototype.getGuide = function (ret) { + if (this.sdk && this.sdk.guide) { + ret.set_string(this.sdk.guide() || ""); + } else { + ret.set_string(""); + } + }; + Exps.prototype.isVoicePlaying = function (ret) { + if (this.sdk && this.sdk.isSpeaking) { + ret.set_int(this.sdk.isSpeaking() ? 1 : 0); + } else { + ret.set_int(0); + } + }; + Exps.prototype.isMusicPlaying = function (ret) { + ret.set_int(this.bgMusicPlaying ? 1 : 0); + }; + Exps.prototype.isMusicPaused = function (ret) { + ret.set_int(this.bgMusicPaused ? 1 : 0); + }; + Exps.prototype.isGamePaused = function (ret) { + ret.set_int(this.isPaused ? 1 : 0); + }; + Exps.prototype.getElapsedTime = function (ret) { + if (this.sdk && this.sdk.startTime) { + var elapsed = + (Date.now() - this.sdk.startTime - this.totalPausedTime) / 1000; + if (this.isPaused) { + elapsed -= (Date.now() - this.pauseTime) / 1000; + } + ret.set_float(Math.max(0, elapsed)); + } else { + ret.set_float(0); + } + }; + Exps.prototype.getPosXbyIndex = function (ret, index) { + if (this.calculatedPositions[index]) { + ret.set_float(this.calculatedPositions[index].x); + } else { + ret.set_float(0); + } + }; + Exps.prototype.getPosYbyIndex = function (ret, index) { + if (this.calculatedPositions[index]) { + ret.set_float(this.calculatedPositions[index].y); + } else { + ret.set_float(0); + } + }; + Exps.prototype.getTargetName = function (ret) { + if (this.sdk && this.sdk.getTargetName) { + ret.set_string(this.sdk.getTargetName() || ""); + } else { + ret.set_string(""); + } + }; + Exps.prototype.getCardName = function (ret, index) { + if (this.sdk && this.sdk.getCardName) { + ret.set_string(this.sdk.getCardName(index) || ""); + } else { + ret.set_string(""); + } + }; + Exps.prototype.getCardImage = function (ret, index) { + if (this.sdk && this.sdk.getCardImage) { + ret.set_string(this.sdk.getCardImage(index) || ""); + } else { + ret.set_string(""); + } + }; + Exps.prototype.getCardAudio = function (ret, index) { + if (this.sdk && this.sdk.getCardAudio) { + ret.set_string(this.sdk.getCardAudio(index) || ""); + } else { + ret.set_string(""); + } + }; + Exps.prototype.getQuestionImage = function (ret) { + if (this.sdk && this.sdk.getQuestionImage) { + ret.set_string(this.sdk.getQuestionImage() || ""); + } else { + ret.set_string(""); + } + }; + Exps.prototype.getTimePerCard = function (ret) { + if (this.sdk && this.sdk.getTimePerCard) { + ret.set_int(this.sdk.getTimePerCard()); + } else { + ret.set_int(0); + } + }; + Exps.prototype.getTotalLevels = function (ret) { + if (this.sdk && this.sdk.getTotalLevels) { + ret.set_int(this.sdk.getTotalLevels()); + } else { + ret.set_int(1); + } + }; + Exps.prototype.getCurrentLevel = function (ret) { + if (this.sdk) { + ret.set_int(this.sdk.currentLevel || 1); + } else { + ret.set_int(1); + } + }; + Exps.prototype.GetCardType = function (ret, index) { + if (this.sdk && this.sdk.getCardType) { + ret.set_string(this.sdk.getCardType(index)); + } else { + ret.set_string(""); + } + }; + Exps.prototype.getCardID = function (ret, index) { + if (this.sdk && this.sdk.getCardID) { + ret.set_string(this.sdk.getCardID(index) || ""); + } else { + ret.set_string(""); + } + }; + Exps.prototype.getData = function (ret, dataIndex) { + var dataKey = "data" + dataIndex; + if (this.customData && this.customData[dataKey] !== undefined) { + ret.set_string(this.customData[dataKey]); + } else { + ret.set_string(""); + } + }; + Exps.prototype.getLastSenderUUID = function (ret) { + ret.set_string(this.lastSenderUUID || ""); + }; + Exps.prototype.getLastMessageJSON = function (ret) { + if (this.lastMessageData) { + ret.set_string(JSON.stringify(this.lastMessageData)); + } else { + ret.set_string("{}"); + } + }; + pluginProto.exps = new Exps(); +})(); +; +; cr.plugins_.Sprite = function(runtime) { this.runtime = runtime; @@ -24332,10 +25070,11 @@ cr.getObjectRefTable = function () { return [ cr.plugins_.Audio, cr.plugins_.Browser, cr.plugins_.Function, - cr.plugins_.SenaPlugin, - cr.plugins_.Sprite, - cr.plugins_.Touch, + cr.plugins_.JSON, cr.plugins_.SpriteFontPlus, + cr.plugins_.Sprite, + cr.plugins_.SenaPlugin, + cr.plugins_.Touch, cr.behaviors.Fade, cr.behaviors.DragnDrop, cr.behaviors.Rex_MoveTo, @@ -24359,28 +25098,41 @@ cr.getObjectRefTable = function () { return [ cr.system_object.prototype.acts.SetVar, cr.behaviors.Pin.prototype.acts.Pin, cr.plugins_.SpriteFontPlus.prototype.acts.SetText, + cr.plugins_.SpriteFontPlus.prototype.acts.SetScale, + cr.system_object.prototype.exps.clamp, + cr.system_object.prototype.exps.len, + cr.plugins_.SpriteFontPlus.prototype.exps.Text, cr.plugins_.Sprite.prototype.acts.SetInstanceVar, cr.plugins_.Sprite.prototype.exps.X, cr.plugins_.Sprite.prototype.exps.Y, cr.plugins_.Sprite.prototype.acts.SetPos, - cr.plugins_.SenaPlugin.prototype.acts.CalcObjectPositions, - cr.system_object.prototype.exps["int"], - cr.plugins_.Sprite.prototype.exps.Width, cr.system_object.prototype.cnds.Repeat, + cr.system_object.prototype.exps["int"], cr.system_object.prototype.exps.loopindex, cr.plugins_.SenaPlugin.prototype.exps.getHintType, cr.plugins_.SenaPlugin.prototype.exps.getHintValue, cr.system_object.prototype.acts.CreateObject, - cr.plugins_.SenaPlugin.prototype.exps.getPosXbyIndex, - cr.plugins_.SenaPlugin.prototype.exps.getPosYbyIndex, cr.system_object.prototype.cnds.Compare, cr.plugins_.Sprite.prototype.acts.SetBoolInstanceVar, cr.plugins_.Sprite.prototype.acts.SetAnimFrame, + cr.plugins_.Sprite.prototype.acts.SetWidth, + cr.plugins_.SpriteFontPlus.prototype.exps.TextWidth, + cr.plugins_.SenaPlugin.prototype.acts.SetObjectWidth, + cr.plugins_.Sprite.prototype.exps.Width, + cr.plugins_.SpriteFontPlus.prototype.acts.Destroy, cr.system_object.prototype.cnds.Else, - cr.system_object.prototype.acts.AddVar, - cr.plugins_.Sprite.prototype.acts.SetY, - cr.plugins_.SenaPlugin.prototype.exps.getOptionsType, + cr.plugins_.SenaPlugin.prototype.acts.CalcObjectPositions, cr.plugins_.SenaPlugin.prototype.exps.getOptionsValue, + cr.plugins_.Sprite.prototype.acts.SetY, + cr.plugins_.SenaPlugin.prototype.exps.getPosYbyIndex, + cr.plugins_.SenaPlugin.prototype.cnds.OnWordLayoutFinished, + cr.plugins_.SenaPlugin.prototype.exps.getOptionsType, + cr.plugins_.SenaPlugin.prototype.exps.getPosXbyIndex, + cr.plugins_.SenaPlugin.prototype.cnds.OnSlotLayoutFinished, + cr.system_object.prototype.acts.AddVar, + cr.plugins_.SenaPlugin.prototype.cnds.OnSlotLayoutFinished2, + cr.system_object.prototype.cnds.ForEach, + cr.system_object.prototype.cnds.PickByComparison, cr.plugins_.Touch.prototype.cnds.OnTouchObject, cr.plugins_.Sprite.prototype.cnds.IsVisible, cr.system_object.prototype.cnds.CompareVar, @@ -24399,14 +25151,11 @@ cr.getObjectRefTable = function () { return [ cr.system_object.prototype.exps.max, cr.plugins_.SenaPlugin.prototype.exps.getElapsedTime, cr.system_object.prototype.cnds.TriggerOnce, - cr.plugins_.SpriteFontPlus.prototype.acts.Destroy, cr.behaviors.Fade.prototype.acts.StartFade, cr.plugins_.SenaPlugin.prototype.acts.Finish, cr.plugins_.Function.prototype.cnds.OnFunction, cr.system_object.prototype.cnds.For, - cr.system_object.prototype.cnds.PickByComparison, cr.system_object.prototype.exps.left, - cr.system_object.prototype.exps.len, cr.system_object.prototype.cnds.LayerVisible, cr.plugins_.Sprite.prototype.cnds.CompareY, cr.behaviors.Rex_MoveTo.prototype.acts.SetTargetPos, @@ -24421,10 +25170,15 @@ cr.getObjectRefTable = function () { return [ cr.behaviors.DragnDrop.prototype.cnds.OnDrop, cr.plugins_.Sprite.prototype.cnds.IsBoolInstanceVarSet, cr.plugins_.Sprite.prototype.cnds.PickDistance, + cr.plugins_.SenaPlugin.prototype.acts.SetData, + cr.system_object.prototype.exps.str, + cr.plugins_.SenaPlugin.prototype.acts.PostMessage, cr.behaviors.Rex_MoveTo.prototype.acts.SetMaxSpeed, cr.behaviors.DragnDrop.prototype.cnds.IsDragging, - cr.plugins_.Touch.prototype.exps.X, - cr.plugins_.Touch.prototype.exps.Y, - cr.plugins_.Sprite.prototype.acts.SetVisible + cr.plugins_.Sprite.prototype.acts.SetVisible, + cr.plugins_.SenaPlugin.prototype.cnds.OnMessage, + cr.plugins_.JSON.prototype.acts.LoadJSON, + cr.plugins_.SenaPlugin.prototype.exps.getLastMessageJSON, + cr.plugins_.JSON.prototype.exps.Value ];}; diff --git a/definition_spelling_sequence_sentence/data.js b/definition_spelling_sequence_sentence/data.js index de31c56..9c753ad 100644 --- a/definition_spelling_sequence_sentence/data.js +++ b/definition_spelling_sequence_sentence/data.js @@ -1 +1 @@ -{"project": [null,null,[[0,true,false,false,false,false,false,false,false,false],[1,true,false,false,false,false,false,false,false,false],[2,true,false,false,false,false,false,false,false,false],[3,true,false,false,false,false,false,false,false,false],[4,false,true,true,true,true,true,true,true,false],[5,true,false,false,false,false,false,false,false,false],[6,false,true,true,true,true,true,true,true,true]],[["t0",3,false,[],0,0,null,null,[],false,false,394152958375253,[],null,["G2800S1T30"]],["t1",1,false,[],0,0,null,null,[],false,false,181015701933739,[],null,[]],["t2",4,false,[],0,0,null,[["Default",5,false,1,0,false,266653407798345,[["images/btn_check-sheet0.png",17703,0,0,165,75,1,0.5030303001403809,0.5066666603088379,[],[],0]]]],[],false,false,870372553390403,[],null],["t3",5,false,[],0,0,null,null,[],false,false,288430412484243,[],null,[1]],["t4",4,false,[],0,0,null,[["Default",5,false,1,0,false,974942116247628,[["images/pause-sheet0.png",155,0,0,250,250,1,0.5,0.5,[],[],1]]]],[],false,false,829278278494442,[],null],["t5",4,false,[],0,0,null,[["Default",5,false,1,0,false,830476950235748,[["images/pause-sheet0.png",155,0,0,250,250,1,0.5,0.5,[],[],1]]]],[],false,false,250461366236378,[],null],["t6",4,false,[839027338172447,370467464601183,403859397610033],1,0,null,[["Default",0,false,1,0,false,201845729772152,[["images/slot-sheet0.png",36041,1,1,200,75,1,0.5,0.5066666603088379,[],[],0],["images/slot-sheet0.png",36041,1,78,200,75,1,0.5,0.4933333396911621,[],[],0],["images/slot-sheet0.png",36041,1,155,200,75,1,0.4350000023841858,0.5199999809265137,[],[],0]]]],[["Fade",7,588103285968005]],false,false,530929310100717,[],null],["t7",4,false,[401281652261798,308058330719086,937883104346632,243525000976275,435711195864159],3,0,null,[["Default",5,false,1,0,false,344548683716056,[["images/slot-sheet0.png",36041,1,78,200,75,1,0.5,0.4933333396911621,[],[],0]]]],[["DragDrop",8,551257499299552],["Fade",7,430149822241515],["MoveTo",9,551694077436381]],false,false,515230787966511,[],null],["t8",2,false,[],0,0,null,null,[],false,false,825652157577718,[],null,[]],["t9",6,false,[],0,0,["images/txt_texttimer.png",94512,0],null,[],false,false,428453985749595,[],null],["t10",6,false,[],0,0,["images/txt_worditem.png",94801,0],null,[],false,false,125516006976486,[],null],["t11",6,false,[],0,0,["images/txt_texttimer.png",94512,0],null,[],false,false,680183373657896,[],null],["t12",4,false,[],0,0,null,[["Default",5,false,1,0,false,943124209669759,[["images/5sosarahtakesoff-sheet0.png",1099565,0,0,1400,900,1,0.5,0.5,[],[],1]]]],[],false,false,663734962307467,[],null],["t13",4,false,[],0,0,null,[["Default",5,false,1,0,false,174194635978617,[["images/senaaikhoi-sheet0.png",230528,0,0,1145,446,1,0.4995633065700531,0.4977578520774841,[],[],0]]]],[],false,false,577948289650662,[],null],["t14",4,false,[],0,0,null,[["Default",0,false,1,0,false,329974099612225,[["images/checker_wrong_correct-sheet0.png",10219,0,0,140,140,1,0.5,0.5,[],[-0.3642860054969788,-0.3642860054969788,0,-0.4357143044471741,0.3642860054969788,-0.3642860054969788,0.3999999761581421,0,0.3142859935760498,0.3142859935760498,0,0.442857027053833,-0.2928569912910461,0.2928569912910461,-0.3857139945030212,0],0],["images/checker_wrong_correct-sheet1.png",7978,0,0,140,140,1,0.5,0.5,[],[-0.357142984867096,-0.357142984867096,0,-0.4357143044471741,0.357142984867096,-0.357142984867096,0.3857139945030212,0,0.3642860054969788,0.3642860054969788,0,0.4142860174179077,-0.2857140004634857,0.2857139706611633,-0.3857139945030212,0],0]]]],[],false,false,246032193737445,[],null],["t15",0,false,[],0,0,null,null,[],false,false,396522085041537,[],null,[0,0,0,1,1,600,600,10000,1]],["t16",4,false,[],0,0,null,[["Default",5,false,1,0,false,857466576876240,[["images/btn_setting-sheet0.png",13202,0,0,99,91,1,0.5050504803657532,0.5054945349693298,[],[-0.3656864762306213,-0.3547005355358124,-0.006272494792938232,-0.5028490424156189,0.355585515499115,-0.3547005355358124,0.485169529914856,-0.005494534969329834,0.3604755401611328,0.349002480506897,-0.006272494792938232,0.4865684509277344,-0.3681314587593079,0.3463574647903442,-0.4977155327796936,-0.005494534969329834],0]]]],[],false,false,444899307061590,[],null],["t17",4,false,[],0,0,null,[["Default",5,false,1,0,false,922486781068681,[["images/panel-sheet0.png",105765,0,0,815,474,1,0.5141104459762573,0.4852320551872253,[],[-0.4453988373279572,0.4156119227409363,-0.5067484974861145,-5.960464477539063e-008,-0.433128833770752,-0.3945147395133972,-4.172325134277344e-007,-0.4704641699790955,0.4184045791625977,-0.3691980540752411,0.4797545671463013,-5.960464477539063e-008,0.4294475317001343,0.3881859183311462,-4.172325134277344e-007,0.5084389448165894],0]]]],[],false,false,150393696478915,[],null],["t18",6,false,[],0,0,["images/txt_question.png",192019,0],null,[],false,false,389192760965508,[],null],["t19",4,false,[637523801130517,567457434227301],1,0,null,[["Default",5,false,1,0,false,177577261579169,[["images/btn_pause-sheet0.png",11757,0,0,99,91,1,0.5050504803657532,0.5054945349693298,[],[-0.365747481584549,-0.3577375411987305,-0.005050480365753174,-0.5028560161590576,0.3556455373764038,-0.3577375411987305,0.4899744987487793,-0.006813526153564453,0.3581334948539734,0.34938645362854,-0.005050480365753174,0.4892284870147705,-0.365747481584549,0.3467484712600708,-0.4975878000259399,-0.006813526153564453],0]]]],[["MoveTo",9,345261300394347]],false,false,680660539195378,[],null],["t20",4,false,[546775332106909,966775272495183],1,0,null,[["Default",0,false,1,0,false,632596314970396,[["images/btn_music-sheet0.png",13358,0,0,99,91,1,0.5050504803657532,0.5054945349693298,[],[],0],["images/btn_music-sheet1.png",14207,0,0,99,91,1,0.5050504803657532,0.5054945349693298,[],[],0]]]],[["MoveTo",9,561713266057788]],false,false,470943728107764,[],null],["t21",4,false,[],0,0,null,[["Default",5,false,1,0,false,804798480075980,[["images/panel_pause-sheet0.png",168,0,0,250,250,1,0.5,0.5,[],[],0]]]],[],false,false,103999013142366,[],null],["t22",4,false,[],1,0,null,[["Default",5,false,1,0,false,794524614026990,[["images/layer-sheet0.png",111520,0,0,400,376,1,0.5,0.5,[],[-0.362500011920929,-0.3537229895591736,0,-0.5,0.362500011920929,-0.3537229895591736,0.497499942779541,0,0.3650000095367432,0.3563830256462097,0,0.5,-0.3650000095367432,0.3563830256462097,-0.5,0],0]]]],[["Sine",10,152768910804631]],false,false,822735679292648,[],null],["t23",4,false,[],0,0,null,[["Default",5,false,1,0,false,185281331107930,[["images/newwordpng-sheet0.png",166389,0,0,500,341,1,0.5,0.5014662742614746,[],[-0.3939999938011169,-0.3460412621498108,0,-0.4398826658725739,0.1480000019073486,0.01466274261474609,0.2919999957084656,-0.00293228030204773,0.4660000205039978,0.4486806988716126,0,0.4721407294273377,-0.4620000123977661,0.4428157210350037,-0.2820000052452087,-0.00293228030204773],0]]]],[],false,false,139959116973831,[],null],["t24",6,true,[],1,0,null,null,[["Pin",11,693926857619114]],false,false,154178255437462,[],null],["t25",4,true,[],0,0,null,null,[],false,false,909098946188328,[],null]],[[24,18,11,9,10],[25,20,19,16,22]],[["Layout 1",1200,1200,false,"Event sheet 1",148229480160171,[["BG",0,977906834634586,true,[255,255,255],true,1,1,1,false,false,1,0,0,[[[600,600,0,1946.035888671875,1251.023071289063,0,0,1,0.5,0.5,0,0,[]],12,13,[],[],[0,"Default",0,1]]],[]],["Main",1,715835324311419,true,[255,255,255],true,1,1,1,false,false,1,0,0,[[[600.5625,863,0,185.6243591308594,84.37471008300781,0,0,1,0.5030303001403809,0.5066666603088379,0,0,[]],2,2,[],[],[0,"Default",0,1]],[[314,-701,0,58,49,0,0,1,0.5,0.5,0,0,[]],4,5,[],[],[0,"Default",0,1]],[[313,-632,0,58.32666778564453,58.32666778564453,0,0,1,0.5,0.5,0,0,[]],5,6,[],[],[0,"Default",0,1]],[[209,-866,0,200,75,0,0,1,0.5,0.5066666603088379,0,0,[]],6,7,[[0],[""],[0]],[[0,0,0,2,1]],[0,"Default",0,1]],[[-35,-863,0,200,75,0,0,1,0.5,0.4933333396911621,0,0,[]],7,8,[[""],[0],[0],[-1],[0]],[[0,1],[0,0,0,2,1],[1,1200,0,0]],[0,"Default",0,1]],[[668,-675,0,160.2111206054688,55.53988647460938,0,0,1,0.5,0.5,0,0,[]],10,11,[],[[]],[76,83,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`\\/@°+=*$£€<>%","Text",0.5,0,1,1,1,0,0,0,"[[34,\" \"],[14,\"|\"],[16,\"il\"],[17,\"I.:'\"],[18,\";!\"],[19,\",\"],[22,\"`\"],[24,\")\"],[25,\"(\\\\/\"],[26,\"[\"],[27,\"j]\"],[28,\"-\"],[29,\"°\"],[32,\"t1\"],[33,\"\\\"\"],[34,\"r\"],[35,\"f\"],[36,\"*\"],[39,\"s\"],[40,\"kx\"],[41,\"Jhnu\"],[42,\"v7?+=<>\"],[43,\"Faceyz0238\"],[44,\"L569_~$\"],[45,\"bdgopq\"],[46,\"P#\"],[47,\"EX\"],[48,\"S4€\"],[49,\"Y£\"],[50,\"BNR\"],[51,\"DHKTU\"],[52,\"VZ\"],[53,\"C\"],[54,\"A\"],[55,\"&\"],[56,\"GM\"],[57,\"O\"],[60,\"Q\"],[62,\"mw\"],[65,\"%\"],[72,\"W\"],[74,\"@\"]]",-1]],[[474,-928,0,160.2109985351563,55.54000091552734,0,0,1,0.5,0.5,0,0,[]],11,12,[],[[]],[76,83,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`\\/@°+=*$£€<>%","Text",0.5,0,1,1,1,0,0,0,"[[34,\" \"],[14,\"|\"],[16,\"il\"],[17,\"I.:'\"],[18,\";!\"],[19,\",\"],[22,\"`\"],[24,\")\"],[25,\"(\\\\/\"],[26,\"[\"],[27,\"j]\"],[28,\"-\"],[29,\"°\"],[32,\"t1\"],[33,\"\\\"\"],[34,\"r\"],[35,\"f\"],[36,\"*\"],[39,\"s\"],[40,\"kx\"],[41,\"Jhnu\"],[42,\"v7?+=<>\"],[43,\"Faceyz0238\"],[44,\"L569_~$\"],[45,\"bdgopq\"],[46,\"P#\"],[47,\"EX\"],[48,\"S4€\"],[49,\"Y£\"],[50,\"BNR\"],[51,\"DHKTU\"],[52,\"VZ\"],[53,\"C\"],[54,\"A\"],[55,\"&\"],[56,\"GM\"],[57,\"O\"],[60,\"Q\"],[62,\"mw\"],[65,\"%\"],[72,\"W\"],[74,\"@\"]]",-1]],[[1052,70,0,255.0779113769531,99.35787963867188,0,0,1,0.4995633065700531,0.4977578520774841,0,0,[]],13,14,[],[],[0,"Default",0,1]],[[1080,72,0,132,77,0,0,1,0.5,0.5,0,0,[]],9,10,[],[[]],[76,83,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`\\/@°+=*$£€<>%","TIME",0.7,0,1,1,1,0,0,0,"[[34,\" \"],[14,\"|\"],[16,\"il\"],[17,\"I.:'\"],[18,\";!\"],[19,\",\"],[22,\"`\"],[24,\")\"],[25,\"(\\\\/\"],[26,\"[\"],[27,\"j]\"],[28,\"-\"],[29,\"°\"],[32,\"t1\"],[33,\"\\\"\"],[34,\"r\"],[35,\"f\"],[36,\"*\"],[39,\"s\"],[40,\"kx\"],[41,\"Jhnu\"],[42,\"v7?+=<>\"],[43,\"Faceyz0238\"],[44,\"L569_~$\"],[45,\"bdgopq\"],[46,\"P#\"],[47,\"EX\"],[48,\"S4€\"],[49,\"Y£\"],[50,\"BNR\"],[51,\"DHKTU\"],[52,\"VZ\"],[53,\"C\"],[54,\"A\"],[55,\"&\"],[56,\"GM\"],[57,\"O\"],[60,\"Q\"],[62,\"mw\"],[65,\"%\"],[72,\"W\"],[74,\"@\"]]",-1]],[[109,-653,0,140,140,0,0,1,0.5,0.5,0,0,[]],14,15,[],[],[0,"Default",0,1]],[[610.1312866210938,409.3333740234375,0,718,316,0,0,1,0.5141104459762573,0.4852320551872253,0,0,[]],17,18,[],[],[0,"Default",0,1]],[[600,418,0,642,205,0,0,1,0.5,0.5,0,0,[]],18,19,[],[[]],[73,98,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`/@°+=*$£€<>%ÁÀẢẠÃĂẰẮẶẲẴÂẦẤẬẨẪĐÉÈẺẸẼÊỀẾỆỂỄÍÌỊỈĨÓÒỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÚÙỤỦŨƯỪỨỰỬỮÝỲỴỶỸáàảạãăằắặẳẵâầấậẩẫđéèẻẹẽêềếệểễíìịỉĩóòọỏõôồốộổỗơờớợởỡúùụủũưừứựửữýỳỵỷỹ","Sắp xếp các từ sau thành câu đúng",0.85,0,1,1,1,0,0,0,"{\"\"c2array\"\":true,\"\"size\"\":[2,45,1],\"\"data\"\":[[[20],[11],[13],[14],[15],[16],[18],[19],[21],[22],[23],[24],[25],[26],[29],[30],[31],[32],[33],[34],[36],[37],[38],[39],[40],[41],[42],[43],[44],[45],[46],[47],[48],[49],[50],[51],[52],[53],[54],[56],[57],[59],[62],[69],[71]],[[\"\" \"\"],[\"\"|\"\"],[\"\"il\"\"],[\"\"I.:'\"\"],[\"\";!\"\"],[\"\",ỊỈịỉ\"\"],[\"\"Ííì\"\"],[\"\"`Ì\"\"],[\"\")\"\"],[\"\"(/\"\"],[\"\"[\"\"],[\"\"j]\"\"],[\"\"-\"\"],[\"\"°\"\"],[\"\"t1ĩ\"\"],[\"\"\\\"\"Ĩ\"\"],[\"\"r\"\"],[\"\"f\"\"],[\"\"*\"\"],[\"\"ẺẸẼỆỄ\"\"],[\"\"sảạăằắặẳẵậẫ\"\"],[\"\"kx\"\"],[\"\"Jhnuẻẹẽệễúùụủũ\"\"],[\"\"v7?+=<>Ể\"\"],[\"\"Faceyz0238áàãâéèêý\"\"],[\"\"L569_~$ẩ\"\"],[\"\"bdgopqểóòõô\"\"],[\"\"P#ọỏộỗỳỵỷỹ\"\"],[\"\"EXÉÈÊỀẾầềổ\"\"],[\"\"S4€ỤỦŨ\"\"],[\"\"Y£Ýấđơờớợởỡ\"\"],[\"\"BNRỲỴỶỸế\"\"],[\"\"DHKTUÚÙồưừứựửữ\"\"],[\"\"VZố\"\"],[\"\"C\"\"],[\"\"AÁÀÃÂ\"\"],[\"\"&\"\"],[\"\"GMỌỎỒỘỔỖ\"\"],[\"\"OẢẠĂẰẮẶẲẴẦẤẬẨẪĐÓÒÕÔỐ\"\"],[\"\"ƯỪỨỰỬỮ\"\"],[\"\"Q\"\"],[\"\"mwƠỜỚỢỞỠ\"\"],[\"\"%\"\"],[\"\"W\"\"],[\"\"@\"\"]]]}",-1]],[[1136.894897460938,1055.94287109375,0,82.66699981689453,75.98699951171875,0,0,1,0.5050504803657532,0.5054945349693298,0,0,[]],19,20,[[0],[0]],[[1,400,0,0]],[0,"Default",0,1]],[[1136.535278320313,964.1973876953125,0,82.66699981689453,75.98699951171875,0,0,1,0.5050504803657532,0.5054945349693298,0,0,[]],20,21,[[0],[0]],[[1,400,0,0]],[0,"Default",0,1]],[[1137.084106445313,1146.424194335938,0,82.66677093505859,75.98662567138672,0,0,1,0.5050504803657532,0.5054945349693298,0,0,[]],16,17,[],[],[0,"Default",0,1]]],[]],["Pause",2,621954870190361,true,[255,255,255],true,1,1,1,false,false,1,0,0,[[[600,600,0,1946.036010742188,1251.02294921875,0,0,1,0.5,0.5,0,0,[]],21,22,[],[],[0,"Default",0,1]],[[600,600,0,400,376,0,0,1,0.5,0.5,0,0,[]],22,23,[],[[1,2,0,3,0,0,0,50,0]],[0,"Default",0,1]]],[]],["Logo",3,899027236628199,true,[255,255,255],true,1,1,1,false,false,1,0,0,[[[110,77,0,195.7390747070313,133.4940490722656,0,0,1,0.5,0.5014662742614746,0,0,[]],23,24,[],[],[0,"Default",0,1]]],[]]],[],[]]],[["Event sheet 1",[[2,"DrapDrop",false],[1,"Paused",0,0,false,false,881036884152158,false],[1,"end",0,0,false,false,348658772353398,false],[1,"isTimeUp",0,0,false,false,617056362802034,false],[1,"timeLeft",0,0,false,false,670843326082385,false],[1,"answer",1,"",false,false,538561721013949,false],[0,null,false,null,421297551205104,[[-1,12,null,1,false,false,false,438843515576193,false]],[[0,13,null,551138518888793,false],[-1,14,null,392038834754127,false,[[5,[0,2]],[3,0]]]]],[0,null,false,null,432411265738905,[[0,15,null,1,false,false,false,913106290597646,false]],[[1,16,null,260483465573520,false,[[3,0],[7,[2,"Load dữ liệu xong"]]]],[1,16,null,330854144982241,false,[[3,0],[7,[20,0,17,true,null]]]]],[[0,null,false,null,122100426567399,[],[[0,18,null,458181517098292,false]]]]],[0,null,false,null,495673204159818,[[0,19,null,1,false,false,false,157454832331304,false]],[[1,16,null,816803828558793,false,[[3,0],[7,[10,[10,[10,[2,"Question :"],[20,0,20,true,null]],[2," with value : "]],[20,0,21,true,null]]]]],[1,16,null,585706784629547,false,[[3,0],[7,[10,[10,[10,[2,"Request :"],[20,0,22,true,null]],[2," with value : "]],[20,0,23,true,null]]]]],[1,16,null,103090682922262,false,[[3,0],[7,[10,[2,"Options Count :"],[20,0,24,false,null]]]]],[1,16,null,460050924307031,false,[[3,0],[7,[10,[2,"Hint Count :"],[20,0,25,false,null]]]]],[6,26,null,227093858363506,false],[7,26,null,601277174090980,false],[-1,27,null,623599131030475,false,[[11,"isTimeUp"],[7,[0,0]]]],[18,28,"Pin",210783341114782,false,[[4,17],[3,0]]],[9,28,"Pin",636254900159958,false,[[4,13],[3,0]]],[18,29,null,808593987399542,false,[[7,[20,0,21,true,null]]]],[19,30,null,756761854102448,false,[[10,0],[7,[20,19,31,false,null]]]],[19,30,null,843231659647898,false,[[10,1],[7,[20,19,32,false,null]]]],[19,33,null,429067541495196,false,[[0,[20,16,31,false,null]],[0,[20,16,32,false,null]]]],[20,30,null,312955471850139,false,[[10,0],[7,[20,20,31,false,null]]]],[20,30,null,725880314927928,false,[[10,1],[7,[20,20,32,false,null]]]],[20,33,null,588637745430653,false,[[0,[20,16,31,false,null]],[0,[20,16,32,false,null]]]]],[[0,null,false,null,278599510819277,[],[[0,34,null,505162364268873,false,[[0,[19,35,[[20,0,25,false,null]]]],[0,[20,6,36,false,null]],[0,[0,5]],[0,[0,1200]],[0,[0,0]],[0,[0,100]],[1,[2,"slot"]],[0,[0,0]]]]],[[0,null,false,null,452078189778132,[[-1,37,null,0,true,false,false,488889777784546,false,[[0,[19,35,[[20,0,25,false,null]]]]]]],[[1,16,null,239886316843096,false,[[3,0],[7,[10,[10,[10,[10,[10,[2,"Hint "],[19,38]],[2," : "]],[20,0,39,true,null]],[2," with value : "]],[20,0,40,false,null,[[19,38]]]]]]],[-1,41,null,371942430718793,false,[[4,6],[5,[0,1]],[0,[20,0,42,false,null,[[19,38]]]],[0,[4,[20,0,43,false,null,[[19,38]]],[0,650]]]]],[6,30,null,933941275549609,false,[[10,0],[7,[19,38]]]],[6,30,null,380164134533232,false,[[10,1],[7,[20,0,40,false,null,[[19,38]]]]]]],[[0,null,false,null,698796573985720,[[-1,44,null,0,false,false,false,410553190492367,false,[[7,[20,0,40,false,null,[[19,38]]]],[8,1],[7,[2,"_"]]]]],[[6,45,null,847566670403732,false,[[10,2],[3,1]]],[-1,41,null,521667370636870,false,[[4,11],[5,[0,1]],[0,[20,6,31,false,null]],[0,[20,6,32,false,null]]]],[11,28,"Pin",361028315192679,false,[[4,6],[3,0]]],[11,29,null,466267976699500,false,[[7,[21,6,true,null,1]]]],[6,46,null,354611702724504,false,[[0,[0,1]]]]]],[0,null,false,null,848543107448972,[[-1,47,null,0,false,false,false,386888311054006,false]],[[6,45,null,590812225579568,false,[[10,2],[3,0]]],[-1,48,null,916604551584151,false,[[11,"end"],[7,[0,1]]]]]]]]]],[0,null,false,null,822104816469346,[],[[0,34,null,737719939649407,false,[[0,[19,35,[[20,0,24,false,null]]]],[0,[20,7,36,false,null]],[0,[0,5]],[0,[0,1200]],[0,[0,0]],[0,[0,100]],[1,[2,"word"]],[0,[0,0]]]],[2,49,null,256704970269789,false,[[0,[4,[20,0,43,false,null,[[0,0]]],[0,700]]]]]],[[0,null,false,null,441467613146144,[[-1,37,null,0,true,false,false,218190693390519,false,[[0,[19,35,[[20,0,24,false,null]]]]]]],[[1,16,null,901551014325770,false,[[3,0],[7,[10,[10,[10,[10,[10,[2,"Options "],[19,38]],[2," : "]],[20,0,50,true,null]],[2," with value : "]],[20,0,51,true,null,[[19,38]]]]]]],[-1,41,null,722355474670048,false,[[4,7],[5,[0,1]],[0,[20,0,42,false,null,[[19,38]]]],[0,[4,[20,0,43,false,null,[[19,38]]],[0,700]]]]],[7,30,null,424845902591780,false,[[10,0],[7,[20,0,51,true,null,[[19,38]]]]]],[7,30,null,732477610518970,false,[[10,3],[7,[0,-1]]]],[7,30,null,972534679995256,false,[[10,1],[7,[20,7,31,false,null]]]],[7,30,null,955022957314574,false,[[10,2],[7,[20,7,32,false,null]]]],[-1,41,null,820542104698850,false,[[4,10],[5,[0,1]],[0,[20,7,31,false,null]],[0,[20,7,32,false,null]]]],[10,28,"Pin",165265909130423,false,[[4,7],[3,0]]],[10,29,null,752256115955919,false,[[7,[21,7,true,null,0]]]]]]]]]],[0,null,false,null,391531229850255,[[3,52,null,1,false,false,false,541795463553529,false,[[4,2]]],[2,53,null,0,false,false,false,463624702778654,false],[-1,54,null,0,false,false,false,211208220731414,false,[[11,"Paused"],[8,0],[7,[0,0]]]]],[[15,55,null,933729384541080,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[0,56,null,256977907477815,false],[7,57,"DragDrop",500676445420163,false,[[3,0]]],[-1,27,null,392747038186299,false,[[11,"answer"],[7,[2,""]]]],[8,58,null,286145656469424,false,[[1,[2,"currentAnswer"]],[13]]],[-1,59,null,870335272692108,false,[[0,[0,3]]]]]],[0,null,false,null,131646557054595,[[0,60,null,1,false,false,false,891894169376380,false]],[[15,55,null,327930580854185,false,[[2,["correct",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[-1,41,null,202907159105342,false,[[4,14],[5,[0,1]],[0,[20,2,31,false,null]],[0,[20,2,32,false,null]]]],[14,46,null,145728902691754,false,[[0,[0,0]]]]]],[0,null,false,null,626804407280781,[[0,61,null,1,false,false,false,435087545862561,false]],[[15,55,null,217938364629081,false,[[2,["error-010-206498",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[-1,41,null,522820795913632,false,[[4,14],[5,[0,1]],[0,[20,2,31,false,null]],[0,[20,2,32,false,null]]]],[14,46,null,743250840849647,false,[[0,[0,1]]]]]],[0,null,false,null,138784311293898,[[3,52,null,1,false,false,false,318840334321068,false,[[4,4]]]],[[0,56,null,188346907636434,false]]],[0,null,false,null,144690028489488,[[3,52,null,1,false,false,false,961657910924384,false,[[4,5]]]],[[0,62,null,863067724909837,false]]],[0,null,false,null,339829265544415,[[0,63,null,1,false,false,false,425081282629100,false]],[[-1,27,null,357857564221621,false,[[11,"Paused"],[7,[0,1]]]]]],[0,null,false,null,619901953302901,[[0,64,null,1,false,false,false,453788771302771,false]],[[-1,27,null,986855891964228,false,[[11,"Paused"],[7,[0,0]]]]]],[0,null,false,null,678278685100726,[[-1,65,null,0,false,false,false,839154243379294,false]],[],[[0,null,false,null,203029406704081,[[-1,44,null,0,false,false,false,812877676162386,false,[[7,[20,0,66,false,null]],[8,4],[7,[0,0]]]]],[[-1,27,null,282958384255218,false,[[11,"timeLeft"],[7,[19,67,[[0,0],[5,[20,0,66,false,null],[20,0,68,false,null]]]]]]],[9,29,null,175097790282221,false,[[7,[19,35,[[23,"timeLeft"]]]]]]]]]],[0,null,false,null,978751838447749,[[-1,65,null,0,false,false,false,740586896137774,false]],[],[[0,null,false,null,539759871180422,[[-1,44,null,0,false,false,false,735943013123850,false,[[7,[20,0,68,false,null]],[8,4],[7,[20,0,66,false,null]]]],[-1,54,null,0,false,false,false,856670007560900,false,[[11,"isTimeUp"],[8,0],[7,[0,0]]]],[-1,69,null,0,false,false,false,955668488059869,false]],[[-1,27,null,302945892896402,false,[[11,"isTimeUp"],[7,[0,1]]]],[7,57,"DragDrop",118986934409651,false,[[3,0]]],[10,70,null,739058330936640,false],[7,71,"Fade",429052538282797,false],[-1,59,null,917300360080570,false,[[0,[1,1]]]],[6,71,"Fade",315915830094512,false],[7,26,null,585032189291227,false],[11,70,null,239984847558684,false],[0,72,null,474781657260693,false,[[7,[23,"answer"]]]]]]]],[0,null,false,null,365785861310817,[[8,73,null,2,false,false,false,466620429321609,false,[[1,[2,"currentAnswer"]]]]],[],[[0,null,false,null,780375794781622,[[-1,74,null,0,true,false,false,143001263185103,false,[[1,[2,"i"]],[0,[0,0]],[0,[5,[19,35,[[20,0,25,false,null]]],[0,1]]]]]],[],[[0,null,false,null,623354472074576,[[-1,75,null,0,false,false,false,929134158340487,false,[[4,6],[7,[21,6,false,null,0]],[8,0],[7,[19,38]]]]],[[-1,27,null,483299828391284,false,[[11,"answer"],[7,[10,[10,[23,"answer"],[21,6,true,null,1]],[2,"|"]]]]]]]]],[0,null,false,null,475666535596674,[],[[-1,27,null,374977936278745,false,[[11,"answer"],[7,[19,76,[[23,"answer"],[5,[19,77,[[23,"answer"]]],[0,1]]]]]]],[0,72,null,103117520878571,false,[[7,[23,"answer"]]]]]]]],[0,null,false,null,600608562107578,[[3,52,null,1,false,false,false,891500002256313,false,[[4,16]]],[-1,78,null,0,false,false,false,644231176588955,false,[[5,[0,1]]]]],[],[[0,null,false,null,426459896580949,[[20,79,null,0,false,false,false,811423894111416,false,[[8,0],[0,[20,16,32,false,null]]]]],[[15,55,null,983752186028969,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[19,80,"MoveTo",576994443738303,false,[[0,[21,19,false,null,0]],[0,[21,19,false,null,1]]]],[20,80,"MoveTo",664066818448917,false,[[0,[21,20,false,null,0]],[0,[21,20,false,null,1]]]]]],[0,null,false,null,813987173387856,[[20,79,null,0,false,false,false,360548133253360,false,[[8,0],[0,[21,20,false,null,1]]]]],[[15,55,null,232463401023509,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[19,81,"MoveTo",564863130284639,false,[[4,16]]],[20,81,"MoveTo",753250951346862,false,[[4,16]]]]]]],[0,null,false,null,398375489714286,[[3,52,null,1,false,false,false,723806263526938,false,[[4,20]]],[20,79,null,0,false,false,false,181942908228041,false,[[8,0],[0,[21,20,false,null,1]]]]],[[15,55,null,294000245663561,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]]],[[0,null,false,null,859972771487505,[[20,82,null,0,false,false,false,990148759371186,false,[[8,0],[0,[0,0]]]]],[[20,46,null,728229426682011,false,[[0,[0,1]]]],[15,83,null,436791612138112,false,[[3,0]]]]],[0,null,false,null,474877987440232,[[-1,47,null,0,false,false,false,904405232089990,false]],[[20,46,null,569169335937351,false,[[0,[0,0]]]],[15,83,null,898083323827850,false,[[3,1]]]]]]],[0,null,false,null,246743788520867,[[3,52,null,1,false,false,false,801931205987650,false,[[4,19]]],[19,79,null,0,false,false,false,551526414582339,false,[[8,0],[0,[21,19,false,null,1]]]]],[[15,55,null,447580256591419,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[0,56,null,135302385113891,false],[19,81,"MoveTo",959639910199972,false,[[4,16]]],[20,81,"MoveTo",258657396501857,false,[[4,16]]],[-1,59,null,387073202837793,false,[[0,[1,0.5]]]],[-1,14,null,357224634786112,false,[[5,[0,1]],[3,0]]],[-1,14,null,853002410411529,false,[[5,[0,2]],[3,1]]]]],[0,null,false,null,600080256108869,[[3,52,null,1,false,false,false,304672810310041,false,[[4,22]]],[-1,78,null,0,false,false,false,303482445048985,false,[[5,[0,2]]]]],[[15,55,null,993940209084387,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[0,62,null,684013340592645,false],[-1,14,null,519113282566716,false,[[5,[0,1]],[3,1]]],[-1,14,null,494131448394392,false,[[5,[0,2]],[3,0]]]]]]],["DrapDrop",[[1,"filledCount",0,0,false,false,528865922993012,false],[0,null,false,null,197106660861514,[[7,84,"DragDrop",1,false,false,false,528907557634308,false]],[[15,55,null,162558464641912,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]]],[[0,null,false,null,266963171745346,[[7,85,null,0,false,false,false,673397366023432,false,[[10,3],[8,1],[7,[0,-1]]]],[6,85,null,0,false,false,false,577869128870380,false,[[10,0],[8,0],[7,[21,7,false,null,3]]]],[7,86,null,0,false,false,false,609479521709627,false,[[4,10]]]],[[6,30,null,445026196152632,false,[[10,1],[7,[2,"_"]]]],[7,87,null,670463517581139,false],[10,88,null,538995332098798,false]]],[0,null,false,null,816493828433722,[[-1,47,null,0,false,false,false,390659514117980,false]],[],[[0,null,false,null,487754364377713,[[7,86,null,0,false,false,false,443159185077976,false,[[4,10]]]],[[7,87,null,774809908055048,false],[10,88,null,501986465343455,false]]]]]]],[0,null,false,null,946639210805430,[[7,89,"DragDrop",1,false,false,false,155941787306139,false]],[[15,55,null,361413524752870,false,[[2,["immersivecontrol-button-click-sound-463065",false]],[3,0],[0,[0,-2]],[1,[2,""]]]]],[[0,null,false,null,504792991445212,[[7,86,null,0,false,false,false,845450333794375,false,[[4,6]]],[6,90,null,0,false,true,false,204552588897544,false,[[10,2]]]],[],[[0,null,false,null,106550985509374,[[6,91,null,0,false,false,true,170480452496238,false,[[3,0],[0,[20,7,31,false,null]],[0,[20,7,32,false,null]]]],[6,85,null,0,false,false,false,938809230173413,false,[[10,1],[8,0],[7,[2,"_"]]]]],[[7,92,"MoveTo",350887864650832,false,[[0,[0,350]]]],[7,80,"MoveTo",122919247741976,false,[[0,[20,6,31,false,null]],[0,[20,6,32,false,null]]]],[6,30,null,568930528296173,false,[[10,1],[7,[21,7,true,null,0]]]]],[[0,null,false,null,101266177713061,[[7,85,null,0,false,false,false,148334850256636,false,[[10,3],[8,0],[7,[0,-1]]]]],[[7,30,null,762068200313175,false,[[10,3],[7,[21,6,false,null,0]]]],[-1,48,null,348122173801647,false,[[11,"filledCount"],[7,[0,1]]]]]],[0,null,false,null,296319278611324,[[-1,47,null,0,false,false,false,250133201929726,false]],[[7,30,null,116855994129968,false,[[10,3],[7,[21,6,false,null,0]]]]]]]],[0,null,false,null,180540551233675,[[-1,47,null,0,false,false,false,806523891610870,false],[7,85,null,0,false,false,false,831308228851461,false,[[10,3],[8,1],[7,[0,-1]]]]],[[7,92,"MoveTo",416883713281691,false,[[0,[0,1200]]]],[7,80,"MoveTo",572186182608955,false,[[0,[21,7,false,null,1]],[0,[21,7,false,null,2]]]],[7,30,null,370498434376498,false,[[10,3],[7,[0,-1]]]],[-1,48,null,250504698972287,false,[[11,"filledCount"],[7,[0,-1]]]]]],[0,null,false,null,664272208282422,[[-1,47,null,0,false,false,false,895425177786413,false],[7,85,null,0,false,false,false,246894625675163,false,[[10,3],[8,0],[7,[0,-1]]]]],[[7,92,"MoveTo",888826482377214,false,[[0,[0,1200]]]],[7,80,"MoveTo",393405307018971,false,[[0,[21,7,false,null,1]],[0,[21,7,false,null,2]]]],[7,30,null,503673017513230,false,[[10,3],[7,[0,-1]]]]]]]],[0,null,false,null,818745098688947,[[-1,47,null,0,false,false,false,929804756669469,false],[7,85,null,0,false,false,false,177859681995434,false,[[10,3],[8,1],[7,[0,-1]]]]],[[7,92,"MoveTo",449724002535088,false,[[0,[0,1200]]]],[7,80,"MoveTo",721292388859295,false,[[0,[21,7,false,null,1]],[0,[21,7,false,null,2]]]],[7,30,null,733212651291432,false,[[10,3],[7,[0,-1]]]],[-1,48,null,739300525987860,false,[[11,"filledCount"],[7,[0,-1]]]]]],[0,null,false,null,358120937494399,[[-1,47,null,0,false,false,false,416712700522674,false],[7,85,null,0,false,false,false,261187518957115,false,[[10,3],[8,0],[7,[0,-1]]]]],[[7,92,"MoveTo",431242330954619,false,[[0,[0,1200]]]],[7,80,"MoveTo",754072653542168,false,[[0,[21,7,false,null,1]],[0,[21,7,false,null,2]]]],[7,30,null,272960877861772,false,[[10,3],[7,[0,-1]]]]]]]],[0,null,false,null,580675938654997,[[7,93,"DragDrop",0,false,false,false,411147921527630,false]],[[7,33,null,610567804677855,false,[[0,[20,3,94,false,null]],[0,[20,3,95,false,null]]]]]],[0,null,false,null,622060364017684,[[-1,65,null,0,false,false,false,228576696549219,false]],[],[[0,null,false,null,108730370076990,[[-1,54,null,0,false,false,false,538413628199561,false,[[11,"filledCount"],[8,0],[7,[23,"end"]]]]],[[2,96,null,445242465744130,false,[[3,1]]]]],[0,null,false,null,218835501607731,[[-1,47,null,0,false,false,false,933470660702724,false]],[[2,96,null,797052197521566,false,[[3,0]]]]]]]]]],[["click.ogg",24620],["correct.ogg",60630],["error-010-206498.ogg",11425],["immersivecontrol-button-click-sound-463065.ogg",3830]],"media/",false,1200,1200,4,true,true,true,"1.0.0.0",true,false,3,0,26,false,true,1,true,"Sequence",0,[]]} \ No newline at end of file +{"project": [null,null,[[0,true,false,false,false,false,false,false,false,false],[1,true,false,false,false,false,false,false,false,false],[2,true,false,false,false,false,false,false,false,false],[3,false,false,false,false,false,false,false,false,false],[4,false,true,true,true,true,true,true,true,true],[5,false,true,true,true,true,true,true,true,false],[6,true,false,false,false,false,false,false,false,false],[7,true,false,false,false,false,false,false,false,false]],[["t0",6,false,[],0,0,null,null,[],false,false,394152958375253,[],null,["G2800S1T30"]],["t1",1,false,[],0,0,null,null,[],false,false,181015701933739,[],null,[]],["t2",5,false,[],0,0,null,[["Default",5,false,1,0,false,266653407798345,[["images/btn_check-sheet0.png",17703,0,0,165,75,1,0.5030303001403809,0.5066666603088379,[],[],0]]]],[],false,false,870372553390403,[],null],["t3",7,false,[],0,0,null,null,[],false,false,288430412484243,[],null,[1]],["t4",5,false,[],0,0,null,[["Default",5,false,1,0,false,974942116247628,[["images/pause-sheet0.png",155,0,0,250,250,1,0.5,0.5,[],[],1]]]],[],false,false,829278278494442,[],null],["t5",5,false,[],0,0,null,[["Default",5,false,1,0,false,830476950235748,[["images/pause-sheet0.png",155,0,0,250,250,1,0.5,0.5,[],[],1]]]],[],false,false,250461366236378,[],null],["t6",5,false,[839027338172447,370467464601183,403859397610033],1,0,null,[["Default",0,false,1,0,false,201845729772152,[["images/slot-sheet0.png",36041,1,1,200,75,1,0.5,0.5066666603088379,[],[],0],["images/slot-sheet0.png",36041,1,78,200,75,1,0.5,0.4933333396911621,[],[],0],["images/slot-sheet0.png",36041,1,155,200,75,1,0.4350000023841858,0.5199999809265137,[],[],0]]]],[["Fade",8,588103285968005]],false,false,530929310100717,[],null],["t7",5,false,[142063037350308,401281652261798,308058330719086,937883104346632,243525000976275,435711195864159],3,0,null,[["Default",5,false,1,0,false,344548683716056,[["images/slot-sheet0.png",36041,1,78,200,75,1,0.5,0.4933333396911621,[],[],0]]]],[["DragDrop",9,551257499299552],["Fade",8,430149822241515],["MoveTo",10,551694077436381]],false,false,515230787966511,[],null],["t8",2,false,[],0,0,null,null,[],false,false,825652157577718,[],null,[]],["t9",4,false,[],0,0,["images/txt_texttimer.png",94512,0],null,[],false,false,428453985749595,[],null],["t10",4,false,[],0,0,["images/txt_worditem.png",94801,0],null,[],false,false,125516006976486,[],null],["t11",4,false,[],0,0,["images/txt_texttimer.png",94512,0],null,[],false,false,680183373657896,[],null],["t12",5,false,[],0,0,null,[["Default",5,false,1,0,false,174194635978617,[["images/senaaikhoi-sheet0.png",230528,0,0,1145,446,1,0.4995633065700531,0.4977578520774841,[],[],0]]]],[],false,false,577948289650662,[],null],["t13",5,false,[],0,0,null,[["Default",0,false,1,0,false,329974099612225,[["images/checker_wrong_correct-sheet0.png",10219,0,0,140,140,1,0.5,0.5,[],[-0.3642860054969788,-0.3642860054969788,0,-0.4357143044471741,0.3642860054969788,-0.3642860054969788,0.3999999761581421,0,0.3142859935760498,0.3142859935760498,0,0.442857027053833,-0.2928569912910461,0.2928569912910461,-0.3857139945030212,0],0],["images/checker_wrong_correct-sheet1.png",7978,0,0,140,140,1,0.5,0.5,[],[-0.357142984867096,-0.357142984867096,0,-0.4357143044471741,0.357142984867096,-0.357142984867096,0.3857139945030212,0,0.3642860054969788,0.3642860054969788,0,0.4142860174179077,-0.2857140004634857,0.2857139706611633,-0.3857139945030212,0],0]]]],[],false,false,246032193737445,[],null],["t14",0,false,[],0,0,null,null,[],false,false,396522085041537,[],null,[0,0,0,1,1,600,600,10000,1]],["t15",5,false,[],0,0,null,[["Default",5,false,1,0,false,857466576876240,[["images/btn_setting-sheet0.png",13202,0,0,99,91,1,0.5050504803657532,0.5054945349693298,[],[-0.3656864762306213,-0.3547005355358124,-0.006272494792938232,-0.5028490424156189,0.355585515499115,-0.3547005355358124,0.485169529914856,-0.005494534969329834,0.3604755401611328,0.349002480506897,-0.006272494792938232,0.4865684509277344,-0.3681314587593079,0.3463574647903442,-0.4977155327796936,-0.005494534969329834],0]]]],[],false,false,444899307061590,[],null],["t16",5,false,[],0,0,null,[["Default",5,false,1,0,false,922486781068681,[["images/panel-sheet0.png",105765,0,0,815,474,1,0.5141104459762573,0.4852320551872253,[],[-0.4453988373279572,0.4156119227409363,-0.5067484974861145,-5.960464477539063e-008,-0.433128833770752,-0.3945147395133972,-4.172325134277344e-007,-0.4704641699790955,0.4184045791625977,-0.3691980540752411,0.4797545671463013,-5.960464477539063e-008,0.4294475317001343,0.3881859183311462,-4.172325134277344e-007,0.5084389448165894],0]]]],[],false,false,150393696478915,[],null],["t17",4,false,[],0,0,["images/txt_question.png",192019,0],null,[],false,false,389192760965508,[],null],["t18",5,false,[637523801130517,567457434227301],1,0,null,[["Default",5,false,1,0,false,177577261579169,[["images/btn_pause-sheet0.png",11757,0,0,99,91,1,0.5050504803657532,0.5054945349693298,[],[-0.365747481584549,-0.3577375411987305,-0.005050480365753174,-0.5028560161590576,0.3556455373764038,-0.3577375411987305,0.4899744987487793,-0.006813526153564453,0.3581334948539734,0.34938645362854,-0.005050480365753174,0.4892284870147705,-0.365747481584549,0.3467484712600708,-0.4975878000259399,-0.006813526153564453],0]]]],[["MoveTo",10,345261300394347]],false,false,680660539195378,[],null],["t19",5,false,[546775332106909,966775272495183],1,0,null,[["Default",0,false,1,0,false,632596314970396,[["images/btn_music-sheet0.png",13358,0,0,99,91,1,0.5050504803657532,0.5054945349693298,[],[],0],["images/btn_music-sheet1.png",14207,0,0,99,91,1,0.5050504803657532,0.5054945349693298,[],[],0]]]],[["MoveTo",10,561713266057788]],false,false,470943728107764,[],null],["t20",5,false,[],0,0,null,[["Default",5,false,1,0,false,804798480075980,[["images/panel_pause-sheet0.png",168,0,0,250,250,1,0.5,0.5,[],[],0]]]],[],false,false,103999013142366,[],null],["t21",5,false,[],1,0,null,[["Default",5,false,1,0,false,794524614026990,[["images/layer-sheet0.png",111520,0,0,400,376,1,0.5,0.5,[],[-0.362500011920929,-0.3537229895591736,0,-0.5,0.362500011920929,-0.3537229895591736,0.497499942779541,0,0.3650000095367432,0.3563830256462097,0,0.5,-0.3650000095367432,0.3563830256462097,-0.5,0],0]]]],[["Sine",11,152768910804631]],false,false,822735679292648,[],null],["t22",3,false,[],0,0,null,null,[],true,false,542717009203221,[],null],["t23",4,true,[],1,0,null,null,[["Pin",12,693926857619114]],false,false,154178255437462,[],null],["t24",5,true,[],0,0,null,null,[],false,false,909098946188328,[],null]],[[23,17,11,9,10],[24,19,18,15,21]],[["Layout 1",1200,1200,false,"Event sheet 1",148229480160171,[["BG",0,977906834634586,true,[255,255,255],true,1,1,1,false,false,1,0,0,[],[]],["Main",1,715835324311419,true,[255,255,255],true,0,0,1,false,false,1,0,0,[[[600,-1099.548950195313,0,185.6243591308594,84.37471008300781,0,0,1,0.5030303001403809,0.5066666603088379,0,0,[]],2,2,[],[],[1,"Default",0,1]],[[314,-701,0,58,49,0,0,1,0.5,0.5,0,0,[]],4,5,[],[],[0,"Default",0,1]],[[313,-632,0,58.32666778564453,58.32666778564453,0,0,1,0.5,0.5,0,0,[]],5,6,[],[],[0,"Default",0,1]],[[209,-866,0,200,75,0,0,1,0.5,0.5066666603088379,0,0,[]],6,7,[[0],[""],[0]],[[0,0,0,2,1]],[0,"Default",0,1]],[[-35,-863,0,200,75,0,0,1,0.5,0.4933333396911621,0,0,[]],7,8,[[0],[""],[0],[0],[-1],[0]],[[0,1],[0,0,0,2,1],[1,1200,0,0]],[0,"Default",0,1]],[[668,-675,0,160.2111206054688,55.53988647460938,0,0,1,0.5,0.5,0,0,[]],10,11,[],[[]],[76,83,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`\\/@°+=*$£€<>%","Text",0.5,0,1,1,1,0,0,0,"[[34,\" \"],[14,\"|\"],[16,\"il\"],[17,\"I.:'\"],[18,\";!\"],[19,\",\"],[22,\"`\"],[24,\")\"],[25,\"(\\\\/\"],[26,\"[\"],[27,\"j]\"],[28,\"-\"],[29,\"°\"],[32,\"t1\"],[33,\"\\\"\"],[34,\"r\"],[35,\"f\"],[36,\"*\"],[39,\"s\"],[40,\"kx\"],[41,\"Jhnu\"],[42,\"v7?+=<>\"],[43,\"Faceyz0238\"],[44,\"L569_~$\"],[45,\"bdgopq\"],[46,\"P#\"],[47,\"EX\"],[48,\"S4€\"],[49,\"Y£\"],[50,\"BNR\"],[51,\"DHKTU\"],[52,\"VZ\"],[53,\"C\"],[54,\"A\"],[55,\"&\"],[56,\"GM\"],[57,\"O\"],[60,\"Q\"],[62,\"mw\"],[65,\"%\"],[72,\"W\"],[74,\"@\"]]",-1]],[[474,-928,0,160.2109985351563,55.54000091552734,0,0,1,0.5,0.5,0,0,[]],11,12,[],[[]],[76,83,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`\\/@°+=*$£€<>%","Text",0.5,0,1,1,1,0,0,0,"[[34,\" \"],[14,\"|\"],[16,\"il\"],[17,\"I.:'\"],[18,\";!\"],[19,\",\"],[22,\"`\"],[24,\")\"],[25,\"(\\\\/\"],[26,\"[\"],[27,\"j]\"],[28,\"-\"],[29,\"°\"],[32,\"t1\"],[33,\"\\\"\"],[34,\"r\"],[35,\"f\"],[36,\"*\"],[39,\"s\"],[40,\"kx\"],[41,\"Jhnu\"],[42,\"v7?+=<>\"],[43,\"Faceyz0238\"],[44,\"L569_~$\"],[45,\"bdgopq\"],[46,\"P#\"],[47,\"EX\"],[48,\"S4€\"],[49,\"Y£\"],[50,\"BNR\"],[51,\"DHKTU\"],[52,\"VZ\"],[53,\"C\"],[54,\"A\"],[55,\"&\"],[56,\"GM\"],[57,\"O\"],[60,\"Q\"],[62,\"mw\"],[65,\"%\"],[72,\"W\"],[74,\"@\"]]",-1]],[[1052,70,0,255.0779113769531,99.35787963867188,0,0,1,0.4995633065700531,0.4977578520774841,0,0,[]],12,14,[],[],[0,"Default",0,1]],[[1080,72,0,132,77,0,0,1,0.5,0.5,0,0,[]],9,10,[],[[]],[76,83,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`\\/@°+=*$£€<>%","TIME",0.7,0,1,1,1,0,0,0,"[[34,\" \"],[14,\"|\"],[16,\"il\"],[17,\"I.:'\"],[18,\";!\"],[19,\",\"],[22,\"`\"],[24,\")\"],[25,\"(\\\\/\"],[26,\"[\"],[27,\"j]\"],[28,\"-\"],[29,\"°\"],[32,\"t1\"],[33,\"\\\"\"],[34,\"r\"],[35,\"f\"],[36,\"*\"],[39,\"s\"],[40,\"kx\"],[41,\"Jhnu\"],[42,\"v7?+=<>\"],[43,\"Faceyz0238\"],[44,\"L569_~$\"],[45,\"bdgopq\"],[46,\"P#\"],[47,\"EX\"],[48,\"S4€\"],[49,\"Y£\"],[50,\"BNR\"],[51,\"DHKTU\"],[52,\"VZ\"],[53,\"C\"],[54,\"A\"],[55,\"&\"],[56,\"GM\"],[57,\"O\"],[60,\"Q\"],[62,\"mw\"],[65,\"%\"],[72,\"W\"],[74,\"@\"]]",-1]],[[109,-653,0,140,140,0,0,1,0.5,0.5,0,0,[]],13,15,[],[],[0,"Default",0,1]],[[610.1312866210938,409.3333740234375,0,718,316,0,0,1,0.5141104459762573,0.4852320551872253,0,0,[]],16,18,[],[],[0,"Default",0,1]],[[600,418,0,642,205,0,0,1,0.5,0.5,0,0,[]],17,19,[],[[]],[73,98,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`/@°+=*$£€<>%ÁÀẢẠÃĂẰẮẶẲẴÂẦẤẬẨẪĐÉÈẺẸẼÊỀẾỆỂỄÍÌỊỈĨÓÒỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÚÙỤỦŨƯỪỨỰỬỮÝỲỴỶỸáàảạãăằắặẳẵâầấậẩẫđéèẻẹẽêềếệểễíìịỉĩóòọỏõôồốộổỗơờớợởỡúùụủũưừứựửữýỳỵỷỹ","Sắp xếp các từ sau thành câu đúng",0.5,0,1,1,1,0,0,0,"{\"\"c2array\"\":true,\"\"size\"\":[2,45,1],\"\"data\"\":[[[20],[11],[13],[14],[15],[16],[18],[19],[21],[22],[23],[24],[25],[26],[29],[30],[31],[32],[33],[34],[36],[37],[38],[39],[40],[41],[42],[43],[44],[45],[46],[47],[48],[49],[50],[51],[52],[53],[54],[56],[57],[59],[62],[69],[71]],[[\"\" \"\"],[\"\"|\"\"],[\"\"il\"\"],[\"\"I.:'\"\"],[\"\";!\"\"],[\"\",ỊỈịỉ\"\"],[\"\"Ííì\"\"],[\"\"`Ì\"\"],[\"\")\"\"],[\"\"(/\"\"],[\"\"[\"\"],[\"\"j]\"\"],[\"\"-\"\"],[\"\"°\"\"],[\"\"t1ĩ\"\"],[\"\"\\\"\"Ĩ\"\"],[\"\"r\"\"],[\"\"f\"\"],[\"\"*\"\"],[\"\"ẺẸẼỆỄ\"\"],[\"\"sảạăằắặẳẵậẫ\"\"],[\"\"kx\"\"],[\"\"Jhnuẻẹẽệễúùụủũ\"\"],[\"\"v7?+=<>Ể\"\"],[\"\"Faceyz0238áàãâéèêý\"\"],[\"\"L569_~$ẩ\"\"],[\"\"bdgopqểóòõô\"\"],[\"\"P#ọỏộỗỳỵỷỹ\"\"],[\"\"EXÉÈÊỀẾầềổ\"\"],[\"\"S4€ỤỦŨ\"\"],[\"\"Y£Ýấđơờớợởỡ\"\"],[\"\"BNRỲỴỶỸế\"\"],[\"\"DHKTUÚÙồưừứựửữ\"\"],[\"\"VZố\"\"],[\"\"C\"\"],[\"\"AÁÀÃÂ\"\"],[\"\"&\"\"],[\"\"GMỌỎỒỘỔỖ\"\"],[\"\"OẢẠĂẰẮẶẲẴẦẤẬẨẪĐÓÒÕÔỐ\"\"],[\"\"ƯỪỨỰỬỮ\"\"],[\"\"Q\"\"],[\"\"mwƠỜỚỢỞỠ\"\"],[\"\"%\"\"],[\"\"W\"\"],[\"\"@\"\"]]]}",-1]],[[1136.894897460938,1055.94287109375,0,82.66699981689453,75.98699951171875,0,0,1,0.5050504803657532,0.5054945349693298,0,0,[]],18,20,[[0],[0]],[[1,400,0,0]],[0,"Default",0,1]],[[1136.535278320313,964.1973876953125,0,82.66699981689453,75.98699951171875,0,0,1,0.5050504803657532,0.5054945349693298,0,0,[]],19,21,[[0],[0]],[[1,400,0,0]],[0,"Default",0,1]],[[1137.084106445313,1146.424194335938,0,82.66677093505859,75.98662567138672,0,0,1,0.5050504803657532,0.5054945349693298,0,0,[]],15,17,[],[],[0,"Default",0,1]]],[]],["Pause",2,621954870190361,true,[255,255,255],true,0,0,1,false,false,1,0,0,[[[600,600,0,1946.036010742188,1251.02294921875,0,0,1,0.5,0.5,0,0,[]],20,22,[],[],[0,"Default",0,1]],[[600,600,0,400,376,0,0,1,0.5,0.5,0,0,[]],21,23,[],[[1,2,0,3,0,0,0,50,0]],[0,"Default",0,1]]],[]],["Logo",3,899027236628199,true,[255,255,255],true,1,1,1,false,false,1,0,0,[],[]]],[[null,22,3,[],[],[]]],[]]],[["Event sheet 1",[[2,"move",false],[2,"DrapDrop",false],[1,"Paused",0,0,false,false,881036884152158,false],[1,"end",0,-1,false,false,348658772353398,false],[1,"isTimeUp",0,0,false,false,617056362802034,false],[1,"timeLeft",0,0,false,false,670843326082385,false],[1,"answer",1,"",false,false,538561721013949,false],[0,null,false,null,884738942125081,[[-1,13,null,1,false,false,false,779335384011838,false]],[[0,14,null,712623772503196,false],[-1,15,null,665904957070028,false,[[5,[0,2]],[3,0]]]]],[0,null,false,null,173205907841795,[[0,16,null,1,false,false,false,735813685837807,false]],[[1,17,null,990604057027046,false,[[3,0],[7,[2,"Load dữ liệu xong"]]]],[1,17,null,766075407458233,false,[[3,0],[7,[20,0,18,true,null]]]]],[[0,null,false,null,614934129840188,[],[[0,19,null,121780214691540,false]]]]],[0,null,false,null,503742714882513,[[0,20,null,1,false,false,false,232077003218918,false]],[[1,17,null,847096676919258,false,[[3,0],[7,[10,[10,[10,[2,"Question :"],[20,0,21,true,null]],[2," with value : "]],[20,0,22,true,null]]]]],[1,17,null,496569390325078,false,[[3,0],[7,[10,[10,[10,[2,"Request :"],[20,0,23,true,null]],[2," with value : "]],[20,0,24,true,null]]]]],[1,17,null,894676961299440,false,[[3,0],[7,[10,[2,"Options Count :"],[20,0,25,false,null]]]]],[1,17,null,659919359004499,false,[[3,0],[7,[10,[2,"Hint Count :"],[20,0,26,false,null]]]]],[6,27,null,195577119265920,false],[7,27,null,930315404143226,false],[-1,28,null,129332192830748,false,[[11,"isTimeUp"],[7,[0,0]]]],[17,29,"Pin",827972427641758,false,[[4,16],[3,0]]],[9,29,"Pin",372335239976188,false,[[4,12],[3,0]]],[17,30,null,301292150686467,false,[[7,[20,0,22,true,null]]]],[17,31,null,557136259071386,false,[[0,[19,32,[[7,[0,20],[19,33,[[20,17,34,true,null]]]],[1,0.5],[1,1.1]]]]]],[18,35,null,987626251324366,false,[[10,0],[7,[20,18,36,false,null]]]],[18,35,null,236683395294390,false,[[10,1],[7,[20,18,37,false,null]]]],[18,38,null,782092743992068,false,[[0,[20,15,36,false,null]],[0,[20,15,37,false,null]]]],[19,35,null,141732248337882,false,[[10,0],[7,[20,19,36,false,null]]]],[19,35,null,819452468761774,false,[[10,1],[7,[20,19,37,false,null]]]],[19,38,null,152457156173151,false,[[0,[20,15,36,false,null]],[0,[20,15,37,false,null]]]]],[[0,null,false,null,860357602845112,[],[],[[0,null,false,null,847425665536942,[[-1,39,null,0,true,false,false,329666397405285,false,[[0,[19,40,[[20,0,26,false,null]]]]]]],[[1,17,null,482550875195550,false,[[3,0],[7,[10,[10,[10,[10,[10,[2,"Hint "],[19,41]],[2," : "]],[20,0,42,true,null]],[2," with value : "]],[20,0,43,false,null,[[19,41]]]]]]],[-1,44,null,491873769193029,false,[[4,6],[5,[0,1]],[0,[0,0]],[0,[0,0]]]],[6,35,null,752822472326952,false,[[10,0],[7,[19,41]]]],[6,35,null,847092118934787,false,[[10,1],[7,[20,0,43,false,null,[[19,41]]]]]]],[[0,null,false,null,388426015968796,[[-1,45,null,0,false,false,false,526716712223636,false,[[7,[20,0,43,false,null,[[19,41]]]],[8,1],[7,[2,"_"]]]]],[[6,46,null,870135322332248,false,[[10,2],[3,1]]],[-1,44,null,532560333828423,false,[[4,11],[5,[0,1]],[0,[20,6,36,false,null]],[0,[20,6,37,false,null]]]],[11,29,"Pin",260031803101789,false,[[4,6],[3,0]]],[11,30,null,531498837391466,false,[[7,[21,6,true,null,1]]]],[6,47,null,181775957503978,false,[[0,[0,1]]]],[6,48,null,497047642969550,false,[[0,[4,[20,11,49,false,null],[0,40]]]]],[0,50,null,940697998589761,false,[[0,[19,41]],[0,[20,6,51,false,null]]]],[11,52,null,145580878553869,false],[6,27,null,581466967012189,false]]],[0,null,false,null,450256578295674,[[-1,53,null,0,false,false,false,157625010625978,false]],[[6,46,null,240984707019339,false,[[10,2],[3,0]]],[6,47,null,961319454803372,false,[[0,[0,0]]]],[0,50,null,582624800627380,false,[[0,[19,41]],[0,[20,6,51,false,null]]]],[6,27,null,154287082581229,false]]]]],[0,null,false,null,542840411396026,[],[[0,54,null,186251332675941,false,[[0,[19,40,[[20,0,26,false,null]]]],[0,[0,0]],[0,[0,5]],[0,[0,1200]],[0,[0,0]],[0,[0,100]],[1,[2,"slot"]],[0,[0,0]]]]]],[0,null,false,null,489971265367282,[[-1,39,null,0,true,false,false,244784525442640,false,[[0,[19,40,[[20,0,25,false,null]]]]]]],[[-1,44,null,779734297756263,false,[[4,7],[5,[0,1]],[0,[0,0]],[0,[0,0]]]],[7,35,null,939393845294169,false,[[10,1],[7,[20,0,55,true,null,[[19,41]]]]]],[-1,44,null,178251574612494,false,[[4,10],[5,[0,1]],[0,[20,7,36,false,null]],[0,[20,7,37,false,null]]]],[10,29,"Pin",945216542379593,false,[[4,7],[3,0]]],[10,30,null,186061844255485,false,[[7,[21,7,true,null,1]]]],[7,48,null,757912440157175,false,[[0,[4,[20,10,49,false,null],[0,40]]]]],[0,50,null,873617077822553,false,[[0,[19,41]],[0,[20,7,51,false,null]]]],[10,52,null,412445127212823,false],[7,27,null,875948710176033,false]]],[0,null,false,null,446758710633533,[],[[0,54,null,828967387256605,false,[[0,[19,40,[[20,0,25,false,null]]]],[0,[0,0]],[0,[0,5]],[0,[0,1200]],[0,[0,0]],[0,[0,100]],[1,[2,"word"]],[0,[0,0]]]],[2,56,null,352591841615288,false,[[0,[4,[20,0,57,false,null,[[0,0]]],[0,740]]]]]]]]]]],[0,null,false,null,633406097976012,[[0,58,null,1,false,false,false,379895430290893,false]],[],[[0,null,false,null,514615872702154,[[-1,39,null,0,true,false,false,479814960378418,false,[[0,[19,40,[[20,0,25,false,null]]]]]]],[[1,17,null,757750206095410,false,[[3,0],[7,[10,[10,[10,[10,[10,[2,"Options "],[19,41]],[2," : "]],[20,0,59,true,null]],[2," with value : "]],[20,0,55,true,null,[[19,41]]]]]]],[-1,44,null,512040290304513,false,[[4,7],[5,[0,1]],[0,[20,0,60,false,null,[[19,41]]]],[0,[4,[20,0,57,false,null,[[19,41]]],[0,720]]]]],[7,35,null,746285411986401,false,[[10,0],[7,[19,41]]]],[7,35,null,285589324987230,false,[[10,1],[7,[20,0,55,true,null,[[19,41]]]]]],[7,35,null,359594174513441,false,[[10,4],[7,[0,-1]]]],[7,35,null,235645660328192,false,[[10,2],[7,[20,7,36,false,null]]]],[7,35,null,765921201025615,false,[[10,3],[7,[20,7,37,false,null]]]],[0,50,null,695908254999697,false,[[0,[19,41]],[0,[20,7,51,false,null]]]],[-1,44,null,915247381389382,false,[[4,10],[5,[0,1]],[0,[20,7,36,false,null]],[0,[20,7,37,false,null]]]],[10,29,"Pin",622467865215432,false,[[4,7],[3,0]]],[10,30,null,402801158816052,false,[[7,[21,7,true,null,1]]]],[7,48,null,631477488282771,false,[[0,[4,[20,10,49,false,null],[0,40]]]]]]]]],[0,null,false,null,995050819452536,[[0,61,null,1,false,false,false,373215532269613,false]],[],[[0,null,false,null,275501272482055,[[-1,39,null,0,true,false,false,481447931922208,false,[[0,[19,40,[[20,0,26,false,null]]]]]]],[[1,17,null,457805981674059,false,[[3,0],[7,[10,[10,[10,[10,[10,[2,"Hint "],[19,41]],[2," : "]],[20,0,42,true,null]],[2," with value : "]],[20,0,43,false,null,[[19,41]]]]]]],[-1,44,null,504360225780021,false,[[4,6],[5,[0,1]],[0,[20,0,60,false,null,[[19,41]]]],[0,[4,[20,0,57,false,null,[[19,41]]],[0,700]]]]],[6,35,null,226308170197240,false,[[10,0],[7,[19,41]]]],[6,35,null,881261663087328,false,[[10,1],[7,[20,0,43,false,null,[[19,41]]]]]]],[[0,null,false,null,478630871557385,[[-1,45,null,0,false,false,false,116102084592561,false,[[7,[20,0,43,false,null,[[19,41]]]],[8,1],[7,[2,"_"]]]]],[[6,46,null,173324553574813,false,[[10,2],[3,1]]],[-1,44,null,855644180425974,false,[[4,11],[5,[0,1]],[0,[20,6,36,false,null]],[0,[20,6,37,false,null]]]],[11,29,"Pin",296221250783534,false,[[4,6],[3,0]]],[11,30,null,989847819373662,false,[[7,[21,6,true,null,1]]]],[6,47,null,339665455455610,false,[[0,[0,1]]]],[6,48,null,493642261595698,false,[[0,[4,[20,11,49,false,null],[0,40]]]]],[0,50,null,121027207778790,false,[[0,[19,41]],[0,[20,6,51,false,null]]]]]],[0,null,false,null,546104841501412,[[-1,53,null,0,false,false,false,552522117209660,false]],[[6,46,null,420711769735083,false,[[10,2],[3,0]]],[6,47,null,532949218980695,false,[[0,[0,0]]]],[0,50,null,108067549493355,false,[[0,[19,41]],[0,[20,6,51,false,null]]]],[-1,62,null,528623168433423,false,[[11,"end"],[7,[0,1]]]]]]]]]],[0,null,false,null,181461682960265,[[0,63,null,1,false,false,false,764638292531310,false]],[],[[0,null,false,null,545755877771173,[[-1,64,null,0,true,false,false,167195392241964,false,[[4,6]]]],[[6,38,null,606894466055324,false,[[0,[20,0,60,false,null,[[19,41]]]],[0,[4,[20,0,57,false,null,[[19,41]]],[0,700]]]]]],[[0,null,false,null,254318552834301,[[-1,65,null,0,false,false,false,974685729178911,false,[[4,7],[7,[21,7,false,null,4]],[8,0],[7,[21,6,false,null,0]]]]],[[7,38,null,385872105382790,false,[[0,[20,6,36,false,null]],[0,[20,6,37,false,null]]]]]]]]]],[0,null,false,null,481483005772683,[[3,66,null,1,false,false,false,472973205418353,false,[[4,2]]],[2,67,null,0,false,false,false,981160611579018,false],[-1,68,null,0,false,false,false,505964404263671,false,[[11,"Paused"],[8,0],[7,[0,0]]]]],[[14,69,null,266454505771912,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[0,70,null,248463419921165,false],[7,71,"DragDrop",985818281602007,false,[[3,0]]],[-1,28,null,434241514113014,false,[[11,"answer"],[7,[2,""]]]],[8,72,null,100992168175543,false,[[1,[2,"currentAnswer"]],[13]]],[-1,73,null,632233316724411,false,[[0,[0,3]]]]]],[0,null,false,null,405261740332650,[[0,74,null,1,false,false,false,981161603686695,false]],[[14,69,null,334030064891874,false,[[2,["correct",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[-1,44,null,710946041634106,false,[[4,13],[5,[0,1]],[0,[20,2,36,false,null]],[0,[20,2,37,false,null]]]],[13,47,null,588663337209356,false,[[0,[0,0]]]]]],[0,null,false,null,452491092420441,[[0,75,null,1,false,false,false,482708111051108,false]],[[14,69,null,246352645819786,false,[[2,["error-010-206498",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[-1,44,null,334438951292627,false,[[4,13],[5,[0,1]],[0,[20,2,36,false,null]],[0,[20,2,37,false,null]]]],[13,47,null,376754452084418,false,[[0,[0,1]]]]]],[0,null,false,null,190467109301605,[[3,66,null,1,false,false,false,679623664729600,false,[[4,4]]]],[[0,70,null,874305286765227,false]]],[0,null,false,null,903015320435744,[[3,66,null,1,false,false,false,356730872837882,false,[[4,5]]]],[[0,76,null,235190764740259,false]]],[0,null,false,null,140149134383600,[[0,77,null,1,false,false,false,842812134723310,false]],[[-1,28,null,421133625782517,false,[[11,"Paused"],[7,[0,1]]]]]],[0,null,false,null,680039448404208,[[0,78,null,1,false,false,false,650245339008100,false]],[[-1,28,null,748444813510736,false,[[11,"Paused"],[7,[0,0]]]]]],[0,null,false,null,873630073607762,[[-1,79,null,0,false,false,false,703838904032712,false]],[],[[0,null,false,null,844537024558853,[[-1,45,null,0,false,false,false,219375853583026,false,[[7,[20,0,80,false,null]],[8,4],[7,[0,0]]]]],[[-1,28,null,138231239224536,false,[[11,"timeLeft"],[7,[19,81,[[0,0],[5,[20,0,80,false,null],[20,0,82,false,null]]]]]]],[9,30,null,380258939521280,false,[[7,[19,40,[[23,"timeLeft"]]]]]]]]]],[0,null,false,null,534219157511262,[[-1,79,null,0,false,false,false,441733042115458,false]],[],[[0,null,false,null,269400089061844,[[-1,45,null,0,false,false,false,115680488266968,false,[[7,[20,0,82,false,null]],[8,4],[7,[20,0,80,false,null]]]],[-1,68,null,0,false,false,false,436795342414948,false,[[11,"isTimeUp"],[8,0],[7,[0,0]]]],[-1,83,null,0,false,false,false,842898154233655,false]],[[-1,28,null,728963651610164,false,[[11,"isTimeUp"],[7,[0,1]]]],[7,71,"DragDrop",934250332845021,false,[[3,0]]],[10,52,null,217839959213743,false],[7,84,"Fade",168187827302890,false],[-1,73,null,369694112565943,false,[[0,[1,1]]]],[6,84,"Fade",623713476594323,false],[7,27,null,121279201772037,false],[11,52,null,110916647110793,false],[0,85,null,455091182166658,false,[[7,[23,"answer"]]]]]]]],[0,null,false,null,929493376931888,[[8,86,null,2,false,false,false,328253483317247,false,[[1,[2,"currentAnswer"]]]]],[],[[0,null,false,null,321866942323417,[[-1,87,null,0,true,false,false,461032426293747,false,[[1,[2,"i"]],[0,[0,0]],[0,[5,[19,40,[[20,0,26,false,null]]],[0,1]]]]]],[],[[0,null,false,null,176688156251966,[[-1,65,null,0,false,false,false,481998314685686,false,[[4,6],[7,[21,6,false,null,0]],[8,0],[7,[19,41]]]]],[[-1,28,null,809044040397669,false,[[11,"answer"],[7,[10,[10,[23,"answer"],[21,6,true,null,1]],[2,"|"]]]]]]]]],[0,null,false,null,405792431694348,[],[[-1,28,null,234277566370135,false,[[11,"answer"],[7,[19,88,[[23,"answer"],[5,[19,33,[[23,"answer"]]],[0,1]]]]]]],[0,85,null,805765659040341,false,[[7,[23,"answer"]]]]]]]],[0,null,false,null,933152298186006,[[3,66,null,1,false,false,false,938912915616738,false,[[4,15]]],[-1,89,null,0,false,false,false,288447211464716,false,[[5,[0,1]]]]],[],[[0,null,false,null,164492981381066,[[19,90,null,0,false,false,false,266659290728266,false,[[8,0],[0,[20,15,37,false,null]]]]],[[14,69,null,269009988400125,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[18,91,"MoveTo",657487412718043,false,[[0,[21,18,false,null,0]],[0,[21,18,false,null,1]]]],[19,91,"MoveTo",492423171510943,false,[[0,[21,19,false,null,0]],[0,[21,19,false,null,1]]]]]],[0,null,false,null,257976321820788,[[19,90,null,0,false,false,false,547959101187098,false,[[8,0],[0,[21,19,false,null,1]]]]],[[14,69,null,913132754920783,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[18,92,"MoveTo",543008810942955,false,[[4,15]]],[19,92,"MoveTo",713350196410576,false,[[4,15]]]]]]],[0,null,false,null,289340600304689,[[3,66,null,1,false,false,false,806777832051474,false,[[4,19]]],[19,90,null,0,false,false,false,158731693035344,false,[[8,0],[0,[21,19,false,null,1]]]]],[[14,69,null,516179330293859,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]]],[[0,null,false,null,309178159128497,[[19,93,null,0,false,false,false,430449381160945,false,[[8,0],[0,[0,0]]]]],[[19,47,null,661370221785053,false,[[0,[0,1]]]],[14,94,null,323354395422626,false,[[3,0]]]]],[0,null,false,null,149824011210399,[[-1,53,null,0,false,false,false,411349141927938,false]],[[19,47,null,913594662346958,false,[[0,[0,0]]]],[14,94,null,809673635058832,false,[[3,1]]]]]]],[0,null,false,null,278063802365073,[[3,66,null,1,false,false,false,146420525351831,false,[[4,18]]],[18,90,null,0,false,false,false,246642964025186,false,[[8,0],[0,[21,18,false,null,1]]]]],[[14,69,null,596985626602506,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[0,70,null,907565213698336,false],[18,92,"MoveTo",262034553762814,false,[[4,15]]],[19,92,"MoveTo",847630684373264,false,[[4,15]]],[-1,73,null,613424082516754,false,[[0,[1,0.5]]]],[-1,15,null,833059859597768,false,[[5,[0,1]],[3,0]]],[-1,15,null,517311183992465,false,[[5,[0,2]],[3,1]]]]],[0,null,false,null,732888766059129,[[3,66,null,1,false,false,false,648828564971135,false,[[4,21]]],[-1,89,null,0,false,false,false,781383010042915,false,[[5,[0,2]]]]],[[14,69,null,782599350895201,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[0,76,null,531101582335543,false],[-1,15,null,187820488361042,false,[[5,[0,1]],[3,1]]],[-1,15,null,960556708126620,false,[[5,[0,2]],[3,0]]]]]]],["DrapDrop",[[1,"filledCount",0,-1,false,false,528865922993012,false],[0,null,false,null,434836318662614,[[7,95,"DragDrop",1,false,false,false,908705320494368,false]],[[14,69,null,325015694677489,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]]],[[0,null,false,null,277989805213448,[[7,96,null,0,false,false,false,149984688741178,false,[[10,4],[8,1],[7,[0,-1]]]],[6,96,null,0,false,false,false,161953628139890,false,[[10,0],[8,0],[7,[21,7,false,null,4]]]],[7,97,null,0,false,false,false,992162589144369,false,[[4,10]]]],[[6,35,null,467023785402094,false,[[10,1],[7,[2,"_"]]]],[7,98,null,520063109045764,false],[10,99,null,515678311593131,false]]],[0,null,false,null,624558543652502,[[-1,53,null,0,false,false,false,349083820395460,false]],[],[[0,null,false,null,596116128121889,[[7,97,null,0,false,false,false,947763012836848,false,[[4,10]]]],[[7,98,null,769660628745941,false],[10,99,null,282909686678758,false]]]]]]],[0,null,false,null,564909706270083,[[7,100,"DragDrop",1,false,false,false,668454801944676,false]],[[14,69,null,234193458017707,false,[[2,["immersivecontrol-button-click-sound-463065",false]],[3,0],[0,[0,-2]],[1,[2,""]]]]],[[0,null,false,null,149301542468278,[[7,97,null,0,false,false,false,524095271477701,false,[[4,6]]],[6,101,null,0,false,true,false,554566732713859,false,[[10,2]]]],[],[[0,null,false,null,196509923567080,[[6,102,null,0,false,false,true,689968684564600,false,[[3,0],[0,[20,7,36,false,null]],[0,[20,7,37,false,null]]]],[6,96,null,0,false,false,false,588571930949389,false,[[10,1],[8,0],[7,[2,"_"]]]]],[],[[0,null,false,null,382084929241358,[[7,96,null,0,false,false,false,862748499489021,false,[[10,4],[8,0],[7,[0,-1]]]]],[[6,35,null,700037220166197,false,[[10,1],[7,[21,7,true,null,1]]]],[6,48,null,973093677094642,false,[[0,[20,7,51,false,null]]]],[7,35,null,817815073399962,false,[[10,4],[7,[21,6,false,null,0]]]],[-1,62,null,140215452784800,false,[[11,"filledCount"],[7,[0,1]]]],[0,103,null,611238300418128,false,[[1,[19,104,[[21,7,true,null,1]]]],[1,[19,104,[[21,6,false,null,0]]]],[1,[2,""]],[1,[2,""]],[1,[2,""]]]],[0,105,null,697560318189382,false]]],[0,null,false,null,373391323037524,[[-1,53,null,0,false,false,false,869767578321865,false]],[[6,35,null,340298944001213,false,[[10,1],[7,[21,7,true,null,1]]]],[6,48,null,232010226925863,false,[[0,[20,7,51,false,null]]]],[7,35,null,736868104099184,false,[[10,4],[7,[21,6,false,null,0]]]],[0,103,null,477538383489103,false,[[1,[19,104,[[21,7,true,null,1]]]],[1,[19,104,[[21,6,false,null,0]]]],[1,[2,""]],[1,[2,""]],[1,[2,""]]]],[0,105,null,774432456117737,false]]]]],[0,null,false,null,695568752755513,[[-1,53,null,0,false,false,false,301387320150849,false],[7,96,null,0,false,false,false,266684839123897,false,[[10,4],[8,1],[7,[0,-1]]]]],[[7,106,"MoveTo",960704930402698,false,[[0,[0,1200]]]],[7,91,"MoveTo",532420078874698,false,[[0,[21,7,false,null,2]],[0,[21,7,false,null,3]]]],[7,35,null,182208167694379,false,[[10,4],[7,[0,-1]]]],[-1,62,null,903375034643468,false,[[11,"filledCount"],[7,[0,-1]]]],[0,103,null,890996853148169,false,[[1,[19,104,[[21,7,true,null,1]]]],[1,[2,"-1"]],[1,[2,"d3"]],[1,[2,"d4"]],[1,[2,"d5"]]]],[0,105,null,325922467882600,false]]],[0,null,false,null,226436872040410,[[-1,53,null,0,false,false,false,593390240289000,false],[7,96,null,0,false,false,false,636127079179244,false,[[10,4],[8,0],[7,[0,-1]]]]],[[7,106,"MoveTo",149174500883322,false,[[0,[0,1200]]]],[7,91,"MoveTo",388148777327740,false,[[0,[21,7,false,null,2]],[0,[21,7,false,null,3]]]],[7,35,null,303917849545138,false,[[10,4],[7,[0,-1]]]],[0,103,null,324425117895702,false,[[1,[19,104,[[21,7,true,null,1]]]],[1,[2,"-1"]],[1,[2,"d3"]],[1,[2,"d4"]],[1,[2,"d5"]]]],[0,105,null,696472233725821,false]]]]],[0,null,false,null,225997675535095,[[-1,53,null,0,false,false,false,868655599674776,false],[7,96,null,0,false,false,false,480839166441435,false,[[10,4],[8,1],[7,[0,-1]]]]],[[7,106,"MoveTo",889897583872753,false,[[0,[0,1200]]]],[7,91,"MoveTo",696019346521729,false,[[0,[21,7,false,null,2]],[0,[21,7,false,null,3]]]],[7,35,null,306839670028257,false,[[10,4],[7,[0,-1]]]],[-1,62,null,485054816905990,false,[[11,"filledCount"],[7,[0,-1]]]],[0,103,null,903489038288267,false,[[1,[19,104,[[21,7,true,null,1]]]],[1,[2,"-1"]],[1,[2,"d3"]],[1,[2,"d4"]],[1,[2,"d5"]]]],[0,105,null,713950491087471,false]]],[0,null,false,null,192945356695201,[[-1,53,null,0,false,false,false,934058771254154,false],[7,96,null,0,false,false,false,351364245736262,false,[[10,4],[8,0],[7,[0,-1]]]]],[[7,106,"MoveTo",543975084784182,false,[[0,[0,1200]]]],[7,91,"MoveTo",781686210483332,false,[[0,[21,7,false,null,2]],[0,[21,7,false,null,3]]]],[7,35,null,454651674497780,false,[[10,4],[7,[0,-1]]]],[0,103,null,339578001483942,false,[[1,[19,104,[[21,7,true,null,1]]]],[1,[2,"-1"]],[1,[2,"d3"]],[1,[2,"d4"]],[1,[2,"d5"]]]],[0,105,null,990004336473091,false]]],[0,null,false,null,224479462387565,[[6,96,null,0,false,false,false,348569511807448,false,[[10,1],[8,0],[7,[2,"_"]]]]],[[6,48,null,431835126155946,false,[[0,[0,200]]]]]]]],[0,null,false,null,852555330115260,[[7,107,"DragDrop",0,false,false,false,181609980601851,false]],[]],[0,null,false,null,318342382878143,[[-1,79,null,0,false,false,false,566296960395856,false]],[],[[0,null,false,null,268640517088092,[[-1,68,null,0,false,false,false,411274150582745,false,[[11,"filledCount"],[8,0],[7,[23,"end"]]]]],[[2,108,null,884502669546334,false,[[3,1]]]]],[0,null,false,null,919940285218081,[[-1,53,null,0,false,false,false,874551782885890,false]],[[2,108,null,820538600408396,false,[[3,0]]]]]]],[0,null,false,null,456760236212267,[[7,100,"DragDrop",1,false,false,false,964737593504727,false]],[],[[0,null,false,null,557842924511517,[[-1,64,null,0,true,false,false,624386719327307,false,[[4,6]]]],[[0,50,null,946058616101984,false,[[0,[19,41]],[0,[20,6,51,false,null]]]]]],[0,null,false,null,650149474491980,[],[[0,54,null,397493277454456,false,[[0,[19,40,[[20,0,26,false,null]]]],[0,[0,0]],[0,[0,5]],[0,[0,1200]],[0,[0,0]],[0,[0,100]],[1,[2,"slot2"]],[0,[0,0]]]]]]]]]],["move",[[0,null,false,null,189526152398745,[[0,109,null,1,false,false,false,154645012452542,false]],[[22,110,null,370909099724145,false,[[1,[20,0,111,true,null]],[3,0],[13]]],[-1,73,null,416515653298811,false,[[0,[1,0.0001]]]]],[[0,null,false,null,185176590349981,[[-1,65,null,0,false,false,false,228959459739934,false,[[4,7],[7,[21,7,true,null,1]],[8,0],[7,[19,104,[[20,22,112,false,null,[[0,0],[2,"data1"]]]]]]]]],[],[[0,null,false,null,315413025170889,[[-1,65,null,0,false,false,false,490998579991655,false,[[4,6],[7,[19,40,[[20,22,112,false,null,[[0,0],[2,"data2"]]]]]],[8,0],[7,[21,6,false,null,0]]]]],[[7,92,"MoveTo",992771962115175,false,[[4,6]]]]],[0,null,false,null,891226202223425,[[-1,53,null,0,false,false,false,205302004183387,false],[-1,65,null,0,false,false,false,986934064021431,false,[[4,7],[7,[21,7,true,null,1]],[8,0],[7,[19,104,[[20,22,112,false,null,[[0,0],[2,"data1"]]]]]]]]],[[7,91,"MoveTo",793712391369244,false,[[0,[21,7,false,null,2]],[0,[21,7,false,null,3]]]]]]]],[0,null,false,null,470224955540695,[[-1,45,null,0,false,false,false,795896837180161,false,[[7,[19,40,[[20,22,112,false,null,[[0,0],[2,"data3"]]]]]],[8,0],[7,[0,1]]]],[2,67,null,0,false,false,false,834199422449909,false]],[[14,69,null,514562450852697,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[0,70,null,431611912051203,false],[7,71,"DragDrop",792278917237356,false,[[3,0]]],[-1,28,null,115883077521329,false,[[11,"answer"],[7,[2,""]]]],[8,72,null,262263313243855,false,[[1,[2,"currentAnswer"]],[13]]],[-1,73,null,815875123174103,false,[[0,[0,3]]]]]]]]]]],[["click.ogg",24620],["correct.ogg",60630],["error-010-206498.ogg",11425],["immersivecontrol-button-click-sound-463065.ogg",3830]],"media/",false,1200,1200,3,true,true,true,"1.0.0.0",true,false,3,0,25,false,true,1,true,"definition_spelling_sequence_sentence",0,[]]} \ No newline at end of file diff --git a/definition_spelling_sequence_sentence/images/5sosarahtakesoff-sheet0.png b/definition_spelling_sequence_sentence/images/5sosarahtakesoff-sheet0.png deleted file mode 100644 index 16015c4..0000000 Binary files a/definition_spelling_sequence_sentence/images/5sosarahtakesoff-sheet0.png and /dev/null differ diff --git a/definition_spelling_sequence_sentence/images/newwordpng-sheet0.png b/definition_spelling_sequence_sentence/images/newwordpng-sheet0.png deleted file mode 100644 index 739d176..0000000 Binary files a/definition_spelling_sequence_sentence/images/newwordpng-sheet0.png and /dev/null differ diff --git a/definition_spelling_sequence_sentence/images/wrong-sheet0.png b/definition_spelling_sequence_sentence/images/wrong-sheet0.png deleted file mode 100644 index e2ab7f7..0000000 Binary files a/definition_spelling_sequence_sentence/images/wrong-sheet0.png and /dev/null differ diff --git a/definition_spelling_sequence_sentence/index.html b/definition_spelling_sequence_sentence/index.html index 0df7d6f..b31e2a8 100644 --- a/definition_spelling_sequence_sentence/index.html +++ b/definition_spelling_sequence_sentence/index.html @@ -3,7 +3,7 @@ - Sequence + definition_spelling_sequence_sentence diff --git a/definition_spelling_sequence_sentence/offline.js b/definition_spelling_sequence_sentence/offline.js index a8486a7..59df82e 100644 --- a/definition_spelling_sequence_sentence/offline.js +++ b/definition_spelling_sequence_sentence/offline.js @@ -1,5 +1,5 @@ { - "version": 1769514386, + "version": 1772440087, "fileList": [ "data.js", "c2runtime.js", @@ -10,7 +10,6 @@ "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", @@ -22,7 +21,6 @@ "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", diff --git a/definition_spelling_sequence_sentence/sena_sdk.js b/definition_spelling_sequence_sentence/sena_sdk.js index 21eed1a..42bdc73 100644 --- a/definition_spelling_sequence_sentence/sena_sdk.js +++ b/definition_spelling_sequence_sentence/sena_sdk.js @@ -1,364 +1,582 @@ +/** + * ========== SENA SDK - MERGED COMPLETE VERSION ========== + * Combines all features from root, update_1, and update_2 + * - Advanced game type support (G1-G9, G26) + * - PostMessage handling with late arrival support + * - Multi-question and single-question modes + * - G4, G5, G9 specific implementations + * - Matching, WordSearch, GroupSort, Crossword, Puzzle support + */ + +/** + * ========== GAME TYPES CONFIG ========== + */ +var SENA_GAME_TYPES = { + 1: { name: 'Quiz', description: 'Trắc nghiệm' }, + 2: { name: 'Sort', description: 'Sắp xếp' }, + 3: { name: 'Match', description: 'Nối cặp', sdk: 'tdv_sdk' }, + 4: { name: 'Fill', description: 'Điền từ' }, + 5: { name: 'Custom', description: 'Tùy chỉnh' }, + 6: { name: 'OddOneOut', description: 'Chọn khác loại' }, + 7: { name: 'WordSearch', description: 'Tìm từ ẩn', sdk: 'tdv_wordsearch' }, + 8: { name: 'GroupSort', description: 'Phân loại nhóm', sdk: 'tdv_groupsort' }, + 9: { name: 'Crossword', description: 'Ô chữ', sdk: 'tdv_crossword' }, + 26: { name: 'Puzzle', description: 'Ghép hình', sdk: 'tdv_puzzle' } +}; + +// Helper: Get valid game type range +function getSenaGameTypeRange() { + var types = Object.keys(SENA_GAME_TYPES).map(Number); + return { min: Math.min.apply(null, types), max: Math.max.apply(null, types) }; +} + +// ========== STUBS FOR LAZY LOADING ========== +window.tdv_sdk = window.tdv_sdk || { + isStub: true, + init: function (mode) { + console.log('⚠️ tdv_sdk.init() called on Stub. Mode saved:', mode); + this._pendingMode = mode; + }, + prepareIDs: function () { }, + getItemCount: function () { return 0; }, + loadFromPostMessage: function () { console.warn('Stub loadFromPostMessage called'); }, + isCorrect: function () { return 0; }, + getCorrectCount: function () { return 0; }, + getTimeSpent: function () { return 0; } +}; + +// Helper: Regex for game code +function getSenaGameCodeRegex(strict) { + var range = getSenaGameTypeRange(); + var typePattern = '[' + range.min + '-' + range.max + ']'; + var qoPattern = strict ? '[0-2]' : '[0-9]'; + return new RegExp('^G(' + typePattern + ')([2-9])(' + qoPattern + ')(' + qoPattern + ')(?:S([0-1]))?(?:T(\\d+))?$'); +} + /** * Sena SDK Constructor - * @param {Object} config - Configuration object for the SDK - * @param {Object} config.data - Quiz data containing question, options, and answer */ function SenaSDK(gid = 'G2510S1T30') { - // Initialize data + // Core data this.data = null; this.correctAnswer = null; this.gameCode = gid; - // Initialize properties this.timeLimit = 0; this.shuffle = true; - // tracking time in game + this.uuid = Date.now() + '_' + Math.floor(Math.random() * 100000); + // Time tracking this.startTime = 0; this.endTime = 0; - // Initialize Web Speech API + + // TTS (Web Speech API) this.speechSynthesis = window.speechSynthesis; this.currentUtterance = null; this.voiceSettings = { lang: 'en-US', - rate: 1.0, // Speed (0.1 to 10) - pitch: 1.0, // Pitch (0 to 2) - volume: 1.0 // Volume (0 to 1) + rate: 1.0, + pitch: 1.0, + volume: 1.0 }; + + // Multi-question support + this.list = []; + this.currentQuestion = null; + this.level = 0; + this.totalQuestions = 0; + this.userResults = []; + this.gameID = null; + this.userId = null; + this.postMessageDataLoaded = false; + + // Game type flags + this.isMatchingGame = false; + this.isOddOneOutGame = false; + this.isWordSearchGame = false; + this.isGroupSortGame = false; + + // PostMessage tracking + this._postMessageListenerRegistered = false; + this._waitingForPostMessage = false; + this._postMessageTimeout = null; + this._loadCallback = null; + + // Interaction tracking + this._gameStartedByUser = false; + this._dataLoadedFromServer = false; + + // G5 specific + this.masterList = []; + this.currentLevel = 0; + this.totalLevels = 1; + this.timePerCard = 0; + + // Mode: 'live' | 'preview' | 'dev' + this.mode = 'preview'; } /** * Shuffle array using Fisher-Yates algorithm - * @param {Array} array - Array to shuffle */ -SenaSDK.prototype.shuffleArray = function(array) { +SenaSDK.prototype.shuffleArray = function (array) { for (let i = array.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [array[i], array[j]] = [array[j], array[i]]; } }; -SenaSDK.prototype.load = function(callback,template = 'G2510S1T30') { + +/** + * Load data from postMessage (SERVER_PUSH_DATA) + */ +SenaSDK.prototype.loadFromPostMessage = function (inputJson, callback) { let self = this; - // get parameter LID from URL + + if (!inputJson) { + console.error('🎮 Sena SDK: No data in postMessage'); + if (callback) callback(false); + return false; + } + + console.log('📦 Sena SDK: Loading from PostMessage:', inputJson); + + // Update gameCode if provided + if (inputJson.gameCode) { + self.gameCode = inputJson.gameCode; + } + + let gameCode = self.gameCode; + let gameCategory = gameCode.charAt(1); + + console.log('🎮 Sena SDK: GameCode:', gameCode, '| Category:', gameCategory); + + // ========== FORWARD TO SPECIALIZED SDKs ========== + + // Matching (G3xxx) + if (gameCategory === '3') { + console.log('🎯 Sena SDK: Detected MATCHING GAME (G3xxx), forwarding to tdv_sdk...'); + if (window.tdv_sdk && typeof window.tdv_sdk.loadFromPostMessage === 'function') { + self.isMatchingGame = true; + return window.tdv_sdk.loadFromPostMessage(inputJson, callback); + } else { + console.error('❌ tdv_sdk not loaded!'); + if (callback) callback(false); + return false; + } + } + + // WordSearch (G7xxx) + if (gameCategory === '7') { + console.log('🎯 Sena SDK: Detected WORDSEARCH GAME (G7xxx), forwarding to tdv_wordsearch...'); + if (window.tdv_wordsearch && typeof window.tdv_wordsearch.loadFromPostMessage === 'function') { + self.isWordSearchGame = true; + return window.tdv_wordsearch.loadFromPostMessage(inputJson, callback); + } else { + console.error('❌ tdv_wordsearch not loaded!'); + if (callback) callback(false); + return false; + } + } + + // GroupSort (G8xxx) + if (gameCategory === '8') { + console.log('🎯 Sena SDK: Detected GROUPSORT GAME (G8xxx), forwarding to tdv_groupsort...'); + if (window.tdv_groupsort && typeof window.tdv_groupsort.loadFromPostMessage === 'function') { + self.isGroupSortGame = true; + return window.tdv_groupsort.loadFromPostMessage(inputJson, callback); + } else { + console.error('❌ tdv_groupsort not loaded!'); + if (callback) callback(false); + return false; + } + } + + // Crossword (G9xxx) + if (gameCategory === '9') { + console.log('🎯 Sena SDK: Detected CROSSWORD GAME (G9xxx), forwarding to tdv_crossword...'); + if (window.tdv_crossword && typeof window.tdv_crossword.loadFromPostMessage === 'function') { + return window.tdv_crossword.loadFromPostMessage(inputJson, callback); + } else { + console.error('❌ tdv_crossword not loaded!'); + if (callback) callback(false); + return false; + } + } + + // Puzzle (G26xxx) + if (gameCategory === '2' && gameCode.charAt(2) === '6') { + console.log('🎯 Sena SDK: Detected PUZZLE GAME (G26xxx), forwarding to tdv_puzzle...'); + if (window.tdv_puzzle && typeof window.tdv_puzzle.loadFromPostMessage === 'function') { + return window.tdv_puzzle.loadFromPostMessage(inputJson, callback); + } else { + console.error('❌ tdv_puzzle not loaded!'); + if (callback) callback(false); + return false; + } + } + + // ========== BASIC GAMES (Quiz, Sort, OddOneOut, Fill, Custom) ========== + let items = inputJson.list || [inputJson]; + + // Cancel timeout if waiting + if (self._postMessageTimeout) { + clearTimeout(self._postMessageTimeout); + self._postMessageTimeout = null; + } + self._waitingForPostMessage = false; + + // Parse game code + self._parseGameCode(); + + if (items.length === 1) { + // Single question + let item = items[0]; + self.data = { + question: item.question || item.data?.question || '', + request: item.request || item.data?.request || '', + options: item.options || item.data?.options || [], + image: item.image || item.data?.image || '', + audio: item.audio || item.data?.audio || '', + hint: item.hint || item.data?.hint || null, + reason: item.reason || item.data?.reason || '' + }; + self.correctAnswer = item.answer; + self.gameID = item.id || null; + + // G5 specific: Initialize master list + if (self.gameType === 5 && self.data?.options) { + self.masterList = [...self.data.options]; + self.totalLevels = Math.ceil(self.masterList.length / self.itemCount); + self.currentLevel = 0; + self.loadLevelG5(1); + } + + // G4 specific: Process data + if (self.gameType === 4) { + self._processG4Data(); + } + } else { + // Multi-question + self.list = items.map((item, idx) => ({ + id: item.id || idx, + question: item.question || '', + request: item.request || '', + options: item.options || [], + answer: item.answer, + image: item.image || '', + audio: item.audio || '', + reason: item.reason || '' + })); + self.totalQuestions = items.length; + self.level = 0; + self._loadCurrentQuestionToData(); + } + + self.postMessageDataLoaded = true; + console.log('✅ Sena SDK: Data processed -', items.length, 'item(s)'); + + if (self._loadCallback) { + self._loadCallback(true); + self._loadCallback = null; + } + + if (callback) callback(true); + return true; +}; + +/** + * Parse game code to get settings + */ +SenaSDK.prototype._parseGameCode = function () { + let self = this; + const gameCode = self.gameCode || 'G2510S1T30'; + const regex = getSenaGameCodeRegex(true); + let match = gameCode.match(regex); + + if (match) { + self.gameType = parseInt(match[1], 10); + self.itemCount = parseInt(match[2], 10); + self.questionType = parseInt(match[3], 10); + self.optionType = parseInt(match[4], 10); + const shuffleFlag = match[5] !== undefined ? match[5] : '1'; + const timeStr = match[6] !== undefined ? match[6] : '0'; + self.shuffle = (shuffleFlag === '1'); + + // G5 uses T for time per card + if (self.gameType === 5) { + self.timePerCard = parseInt(timeStr, 10); + self.timeLimit = 0; + } else { + self.timeLimit = parseInt(timeStr, 10); + self.timePerCard = 0; + } + } +}; + +/** + * Load current question to this.data + */ +SenaSDK.prototype._loadCurrentQuestionToData = function () { + let self = this; + + if (self.list.length > 0 && self.level < self.list.length) { + self.currentQuestion = self.list[self.level]; + self.data = { + question: self.currentQuestion.question || '', + request: self.currentQuestion.request || '', + options: self.currentQuestion.options || [], + image: self.currentQuestion.image || '', + audio: self.currentQuestion.audio || '', + reason: self.currentQuestion.reason || '' + }; + self.correctAnswer = self.currentQuestion.answer; + } +}; + +/** + * Move to next question + */ +SenaSDK.prototype.nextQuestion = function () { + let self = this; + + if (self.level < self.totalQuestions - 1) { + self.level++; + self._loadCurrentQuestionToData(); + console.log('🎮 Sena SDK: Next Question:', self.level + 1, '/', self.totalQuestions); + return true; + } + + console.log('🎮 Sena SDK: No more questions'); + return false; +}; + +/** + * Get current question number (1-indexed) + */ +SenaSDK.prototype.getCurrentNumber = function () { + return this.level + 1; +}; + +/** + * Get total questions + */ +SenaSDK.prototype.getTotalQuestions = function () { + return this.totalQuestions || 1; +}; + +// PostMessage timeout setting +SenaSDK.prototype.POSTMESSAGE_TIMEOUT_MS = 5000; // 5 seconds + +/** + * Load data (with mode support) + */ +SenaSDK.prototype.load = function (callback, template = 'G2510S1T30') { + let self = this; + + // Auto-register postMessage listener + if (!self._postMessageListenerRegistered) { + self.registerPostMessageListener(); + self._postMessageListenerRegistered = true; + } + + // Already loaded from postMessage + if (self.postMessageDataLoaded && self.list.length > 0) { + console.log('🎮 Sena SDK: Data already loaded from postMessage'); + if (callback) callback(true); + return; + } + + // Already have data + if (self.data && self.data.options) { + console.log('🎮 Sena SDK: Data already available'); + if (callback) callback(true); + return; + } + + // Get URL parameters const urlParams = new URLSearchParams(window.location.search); const LID = urlParams.get('LID'); if (LID) { self.gameCode = LID; + } + + const urlMode = urlParams.get('mode'); + if (urlMode && ['live', 'preview', 'dev'].includes(urlMode.toLowerCase())) { + self.mode = urlMode.toLowerCase(); + } + + console.log('🎮 Sena SDK: Mode =', self.mode.toUpperCase(), '| GameCode =', self.gameCode); + + self._loadCallback = callback; + + // Mode-based loading + switch (self.mode) { + case 'live': + self._waitingForPostMessage = true; + console.log('⏳ Sena SDK: [LIVE MODE] Waiting for server data (no timeout)...'); + self._sendGameReady(); + break; + + case 'dev': + console.log('🔧 Sena SDK: [DEV MODE] Loading sample data immediately...'); + self._waitingForPostMessage = false; + self._loadFromServer(callback, template); + break; + + case 'preview': + default: + self._waitingForPostMessage = true; + console.log('⏳ Sena SDK: [PREVIEW MODE] Waiting for postMessage (5s timeout)...'); + + self._postMessageTimeout = setTimeout(function () { + if (self._waitingForPostMessage && !self.postMessageDataLoaded) { + console.warn('⚠️ Sena SDK: No postMessage received, fallback to sample data...'); + self._loadFromServer(self._loadCallback, template); + } + }, self.POSTMESSAGE_TIMEOUT_MS); + break; + } +}; + +/** + * Send GAME_READY message + */ +SenaSDK.prototype._sendGameReady = function () { + let self = this; + window.parent.postMessage({ + type: "GAME_READY", + uuid: self.uuid, + payload: { + game_id: self.gameID || self.gameCode, + game_code: self.gameCode, + mode: self.mode + } + }, "*"); + console.log('📤 Sena SDK: Sent GAME_READY to parent'); + console.log('🔑 UUID:', self.uuid); +}; + +/** + * Load from server (fallback) + */ +SenaSDK.prototype._loadFromServer = function (callback, template = 'G2510S1T30') { + let self = this; + self._waitingForPostMessage = false; + + let url = `https://senaai.tech/sample/${self.gameCode}.json`; + console.log('📡 Sena SDK: Fetching sample from:', url); + + fetch(url) + .then(response => { + if (!response.ok) throw new Error("HTTP " + response.status); + return response.json(); + }) + .then(jsonData => { + console.log('✅ Sena SDK: Fetched data success'); + + self.loadFromPostMessage(jsonData); + self._dataLoadedFromServer = true; + }) + .catch(error => { + console.error('❌ Sena SDK: Error loading data:', error); + if (self.mode === 'dev') { + self._loadHardcodedFallback(callback); + } else { + if (callback) callback(false); + } + }); +}; + +/** + * Hardcoded fallback (for dev mode when fetch fails) + */ +SenaSDK.prototype._loadHardcodedFallback = function (callback) { + let self = this; + console.warn('⚠️ Sena SDK: Using HARDCODED fallback data'); + + let fallbackJson = { + gameCode: self.gameCode, + data: { + question: "What is 2 + 2?", + options: ["3", "4", "5", "6"] + }, + answer: "4" }; - fetch(`https://senaai.tech/sample/${self.gameCode}.json`) - .then(response => response.json()) - .then(data => { - self.data = data.data; - self.correctAnswer = data.answer || null; - // based on game code, set timeLimit and shuffle - const gameCode = self.gameCode || template; - const regex = /^G([1-5])([2-9])([0-2])([0-2])(?:S([0-1]))?(?:T(\d+))?$/; - const match = gameCode.match(regex); - if (match) { - const shuffleFlag = match[5] !== undefined ? match[5] : '1'; - const timeStr = match[6] !== undefined ? match[6] : '0'; - self.shuffle = (shuffleFlag === '1'); - self.timeLimit = parseInt(timeStr, 10); - } - if (callback) callback(true); - }) - .catch(error => { - console.error('Error loading LID data:', error); - if (callback) callback(false); - }); + + self.loadFromPostMessage(fallbackJson, callback); }; + /** - * Generate comprehensive developer guide based on game code - * @returns {string} Developer guide with implementation instructions + * Validate game code */ -SenaSDK.prototype.guide = function() { +SenaSDK.prototype.validateGameCode = function (code) { + code = code || this.gameCode; + const regex = getSenaGameCodeRegex(true); + const match = code.match(regex); + const range = getSenaGameTypeRange(); + + if (!match) { + return { valid: false, error: 'Invalid game code format', code: code }; + } + + return { + valid: true, + code: code, + type: parseInt(match[1], 10), + count: parseInt(match[2], 10), + qType: parseInt(match[3], 10), + oType: parseInt(match[4], 10), + shuffle: match[5] !== '0', + time: match[6] ? parseInt(match[6], 10) : 0, + description: this.getGameCodeDescription(match) + }; +}; + +/** + * Get game code description + */ +SenaSDK.prototype.getGameCodeDescription = function (match) { + if (!match) return ''; + + const gameType = SENA_GAME_TYPES[match[1]]?.name || 'Unknown'; + const contentTypes = ['Text', 'Image', 'Audio']; + const qType = contentTypes[parseInt(match[3])] || 'Unknown'; + const oType = contentTypes[parseInt(match[4])] || 'Unknown'; + + return `${gameType}: ${match[2]} items, ${qType} → ${oType}`; +}; + +/** + * Generate developer guide + */ +SenaSDK.prototype.guide = function () { let self = this; const gameCode = self.gameCode || 'G2510S1T30'; - const data = self.data || {}; - - /** - * Regex giải thích: - * ^G([1-5])([2-9])([0-2])([0-2]) : Bắt buộc (Loại, Số lượng, Q, O) - * (?:S([0-1]))? : Không bắt buộc, mặc định S1 - * (?:T(\d+))? : Không bắt buộc, mặc định T0 - */ - const regex = /^G([1-5])([2-9])([0-2])([0-2])(?:S([0-1]))?(?:T(\d+))?$/; - const match = gameCode.match(regex); - - if (!match) return "Mã game không hợp lệ! Định dạng chuẩn: Gxxxx hoặc GxxxxSxTxx"; - - const category = match[1]; - const count = match[2]; - const qIdx = match[3]; - const oIdx = match[4]; - const shuffle = match[5] !== undefined ? match[5] : '1'; - const time = match[6] !== undefined ? match[6] : '0'; - - const types = { '0': 'Text', '1': 'Image', '2': 'Audio' }; - let guide = ''; - - // Header - guide += `╔════════════════════════════════════════════════════════════════════════════╗\n`; - guide += `║ SENA SDK - DEVELOPER GUIDE: ${gameCode.padEnd(37)}║\n`; - guide += `╚════════════════════════════════════════════════════════════════════════════╝\n\n`; - - // Game Analysis - guide += `📊 GAME ANALYSIS\n`; - guide += `━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n`; - - let gameName = '', instruction = '', displayMode = ''; - switch(category) { - case '1': - gameName = "Quiz (Trắc nghiệm)"; - instruction = `Người dùng chọn 1 đáp án đúng trong ${count} options`; - displayMode = `Question: ${types[qIdx]} → Options: ${types[oIdx]}`; - break; - case '2': - if (qIdx === '0' && oIdx === '0') { - gameName = "Sort Word (Sắp xếp từ)"; - instruction = `Sắp xếp ${count} từ/ký tự thành chuỗi hoàn chỉnh`; - } else { - gameName = "Sequences (Sắp xếp chuỗi)"; - instruction = `Sắp xếp ${count} items theo đúng thứ tự`; - } - displayMode = `Hint: ${types[qIdx]} → Items: ${types[oIdx]}`; - break; - case '3': - if (qIdx === oIdx) { - gameName = "Memory Card (Trí nhớ)"; - instruction = `Lật và ghép ${count} cặp thẻ giống nhau`; - } else { - gameName = "Matching (Nối cặp)"; - instruction = `Nối ${count} items từ 2 nhóm với nhau`; - } - displayMode = `Group A: ${types[qIdx]} ↔ Group B: ${types[oIdx]}`; - break; - } + return `╔════════════════════════════════════════════════════════════════════════════╗ +║ SENA SDK - DEVELOPER GUIDE: ${gameCode.padEnd(37)}║ +╚════════════════════════════════════════════════════════════════════════════╝ - guide += `Game Type : ${gameName}\n`; - guide += `Objective : ${instruction}\n`; - guide += `Display Mode : ${displayMode}\n`; - guide += `Items Count : ${count}\n`; - guide += `Shuffle : ${shuffle === '1' ? 'YES (call sdk.start() to shuffle)' : 'NO (S0)'}\n`; - guide += `Time Limit : ${time === '0' ? 'Unlimited' : time + ' seconds'}\n`; - - if (data.hint && data.hint.type) { - guide += `Hint Type : ${data.hint.type}\n`; - guide += `Hint Count : ${Array.isArray(data.hint.value) ? data.hint.value.length : '1'}\n`; - } +📚 MERGED VERSION +This SDK combines all game types (G1-G9, G26) with full postMessage support. - guide += `\n🔧 IMPLEMENTATION STEPS\n`; - guide += `━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n`; +🎮 SUPPORTED GAME TYPES: +${Object.entries(SENA_GAME_TYPES).map(([key, val]) => ` G${key}: ${val.name} - ${val.description}`).join('\n')} - // Step 1: Initialize - guide += `1️⃣ INITIALIZE SDK\n`; - guide += ` var sdk = new SenaSDK('${gameCode}');\n`; - guide += ` sdk.load(function(success) {\n`; - guide += ` if (success) sdk.start();\n`; - guide += ` });\n\n`; - - // Step 2: Display based on game type - guide += `2️⃣ DISPLAY UI\n`; - - if (category === '1') { - // Quiz - guide += ` // Display Question\n`; - if (qIdx === '0') { - guide += ` var questionText = sdk.getQuestionValue();\n`; - guide += ` displayText(questionText); // Show text\n`; - } else if (qIdx === '1') { - guide += ` var questionImg = sdk.getQuestionValue();\n`; - guide += ` displayImage(questionImg); // Show image URL\n`; - } else if (qIdx === '2') { - guide += ` sdk.playVoice('question'); // Auto play audio\n`; - } - - guide += `\n // Display Options\n`; - guide += ` var optionsCount = sdk.getOptionsCount(); // ${count} items\n`; - guide += ` for (var i = 0; i < optionsCount; i++) {\n`; - if (oIdx === '0') { - guide += ` var optionText = sdk.getOptionsValue(i).text;\n`; - guide += ` createButton(optionText, i); // Show text button\n`; - } else if (oIdx === '1') { - guide += ` var optionImg = sdk.getOptionsValue(i).image;\n`; - guide += ` createImageButton(optionImg, i); // Show image button\n`; - } else if (oIdx === '2') { - guide += ` createAudioButton(i); // Button to play audio\n`; - guide += ` // onClick: sdk.playVoice('option' + (i+1));\n`; - } - guide += ` }\n`; - - } else if (category === '2') { - // Sort/Sequences - guide += ` // Display Hint (if exists)\n`; - if (qIdx === '0') { - guide += ` var hintText = sdk.getQuestionValue() || sdk.getRequestValue();\n`; - guide += ` if (hintText) displayHint(hintText);\n`; - } else if (qIdx === '1') { - guide += ` var hintImg = sdk.getQuestionValue();\n`; - guide += ` if (hintImg) displayHintImage(hintImg);\n`; - } - - guide += `\n // Display Draggable Items\n`; - guide += ` var itemsCount = sdk.getOptionsCount();\n`; - guide += ` for (var i = 0; i < itemsCount; i++) {\n`; - if (oIdx === '0') { - guide += ` var itemText = sdk.getOptionsValue(i).text;\n`; - guide += ` createDraggableText(itemText, i);\n`; - } else if (oIdx === '1') { - guide += ` var itemImg = sdk.getOptionsValue(i).image;\n`; - guide += ` createDraggableImage(itemImg, i);\n`; - } - guide += ` }\n`; - guide += ` // User drags to reorder items\n`; - - } else if (category === '3') { - // Memory/Matching - guide += ` var itemsCount = sdk.getOptionsCount();\n`; - if (qIdx === oIdx) { - guide += ` // Memory Card - Create pairs\n`; - guide += ` var allCards = []; // Duplicate items for pairs\n`; - guide += ` for (var i = 0; i < itemsCount; i++) {\n`; - guide += ` allCards.push(sdk.getOptionsValue(i));\n`; - guide += ` allCards.push(sdk.getOptionsValue(i)); // Duplicate\n`; - guide += ` }\n`; - guide += ` shuffleArray(allCards);\n`; - guide += ` // Create face-down cards, flip on click\n`; - } else { - guide += ` // Matching - Create two groups\n`; - guide += ` for (var i = 0; i < itemsCount; i++) {\n`; - if (qIdx === '0') { - guide += ` var leftText = sdk.getOptionsValue(i).text;\n`; - guide += ` createLeftItem(leftText, i);\n`; - } else if (qIdx === '1') { - guide += ` var leftImg = sdk.getOptionsValue(i).image;\n`; - guide += ` createLeftItem(leftImg, i);\n`; - } - if (oIdx === '0') { - guide += ` var rightText = sdk.getOptionsValue(i).text; // Matching pair\n`; - guide += ` createRightItem(rightText, i);\n`; - } else if (oIdx === '1') { - guide += ` var rightImg = sdk.getOptionsValue(i).image;\n`; - guide += ` createRightItem(rightImg, i);\n`; - } - guide += ` }\n`; - guide += ` // User draws lines to match pairs\n`; - } - } - - // Step 3: Handle Hint - if (data.hint && data.hint.type) { - guide += `\n3️⃣ HANDLE HINT (Optional)\n`; - guide += ` var hintType = sdk.getHintType(); // "${data.hint.type}"\n`; - if (data.hint.type === 'display') { - guide += ` var hintCount = sdk.getHintCount();\n`; - guide += ` for (var i = 0; i < hintCount; i++) {\n`; - guide += ` var hintItem = sdk.getHintValue(i);\n`; - guide += ` displayHintItem(hintItem, i); // Show each hint\n`; - guide += ` }\n`; - } else if (data.hint.type === 'audio') { - guide += ` var hintAudio = sdk.getHintValue();\n`; - guide += ` createHintButton(hintAudio); // Play audio hint\n`; - } else if (data.hint.type === 'text') { - guide += ` var hintText = sdk.getHintValue();\n`; - guide += ` displayHintText(hintText);\n`; - } - } - - // Step 4: Check Answer - const stepNum = data.hint ? '4️⃣' : '3️⃣'; - guide += `\n${stepNum} CHECK ANSWER\n`; - - if (category === '1') { - guide += ` // User clicks an option\n`; - guide += ` function onOptionClick(selectedIndex) {\n`; - guide += ` var userAnswer = sdk.getOptionsValue(selectedIndex).text;\n`; - guide += ` var result = sdk.end(userAnswer, function(isCorrect) {\n`; - guide += ` if (isCorrect) showSuccess();\n`; - guide += ` else showError();\n`; - guide += ` });\n`; - guide += ` }\n`; - } else if (category === '2') { - guide += ` // User finishes sorting\n`; - guide += ` function onSubmitOrder(orderedArray) {\n`; - guide += ` var answerStr = orderedArray.map(item => item.text).join('|');\n`; - guide += ` sdk.end(answerStr, function(isCorrect) {\n`; - guide += ` if (isCorrect) showSuccess();\n`; - guide += ` else showCorrectOrder();\n`; - guide += ` });\n`; - guide += ` }\n`; - } else if (category === '3') { - guide += ` // User completes all matches/pairs\n`; - guide += ` function onAllMatched(matchedPairs) {\n`; - guide += ` var answerStr = matchedPairs.map(p => p.text).join('|');\n`; - guide += ` sdk.end(answerStr, function(isCorrect) {\n`; - guide += ` showResult(isCorrect);\n`; - guide += ` });\n`; - guide += ` }\n`; - } - - // Step 5: Timer - if (time !== '0') { - const nextStep = data.hint ? '5️⃣' : '4️⃣'; - guide += `\n${nextStep} TIMER COUNTDOWN\n`; - guide += ` var timeLimit = sdk.timeLimit; // ${time} seconds\n`; - guide += ` startCountdown(timeLimit);\n`; - guide += ` // If time runs out before sdk.end(), user fails\n`; - } - - // API Reference - guide += `\n\n📚 KEY API METHODS\n`; - guide += `━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n`; - guide += `sdk.load(callback, template) - Load data from server\n`; - guide += `sdk.start() - Start game, shuffle if needed\n`; - guide += `sdk.getQuestionValue() - Get question text/image/audio\n`; - guide += `sdk.getQuestionType() - Get question type (text/image/audio)\n`; - guide += `sdk.getOptionsCount() - Get number of options\n`; - guide += `sdk.getOptionsValue(index) - Get option object at index\n`; - guide += `sdk.getOptionsType() - Get options type\n`; - guide += `sdk.getHintType() - Get hint type\n`; - guide += `sdk.getHintValue(index) - Get hint value/array item\n`; - guide += `sdk.getHintCount() - Get hint items count\n`; - guide += `sdk.playVoice(type) - Play TTS (question/option1/hint)\n`; - guide += `sdk.end(answer, callback) - Check answer & return result\n`; - guide += `sdk.timeLimit - Time limit in seconds\n`; - guide += `sdk.shuffle - Whether to shuffle options\n`; - - guide += `\n\n💡 TIPS\n`; - guide += `━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n`; - if (shuffle === '1') { - guide += `• Options are shuffled after sdk.start() - display in new order\n`; - } - if (time !== '0') { - guide += `• Implement timer UI and auto-submit when time expires\n`; - } - guide += `• Use Web Speech API: sdk.playVoice() for TTS in English\n`; - guide += `• Multiple answers format: "answer1|answer2|answer3"\n`; - guide += `• sdk.end() returns: {isCorrect, duration, correctAnswer, userAnswer}\n`; - - guide += `\n${'═'.repeat(76)}\n`; - - return guide; +📖 For detailed documentation, visit: https://senaai.tech/docs +`; }; -/** - * Get the question text - * @returns {string} Question or request text - */ -SenaSDK.prototype.getQuestionValue = function() { - if (this.data.question && this.data.question !== "") { - return this.data.question; - } else { - return ""; - } + +// ========== GETTERS ========== + +SenaSDK.prototype.getQuestionValue = function () { + var q = String(this.data?.question || '').trim(); + if (q.toLowerCase().startsWith('http')) return ''; + return q; }; -/** - * Get the question type - * @returns {string} Question type (text, image, audio) - */ -SenaSDK.prototype.getQuestionType = function() { + +SenaSDK.prototype.getQuestionType = function () { let self = this; - // based on game code, determine question type const gameCode = self.gameCode || 'G2510S1T30'; - const regex = /^G([1-5])([2-9])([0-2])([0-2])(?:S([0-1]))?(?:T(\d+))?$/; + const regex = getSenaGameCodeRegex(true); const match = gameCode.match(regex); if (match) { const qIdx = match[3]; @@ -368,43 +586,26 @@ SenaSDK.prototype.getQuestionType = function() { return 'text'; }; -/** - * Get the request value - * @returns {string} Request text - */ -SenaSDK.prototype.getRequestValue = function() { - if (this.data && this.data.request && this.data.request !== "") { - return this.data.request; - } else { - return ""; - } +SenaSDK.prototype.getQuestionImage = function () { + return String(this.data?.question || '').trim(); }; -/** - * Get the request type (same as question type) - * @returns {string} Request type (text, image, audio) - */ -SenaSDK.prototype.getRequestType = function() { +SenaSDK.prototype.getRequestValue = function () { + return String(this.data?.request || '').trim(); +}; + +SenaSDK.prototype.getRequestType = function () { return this.getQuestionType(); }; -/** - * Get total number of options - * @returns {number} Number of options - */ -SenaSDK.prototype.getOptionsCount = function() { - return this.data.options.length; +SenaSDK.prototype.getOptionsCount = function () { + return this.data?.options?.length || 0; }; -/** - * Get options type based on game code - * @returns {string} Options type (text, image, audio) - */ -SenaSDK.prototype.getOptionsType = function() { +SenaSDK.prototype.getOptionsType = function () { let self = this; - // based on game code, determine options type const gameCode = self.gameCode || 'G2510S1T30'; - const regex = /^G([1-5])([2-9])([0-2])([0-2])(?:S([0-1]))?(?:T(\d+))?$/; + const regex = getSenaGameCodeRegex(true); const match = gameCode.match(regex); if (match) { const oIdx = match[4]; @@ -413,95 +614,272 @@ SenaSDK.prototype.getOptionsType = function() { } return 'text'; }; -/** - * Get option value by index based on options type from game code - * @param {number} index - Option index - * @returns {string} Option value (text, image URL, or audio URL based on game code) - */ -SenaSDK.prototype.getOptionsValue = function(index) { - return this.data.options[index]; + +SenaSDK.prototype.getOptionsValue = function (index) { + return this.data?.options?.[index]; }; -/** - * Get hint type - * @returns {string} Hint type (e.g., 'display', 'audio', 'text', or empty string if no hint) - */ -SenaSDK.prototype.getHintType = function() { - if (this.data && this.data.hint && this.data.hint.type) { - return this.data.hint.type; - } - return ""; +SenaSDK.prototype.getHintType = function () { + return this.data?.hint?.type || ''; }; -/** - * Get hint count (number of elements if hint is an array, particularly for display type) - * @returns {number} Number of elements in hint array, or 1 if not an array, or 0 if no hint - */ -SenaSDK.prototype.getHintCount = function() { +SenaSDK.prototype.getHintCount = function () { const hintValue = this.getHintValue(); - if (hintValue === null) { - return 0; - } - if (Array.isArray(hintValue)) { - return hintValue.length; - } + if (hintValue === null) return 0; + if (Array.isArray(hintValue)) return hintValue.length; return 1; }; -/** - * Get hint value - * @param {number} index - Optional index for array hints (display type) - * @returns {*} Hint value (string, array element, or null if no hint) - */ -SenaSDK.prototype.getHintValue = function(index) { - if (this.data && this.data.hint && this.data.hint.value !== undefined) { +SenaSDK.prototype.getHintValue = function (index) { + if (this.data?.hint?.value !== undefined) { const hintValue = this.data.hint.value; const hintType = this.getHintType(); - // If hint type is display and value is array, return specific index if (hintType === 'display' && Array.isArray(hintValue)) { if (index !== undefined && index >= 0 && index < hintValue.length) { return hintValue[index]; } - // If no index provided or invalid, return the whole array return hintValue; } - // For audio or text type, return the value directly return hintValue; } return null; }; -/** - * Start the quiz - resets index and shuffles options - */ -SenaSDK.prototype.start = function() { +SenaSDK.prototype.getReason = function () { + return this.data?.reason || this.currentQuestion?.reason || ''; +}; + +SenaSDK.prototype.hasReason = function () { + let reason = this.getReason(); + return (reason && reason.length > 0) ? 1 : 0; +}; + +// ========== G9 MEMORY FUNCTIONS ========== + +SenaSDK.prototype.getTargetName = function () { + if (this.correctAnswer) { + if (typeof this.correctAnswer === 'object' && this.correctAnswer.text) { + return this.correctAnswer.text; + } + return String(this.correctAnswer); + } + return ''; +}; + +SenaSDK.prototype.getCardName = function (index) { + if (this.data?.options?.[index]) { + let opt = this.data.options[index]; + return opt.name || opt.text || ''; + } + return ''; +}; + +SenaSDK.prototype.getCardImage = function (index) { + return this.data?.options?.[index]?.image || ''; +}; + +SenaSDK.prototype.getCardAudio = function (index) { + return this.data?.options?.[index]?.audio || ''; +}; + +SenaSDK.prototype.getCardID = function (index) { + return this.data?.options?.[index]?.id || ''; +}; + +SenaSDK.prototype.getCardType = function (index) { + if (this.data?.options?.[index]) { + return this.data.options[index].type || 'text'; + } + if (this.masterList?.[index]) { + return this.masterList[index].type || 'text'; + } + return 'text'; +}; + +// ========== G5 VOICE RUSH FUNCTIONS ========== + +SenaSDK.prototype.loadLevelG5 = function (levelIndex) { let self = this; - self.curIndex = 0; + if (self.gameType !== 5 || !self.masterList) return false; + + self.currentLevel = levelIndex; + let count = self.itemCount; + window.Sena_TotalLevels = Math.ceil(self.masterList.length / count); + + let startIndex = (levelIndex - 1) * count; + let endIndex = Math.min(startIndex + count, self.masterList.length); + let levelOptions = self.masterList.slice(startIndex, endIndex); + + self.data.options = levelOptions; + + console.log(`🎮 Sena SDK: Loaded G5 Level ${levelIndex} with ${levelOptions.length} cards`); + return true; +}; + +SenaSDK.prototype.getTotalLevels = function () { + return this.totalLevels || 1; +}; + +SenaSDK.prototype.getTimePerCard = function () { + if (this.timePerCard === undefined) { + this._parseGameCode(); + } + return this.timePerCard > 0 ? this.timePerCard : 5; +}; + +// ========== G4 MEMORY CARD FUNCTIONS ========== + +SenaSDK.prototype._processG4Data = function () { + let self = this; + if (!self.data.options) self.data.options = []; + + // Count occurrences + let counts = {}; + self.data.options.forEach(item => { + if (item.type !== 'blank' && item.name) { + counts[item.name] = (counts[item.name] || 0) + 1; + } + }); + + // Remove orphans (items that appear less than 2 times) + self.data.options.forEach(item => { + if (item.type !== 'blank' && item.name && counts[item.name] < 2) { + console.log('🎮 Sena SDK: Orphan card detected:', item.name); + item.type = 'blank'; + item.name = 'blank'; + item.image = ''; + item.id = 'blank_sanitized'; + } + }); + + // Fill with blank cards to make 9 total + while (self.data.options.length < 9) { + self.data.options.push({ + id: 'blank_' + self.data.options.length, + type: 'blank', + name: 'blank', + value: -1, + image: '' + }); + } + + // Shuffle if (self.shuffle) { self.shuffleArray(self.data.options); } - self.startTime = Date.now(); - // Additional logic for tracking can be added here if needed }; -/** - * End the game and check answer - * @param {string} answer - User's answer (single text or multiple answers separated by |) - * @returns {Object} Result object with isCorrect, duration, correctAnswer, and userAnswer - */ -SenaSDK.prototype.end = function(answer , callback) { + +SenaSDK.prototype.checkPair = function (idx1, idx2, callback) { let self = this; + + let card1 = self.data?.options?.[idx1]; + let card2 = self.data?.options?.[idx2]; + + if (!card1 || !card2) { + if (callback) callback(false); + return; + } + + let isMatch = false; + + if (card1.type !== 'blank' && card2.type !== 'blank') { + if (card1.id !== card2.id) { + if (card1.name && card2.name && card1.name.toLowerCase() === card2.name.toLowerCase()) { + isMatch = true; + } + } + } + + console.log(`🎮 Sena SDK: Check Pair [${idx1}] vs [${idx2}] -> ${isMatch ? 'MATCH' : 'WRONG'}`); + + if (callback) callback(isMatch); +}; + +// ========== GAME ACTIONS ========== + +SenaSDK.prototype.start = function () { + let self = this; + + // Forward to specialized SDKs + if (self.isMatchingGame && window.tdv_sdk?.start) { + console.log('🎮 Sena SDK: Forwarding start() to tdv_sdk'); + window.tdv_sdk.start(); + return; + } + + // Standard games + self.curIndex = 0; + if (self.shuffle && self.data?.options) { + self.shuffleArray(self.data.options); + } + self.startTime = Date.now(); +}; + +SenaSDK.prototype.markUserInteraction = function () { + if (!this._gameStartedByUser) { + this._gameStartedByUser = true; + console.log('🎮 Sena SDK: User interaction detected'); + + if (this.isMatchingGame && window.tdv_sdk) { + window.tdv_sdk._gameStartedByUser = true; + } + } +}; + +SenaSDK.prototype.canReloadData = function () { + return !this._gameStartedByUser; +}; + +SenaSDK.prototype.end = function (answer, callback) { + let self = this; + const category = self.gameCode ? self.gameCode.charAt(1) : ''; + + // ========== FORWARD TO SPECIALIZED SDKs ========== + + // Crossword (G9) + if (category === '9' && window.tdv_crossword) { + let isCorrect = (window.tdv_crossword.placedCount >= window.tdv_crossword.totalCells); + let duration = window.tdv_crossword.getTimeSpent?.() || 0; + + console.log(`🎮 Sena SDK: Crossword Result: ${isCorrect ? 'WIN' : 'LOSE'}`); + + if (callback) callback(isCorrect); + return { isCorrect, duration }; + } + + // Matching/GroupSort (G3/G8) + if ((category === '8' || category === '3' || self.isMatchingGame) && window.tdv_sdk) { + console.log('🎮 Sena SDK: Forwarding end() to tdv_sdk'); + + let isCorrect = false; + let duration = 0; + + if (String(answer || '').includes(':') && category === '8') { + isCorrect = self.validateCheck(answer); + } else { + isCorrect = window.tdv_sdk.isCorrect?.() === 1; + } + + duration = window.tdv_sdk.getTimeSpent?.() || 0; + + if (callback) callback(isCorrect); + return { isCorrect, duration }; + } + + // ========== STANDARD GAMES (Quiz/Sort/Fill) ========== + self.endTime = Date.now(); const duration = (self.endTime - self.startTime) / 1000; - - // Parse user answer - split by | for multiple answers - const userAnswers = answer.includes('|') ? answer.split('|').map(a => a.trim().toLowerCase()) : [answer.trim().toLowerCase()]; - - // Get correct answer(s) from data + + const answerStr = String(answer || ''); + const userAnswers = answerStr.includes('|') + ? answerStr.split('|').map(a => a.trim().toLowerCase()).filter(a => a) + : [answerStr.trim().toLowerCase()].filter(a => a); + let correctAnswers = []; if (self.correctAnswer) { - // Check if answer is an array (multiple answers) or single answer if (Array.isArray(self.correctAnswer)) { correctAnswers = self.correctAnswer.map(a => { if (typeof a === 'string') return a.toLowerCase(); @@ -509,42 +887,110 @@ SenaSDK.prototype.end = function(answer , callback) { return ''; }); } else if (typeof self.correctAnswer === 'string') { - correctAnswers = [self.correctAnswer.toLowerCase()]; + correctAnswers = self.correctAnswer.includes('|') + ? self.correctAnswer.split('|').map(a => a.trim().toLowerCase()) + : [self.correctAnswer.toLowerCase()]; } else if (self.correctAnswer.text) { correctAnswers = [self.correctAnswer.text.toLowerCase()]; } } - - // Check if answer is correct + + // Compare answers + const isStrictOrder = self.gameType === 2; // Sort game + const finalUser = isStrictOrder ? [...userAnswers] : [...userAnswers].sort(); + const finalCorrect = isStrictOrder ? [...correctAnswers] : [...correctAnswers].sort(); + let isCorrect = false; - if (userAnswers.length === correctAnswers.length) { - // For ordered multiple answers - isCorrect = userAnswers.every((ans, index) => ans === correctAnswers[index]); - } else if (userAnswers.length === 1 && correctAnswers.length === 1) { - // For single answer - isCorrect = userAnswers[0] === correctAnswers[0]; - } - const result = { - isCorrect: isCorrect, - duration: duration, - correctAnswer: correctAnswers.join(' | '), - userAnswer: userAnswers.join(' | ') + const getFileName = (url) => { + if (!url.startsWith('http')) return url; + return url.split('/').pop().split('?')[0]; }; - // if time spent more than time limit, mark as incorrect - if (self.timeLimit > 0 && duration > self.timeLimit) { - result.isCorrect = false; + + if (finalUser.length === finalCorrect.length) { + isCorrect = finalUser.every((uVal, index) => { + let cVal = finalCorrect[index]; + if (uVal === cVal) return true; + if (uVal.startsWith('http') || cVal.startsWith('http')) { + return getFileName(uVal) === getFileName(cVal); + } + return false; + }); } - console.log(`Time spent in game: ${duration} seconds`); - console.log(`Result: ${isCorrect ? 'CORRECT' : 'INCORRECT'}`); - if (callback) callback(result.isCorrect); + + // Check time limit + if (self.timeLimit > 0 && duration > self.timeLimit) { + isCorrect = false; + console.log('🎮 Sena SDK: Time limit exceeded'); + } + + const result = { + isCorrect: isCorrect, + duration: duration, + correctAnswer: correctAnswers.join(' | '), + userAnswer: userAnswers.join(' | ') }; -SenaSDK.prototype.playVoice = function(type) { + console.log(`🎮 Sena SDK: Result: ${isCorrect ? 'CORRECT' : 'INCORRECT'} (${duration}s)`); + + window.parent.postMessage( + { + type: "GAME_RESULT", + uuid: self.uuid, + payload: { + game_id: self.gameID || self.gameCode, + result: isCorrect ? "CORRECT" : "INCORRECT", + time_spent: duration + } + }, + "*" + ); + + console.log("📤 Sena SDK: GAME_RESULT sent successfully"); + + if (callback) callback(result.isCorrect); + return result; +}; + +SenaSDK.prototype.validateCheck = function (answer) { + let self = this; + const answerStr = String(answer || ''); + const userAnswers = answerStr.includes('|') + ? answerStr.split('|').map(a => a.trim().toLowerCase()) + : [answerStr.trim().toLowerCase()]; + + let correctAnswers = []; + if (self.correctAnswer) { + if (Array.isArray(self.correctAnswer)) { + correctAnswers = self.correctAnswer.map(a => { + if (typeof a === 'string') return a.toLowerCase(); + if (a.hasOwnProperty('left') && a.hasOwnProperty('right')) { + return (String(a.left) + ':' + String(a.right)).toLowerCase(); + } + return ''; + }); + } + } + + // Partial check for GroupSort + if (userAnswers.length === 1 && correctAnswers.length > 1) { + return correctAnswers.includes(userAnswers[0]); + } + + // Full check + if (userAnswers.length === correctAnswers.length) { + return userAnswers.every((ans, index) => ans === correctAnswers[index]); + } + + return false; +}; + +// ========== AUDIO ========== + +SenaSDK.prototype.playVoice = function (type) { let self = this; - // type: 'question', 'optionA', 'optionB', ... - // if type is options, get corresponding option text like option0 -> index 0 let textToSpeak = ''; + if (type.startsWith('option')) { const optionIndex = parseInt(type.slice(6)) - 1; textToSpeak = self.getOptionsValue(optionIndex); @@ -558,7 +1004,9 @@ SenaSDK.prototype.playVoice = function(type) { textToSpeak = hintValue; } } - if(textToSpeak == "") return; + + if (textToSpeak === '') return; + if (window['audioPlayer']) { window['audioPlayer'].pause(); window['audioPlayer'].src = textToSpeak; @@ -569,32 +1017,311 @@ SenaSDK.prototype.playVoice = function(type) { } }; +// ========== POSTMESSAGE ========== + +SenaSDK.prototype.registerPostMessageListener = function () { + let self = this; + + window.addEventListener("message", function (event) { + if (!event.data || !event.data.type) return; + + switch (event.data.type) { + case "SERVER_PUSH_DATA": + console.log('📥 Sena SDK: Received SERVER_PUSH_DATA'); + + if (self._postMessageTimeout) { + clearTimeout(self._postMessageTimeout); + self._postMessageTimeout = null; + } + self._waitingForPostMessage = false; + + // Nếu trước đó load bằng server rồi + if (self._dataLoadedFromServer && !self._gameStartedByUser) { + console.log('🔄 PostMessage late, reloading data'); + self.postMessageDataLoaded = false; + self._dataLoadedFromServer = false; + } + + if (self._gameStartedByUser) { + console.log('⚠️ Sena SDK: PostMessage ignored (user already playing)'); + return; + } + + self.loadFromPostMessage(event.data.jsonData); + + if (self._loadCallback) { + let cb = self._loadCallback; + self._loadCallback = null; + cb(true); + } + break; + + case "SYNC_TIME": + if (event.data.end_time_iso) { + let endTimeDate = new Date(event.data.end_time_iso); + let now = new Date(); + self.timeLimit = Math.max(0, Math.floor((endTimeDate - now) / 1000)); + console.log('🎮 Sena SDK: Time synced:', self.timeLimit, 's'); + } + break; + + case "SDK_DATA_READY": + console.log('📥 Sena SDK: Received SDK_DATA_READY'); + self._handleSdkDataReady(event.data.payload); + break; + + case "SDK_PUSH_DATA": + console.log('📥 Sena SDK: Received SDK_PUSH_DATA'); + if (event.data.payload?.items) { + self._handleSdkPushData(event.data.payload.items); + } + break; + + case "SEQUENCE_SYNC": // Đổi ở đây + console.log("📥 Sena SDK: Received SEQUENCE_SYNC", event.data); + if (event.data.uuid === self.uuid) { + console.log("🔄 Sena SDK: Own message echoed back, processing..."); + } + + if (typeof self.onCustomMessage === "function") { + self.onCustomMessage(event.data.data, event.data.uuid); + } + break; + + case "SDK_ERROR": + console.error('❌ Sena SDK: Received SDK_ERROR', event.data.payload); + break; + } + }); + + console.log('🎮 Sena SDK: PostMessage listener registered'); +}; + +/** + * Send custom message to parent window with UUID + * @param {Object} data - Custom JSON data to send + */ +SenaSDK.prototype.sendMessageToParent = function (data) { + let self = this; + + if (!data || typeof data !== 'object') { + console.error('❌ Sena SDK: sendMessageToParent requires data object'); + return false; + } + + let payload = { + type: "Sequence_Sync", + uuid: self.uuid, + data: data, + timestamp: Date.now() + }; + + window.parent.postMessage(payload, "*"); + + console.log('📤 Sena SDK: Sent Sequence_Sync to parent'); + console.log('🔑 UUID:', self.uuid); + console.log('📦 Data:', data); + + return true; +}; + +SenaSDK.prototype._handleSdkDataReady = function (payload) { + let self = this; + + if (!payload?.items) { + console.error('🎮 Sena SDK: SDK_DATA_READY missing items'); + return; + } + + if (self._postMessageTimeout) { + clearTimeout(self._postMessageTimeout); + self._postMessageTimeout = null; + } + self._waitingForPostMessage = false; + + let items = payload.items; + + if (items.length === 1) { + let item = items[0]; + self.data = { + question: item.question || '', + request: item.question || '', + options: item.options?.map(o => o.text || o.audio || o) || [] + }; + self.gameID = item.id; + } else { + self.list = items.map((item, idx) => ({ + id: item.id || idx, + question: item.question || '', + options: item.options?.map(o => o.text || o) || [], + answer: null + })); + self.totalQuestions = items.length; + self.level = payload.completed_count || 0; + self._loadCurrentQuestionToData(); + } + + self.postMessageDataLoaded = true; + console.log('✅ Sena SDK: SDK_DATA_READY processed'); + + if (self._loadCallback) { + self._loadCallback(true); + self._loadCallback = null; + } +}; + +SenaSDK.prototype._handleSdkPushData = function (items) { + let self = this; + + if (!items || items.length === 0) { + console.error('🎮 Sena SDK: SDK_PUSH_DATA missing items'); + return; + } + + if (self._postMessageTimeout) { + clearTimeout(self._postMessageTimeout); + self._postMessageTimeout = null; + } + self._waitingForPostMessage = false; + + if (items.length === 1) { + let item = items[0]; + self.data = { + question: item.question || '', + options: item.options || [] + }; + self.correctAnswer = item.answer; + self.gameID = item.id; + } else { + self.list = items.map((item, idx) => ({ + id: item.id || idx, + question: item.question || '', + options: item.options || [], + answer: item.answer + })); + self.totalQuestions = items.length; + self.level = 0; + self._loadCurrentQuestionToData(); + } + + self.postMessageDataLoaded = true; + console.log('✅ Sena SDK: SDK_PUSH_DATA processed'); + + if (self._loadCallback) { + self._loadCallback(true); + self._loadCallback = null; + } +}; + +SenaSDK.prototype.getTimeSpent = function () { + if (!this.startTime) return 0; + return Math.floor((Date.now() - this.startTime) / 1000); +}; + +// ========== MULTI-QUESTION SUPPORT ========== + +SenaSDK.prototype.play = function (selectedText, isTimeout) { + let self = this; + + if (!self.currentQuestion && self.data) { + let result = { isCorrect: false, result: 0 }; + self.end(selectedText, function (isCorrect) { + result.isCorrect = isCorrect; + result.result = isCorrect ? 1 : 0; + }); + return result.result; + } + + if (!self.currentQuestion) return 0; + + let alreadyAnswered = self.userResults.find(r => r.id === self.currentQuestion.id); + if (alreadyAnswered) return alreadyAnswered.result; + + let isCorrect = false; + let userChoice = null; + + if (isTimeout === true || String(isTimeout) === 'true') { + isCorrect = false; + userChoice = null; + } else { + userChoice = String(selectedText).trim(); + let correctAnswer = String(self.currentQuestion.answer).trim(); + isCorrect = (userChoice.toLowerCase() === correctAnswer.toLowerCase()); + } + + let resultValue = isCorrect ? 1 : 0; + + self.userResults.push({ id: self.currentQuestion.id, result: resultValue }); + + console.log('🎮 Sena SDK: Answer Result:', resultValue); + + return resultValue; +}; + +SenaSDK.prototype.submitResults = function () { + let self = this; + + let uniqueResults = []; + let seenIds = {}; + for (let i = self.userResults.length - 1; i >= 0; i--) { + if (!seenIds[self.userResults[i].id]) { + uniqueResults.unshift(self.userResults[i]); + seenIds[self.userResults[i].id] = true; + } + } + + let correctCount = uniqueResults.filter(r => r.result === 1).length; + let totalScore = self.totalQuestions > 0 + ? Math.round((correctCount / self.totalQuestions) * 100) / 10 + : 0; + let timeSpent = Math.floor((Date.now() - self.startTime) / 1000); + + let finalData = { + game_id: self.gameID, + score: totalScore, + time_spent: timeSpent, + correct_count: correctCount, + total_questions: self.totalQuestions, + details: uniqueResults + }; + + console.log('🎮 Sena SDK: Final Score:', totalScore); + + window.parent.postMessage({ + type: "FINAL_RESULT", + uuid: self.uuid, + data: finalData + }, "*"); + + return finalData; +}; + +// ========== HELPER ========== + SenaSDK.prototype.helper = {}; -SenaSDK.prototype.helper.CalcObjectPositions = function(n, objectWidth, margin, maxWidth) { +SenaSDK.prototype.helper.CalcObjectPositions = function (n, objectWidth, margin, maxWidth) { let self = this; self.positions = []; const totalWidth = n * objectWidth + (n - 1) * margin; const startX = (maxWidth - totalWidth) / 2; - let positions = []; + for (let i = 0; i < n; i++) { - positions.push(startX + i * (objectWidth + margin)); + self.positions.push(startX + i * (objectWidth + margin) + objectWidth / 2); } - positions.map(pos => pos + objectWidth / 2); // Adjusting to center the objects - self.positions = positions; }; -SenaSDK.prototype.helper.getPosXbyIndex = function(index) { - let self = this; - if (index < 0 || index >= self.positions.length) { - return null; // Return null if index is out of bounds - } - return self.positions[index]; -}; -// Export for different module systems + +SenaSDK.prototype.helper.getPosXbyIndex = function (index) { + if (index < 0 || index >= this.positions.length) return null; + return this.positions[index]; +}; + +// ========== EXPORT ========== + if (typeof module !== 'undefined' && module.exports) { module.exports = SenaSDK; } else if (typeof define === 'function' && define.amd) { - define([], function() { return SenaSDK; }); + define([], function () { return SenaSDK; }); } else { window.SenaSDK = SenaSDK; -} \ No newline at end of file +} diff --git a/source/Sequence.capx b/source/Sequence.capx index f328e98..7eaabbd 100644 Binary files a/source/Sequence.capx and b/source/Sequence.capx differ diff --git a/source/Sequence.capx.backup1 b/source/Sequence.capx.backup1 new file mode 100644 index 0000000..575c602 Binary files /dev/null and b/source/Sequence.capx.backup1 differ