diff --git a/image_spelling_sequence_sentence/appmanifest.json b/image_spelling_sequence_sentence/appmanifest.json index 3824f32..0168ffa 100644 --- a/image_spelling_sequence_sentence/appmanifest.json +++ b/image_spelling_sequence_sentence/appmanifest.json @@ -1,6 +1,6 @@ { - "name": "Sequence", - "short_name": "Sequence", + "name": "image_spelling_sequence_sentence_teacher_2", + "short_name": "image_spelling_sequence_sentence_teacher_2", "start_url": "index.html", "display": "fullscreen", "orientation": "any", diff --git a/image_spelling_sequence_sentence/c2runtime.js b/image_spelling_sequence_sentence/c2runtime.js index be3440a..7fd8fbb 100644 --- a/image_spelling_sequence_sentence/c2runtime.js +++ b/image_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,50 +25070,67 @@ 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, - cr.behaviors.Sin, cr.behaviors.Pin, + cr.behaviors.Sin, cr.system_object.prototype.cnds.OnLayoutStart, cr.plugins_.SenaPlugin.prototype.acts.Load, cr.system_object.prototype.acts.SetLayerVisible, - cr.plugins_.Sprite.prototype.acts.SetVisible, + cr.plugins_.Sprite.prototype.acts.Destroy, cr.plugins_.SenaPlugin.prototype.cnds.OnLoad, + cr.plugins_.Browser.prototype.acts.ConsoleLog, + cr.plugins_.SenaPlugin.prototype.exps.getGuide, cr.plugins_.SenaPlugin.prototype.acts.Start, cr.plugins_.SenaPlugin.prototype.cnds.OnStart, - cr.plugins_.Sprite.prototype.acts.LoadURL, + cr.plugins_.SenaPlugin.prototype.exps.getQuestionType, cr.plugins_.SenaPlugin.prototype.exps.getQuestionValue, - cr.plugins_.Sprite.prototype.acts.Destroy, + cr.plugins_.SenaPlugin.prototype.exps.getRequestType, + cr.plugins_.SenaPlugin.prototype.exps.getRequestValue, + cr.plugins_.SenaPlugin.prototype.exps.getOptionsCount, + cr.plugins_.SenaPlugin.prototype.exps.getHintCount, cr.system_object.prototype.acts.SetVar, cr.behaviors.Pin.prototype.acts.Pin, + cr.plugins_.SpriteFontPlus.prototype.acts.SetText, 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_.SenaPlugin.prototype.exps.getHintCount, - cr.plugins_.Sprite.prototype.exps.Width, + cr.plugins_.Sprite.prototype.acts.LoadURL, + cr.plugins_.SenaPlugin.prototype.exps.getQuestionImage, cr.system_object.prototype.cnds.Repeat, - cr.system_object.prototype.acts.CreateObject, - cr.plugins_.SenaPlugin.prototype.exps.getPosXbyIndex, + cr.system_object.prototype.exps["int"], cr.system_object.prototype.exps.loopindex, - cr.plugins_.SenaPlugin.prototype.exps.getPosYbyIndex, + cr.plugins_.SenaPlugin.prototype.exps.getHintType, cr.plugins_.SenaPlugin.prototype.exps.getHintValue, + cr.system_object.prototype.acts.CreateObject, cr.system_object.prototype.cnds.Compare, cr.plugins_.Sprite.prototype.acts.SetBoolInstanceVar, - cr.plugins_.SpriteFontPlus.prototype.acts.SetText, 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_.SenaPlugin.prototype.exps.getOptionsCount, - cr.plugins_.Sprite.prototype.acts.SetY, + 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, @@ -24394,12 +25149,10 @@ 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, @@ -24416,9 +25169,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_.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/image_spelling_sequence_sentence/data.js b/image_spelling_sequence_sentence/data.js index dc3675c..6572f84 100644 --- a/image_spelling_sequence_sentence/data.js +++ b/image_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,["G2810S1T30"]],["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",168,0,0,250,250,1,0.5,0.5,[],[],0]]]],[],false,false,150393696478915,[],null],["t18",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],["t19",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],["t20",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],["t21",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],["t22",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],["t23",4,false,[],0,0,null,[["Default",5,false,1,0,false,748818574673109,[["images/layer2copy-sheet0.png",129703,0,0,732,719,1,0.5,0.5006954073905945,[],[-0.437158465385437,-0.4367176592350006,0,-0.4951321184635162,0.4193989038467407,-0.4186369776725769,0.4617486596107483,-0.001390814781188965,0.4030054807662964,0.4005563259124756,0,0.4603615999221802,-0.4180327951908112,0.415855348110199,-0.494535505771637,-0.001390814781188965],0]]]],[],false,false,946710535024064,[],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,11,9,10],[25,19,18,16,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,[[[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]],[[600,400,0,300,300,0,0,1,0.5,0.5,0,0,[]],17,18,[],[],[0,"Default",0,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,[]],16,17,[],[],[0,"Default",0,1]],[[605.5549926757813,409.0689697265625,0,354.6199951171875,348.3221130371094,0,0,1,0.5,0.5006954073905945,0,0,[]],23,25,[],[],[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,[]],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,[[[110,77,0,195.7390747070313,133.4940490722656,0,0,1,0.5,0.5014662742614746,0,0,[]],22,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]]],[21,15,null,678445539023902,false,[[3,0]]]]],[0,null,false,null,432411265738905,[[0,16,null,1,false,false,false,913106290597646,false]],[],[[0,null,false,null,122100426567399,[],[[0,17,null,458181517098292,false]]]]],[0,null,false,null,495673204159818,[[0,18,null,1,false,false,false,157454832331304,false]],[[17,19,null,350127380706801,false,[[1,[20,0,20,true,null]],[3,0],[3,0]]],[6,21,null,227093858363506,false],[7,21,null,601277174090980,false],[-1,22,null,623599131030475,false,[[11,"isTimeUp"],[7,[0,0]]]],[9,23,"Pin",636254900159958,false,[[4,13],[3,0]]],[18,24,null,756761854102448,false,[[10,0],[7,[20,18,25,false,null]]]],[18,24,null,843231659647898,false,[[10,1],[7,[20,18,26,false,null]]]],[18,27,null,429067541495196,false,[[0,[20,16,25,false,null]],[0,[20,16,26,false,null]]]],[19,24,null,312955471850139,false,[[10,0],[7,[20,19,25,false,null]]]],[19,24,null,725880314927928,false,[[10,1],[7,[20,19,26,false,null]]]],[19,27,null,588637745430653,false,[[0,[20,16,25,false,null]],[0,[20,16,26,false,null]]]]],[[0,null,false,null,278599510819277,[],[[0,28,null,505162364268873,false,[[0,[19,29,[[20,0,30,false,null]]]],[0,[20,6,31,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,32,null,0,true,false,false,488889777784546,false,[[0,[19,29,[[20,0,30,false,null]]]]]]],[[-1,33,null,371942430718793,false,[[4,6],[5,[0,1]],[0,[20,0,34,false,null,[[19,35]]]],[0,[4,[20,0,36,false,null,[[19,35]]],[0,650]]]]],[6,24,null,933941275549609,false,[[10,0],[7,[19,35]]]],[6,24,null,380164134533232,false,[[10,1],[7,[20,0,37,false,null,[[19,35]]]]]]],[[0,null,false,null,698796573985720,[[-1,38,null,0,false,false,false,410553190492367,false,[[7,[20,0,37,false,null,[[19,35]]]],[8,1],[7,[2,"_"]]]]],[[6,39,null,847566670403732,false,[[10,2],[3,1]]],[-1,33,null,521667370636870,false,[[4,11],[5,[0,1]],[0,[20,6,25,false,null]],[0,[20,6,26,false,null]]]],[11,23,"Pin",361028315192679,false,[[4,6],[3,0]]],[11,40,null,466267976699500,false,[[7,[21,6,true,null,1]]]],[6,41,null,354611702724504,false,[[0,[0,1]]]]]],[0,null,false,null,848543107448972,[[-1,42,null,0,false,false,false,386888311054006,false]],[[6,39,null,590812225579568,false,[[10,2],[3,0]]],[-1,43,null,977539034131901,false,[[11,"end"],[7,[0,1]]]]]]]]]],[0,null,false,null,822104816469346,[],[[0,28,null,737719939649407,false,[[0,[19,29,[[20,0,44,false,null]]]],[0,[20,7,31,false,null]],[0,[0,5]],[0,[0,1200]],[0,[0,0]],[0,[0,100]],[1,[2,"word"]],[0,[0,0]]]],[2,45,null,256704970269789,false,[[0,[4,[20,0,36,false,null,[[0,0]]],[0,700]]]]]],[[0,null,false,null,441467613146144,[[-1,32,null,0,true,false,false,218190693390519,false,[[0,[19,29,[[20,0,44,false,null]]]]]]],[[-1,33,null,722355474670048,false,[[4,7],[5,[0,1]],[0,[20,0,34,false,null,[[19,35]]]],[0,[4,[20,0,36,false,null,[[19,35]]],[0,700]]]]],[7,24,null,424845902591780,false,[[10,0],[7,[20,0,46,true,null,[[19,35]]]]]],[7,24,null,732477610518970,false,[[10,3],[7,[0,-1]]]],[7,24,null,972534679995256,false,[[10,1],[7,[20,7,25,false,null]]]],[7,24,null,955022957314574,false,[[10,2],[7,[20,7,26,false,null]]]],[-1,33,null,820542104698850,false,[[4,10],[5,[0,1]],[0,[20,7,25,false,null]],[0,[20,7,26,false,null]]]],[10,23,"Pin",165265909130423,false,[[4,7],[3,0]]],[10,40,null,752256115955919,false,[[7,[21,7,true,null,0]]]]]]]]]],[0,null,false,null,391531229850255,[[3,47,null,1,false,false,false,541795463553529,false,[[4,2]]],[2,48,null,0,false,false,false,463624702778654,false],[-1,49,null,0,false,false,false,211208220731414,false,[[11,"Paused"],[8,0],[7,[0,0]]]]],[[15,50,null,933729384541080,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[0,51,null,256977907477815,false],[7,52,"DragDrop",500676445420163,false,[[3,0]]],[-1,22,null,392747038186299,false,[[11,"answer"],[7,[2,""]]]],[8,53,null,286145656469424,false,[[1,[2,"currentAnswer"]],[13]]],[-1,54,null,870335272692108,false,[[0,[0,3]]]]]],[0,null,false,null,131646557054595,[[0,55,null,1,false,false,false,891894169376380,false]],[[15,50,null,327930580854185,false,[[2,["correct",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[-1,33,null,202907159105342,false,[[4,14],[5,[0,1]],[0,[20,2,25,false,null]],[0,[20,2,26,false,null]]]],[14,41,null,145728902691754,false,[[0,[0,0]]]]]],[0,null,false,null,626804407280781,[[0,56,null,1,false,false,false,435087545862561,false]],[[15,50,null,217938364629081,false,[[2,["error-010-206498",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[-1,33,null,522820795913632,false,[[4,14],[5,[0,1]],[0,[20,2,25,false,null]],[0,[20,2,26,false,null]]]],[14,41,null,743250840849647,false,[[0,[0,1]]]]]],[0,null,false,null,138784311293898,[[3,47,null,1,false,false,false,318840334321068,false,[[4,4]]]],[[0,51,null,188346907636434,false]]],[0,null,false,null,144690028489488,[[3,47,null,1,false,false,false,961657910924384,false,[[4,5]]]],[[0,57,null,863067724909837,false]]],[0,null,false,null,339829265544415,[[0,58,null,1,false,false,false,425081282629100,false]],[[-1,22,null,357857564221621,false,[[11,"Paused"],[7,[0,1]]]]]],[0,null,false,null,619901953302901,[[0,59,null,1,false,false,false,453788771302771,false]],[[-1,22,null,986855891964228,false,[[11,"Paused"],[7,[0,0]]]]]],[0,null,false,null,678278685100726,[[-1,60,null,0,false,false,false,839154243379294,false]],[],[[0,null,false,null,203029406704081,[[-1,38,null,0,false,false,false,812877676162386,false,[[7,[20,0,61,false,null]],[8,4],[7,[0,0]]]]],[[-1,22,null,282958384255218,false,[[11,"timeLeft"],[7,[19,62,[[0,0],[5,[20,0,61,false,null],[20,0,63,false,null]]]]]]],[9,40,null,175097790282221,false,[[7,[19,29,[[23,"timeLeft"]]]]]]]]]],[0,null,false,null,978751838447749,[[-1,60,null,0,false,false,false,740586896137774,false]],[],[[0,null,false,null,539759871180422,[[-1,38,null,0,false,false,false,735943013123850,false,[[7,[20,0,63,false,null]],[8,4],[7,[20,0,61,false,null]]]],[-1,49,null,0,false,false,false,856670007560900,false,[[11,"isTimeUp"],[8,0],[7,[0,0]]]],[-1,64,null,0,false,false,false,955668488059869,false]],[[-1,22,null,302945892896402,false,[[11,"isTimeUp"],[7,[0,1]]]],[7,52,"DragDrop",118986934409651,false,[[3,0]]],[10,65,null,739058330936640,false],[7,66,"Fade",429052538282797,false],[-1,54,null,917300360080570,false,[[0,[1,1]]]],[6,66,"Fade",315915830094512,false],[7,21,null,585032189291227,false],[11,65,null,239984847558684,false],[0,67,null,474781657260693,false,[[7,[23,"answer"]]]]]]]],[0,null,false,null,365785861310817,[[8,68,null,2,false,false,false,466620429321609,false,[[1,[2,"currentAnswer"]]]]],[],[[0,null,false,null,780375794781622,[[-1,69,null,0,true,false,false,143001263185103,false,[[1,[2,"i"]],[0,[0,0]],[0,[5,[19,29,[[20,0,30,false,null]]],[0,1]]]]]],[],[[0,null,false,null,623354472074576,[[-1,70,null,0,false,false,false,929134158340487,false,[[4,6],[7,[21,6,false,null,0]],[8,0],[7,[19,35]]]]],[[-1,22,null,483299828391284,false,[[11,"answer"],[7,[10,[10,[23,"answer"],[21,6,true,null,1]],[2,"|"]]]]]]]]],[0,null,false,null,475666535596674,[],[[-1,22,null,374977936278745,false,[[11,"answer"],[7,[19,71,[[23,"answer"],[5,[19,72,[[23,"answer"]]],[0,1]]]]]]],[0,67,null,103117520878571,false,[[7,[23,"answer"]]]]]]]],[0,null,false,null,600608562107578,[[3,47,null,1,false,false,false,891500002256313,false,[[4,16]]],[-1,73,null,0,false,false,false,661387361841959,false,[[5,[0,1]]]]],[],[[0,null,false,null,426459896580949,[[19,74,null,0,false,false,false,811423894111416,false,[[8,0],[0,[20,16,26,false,null]]]]],[[15,50,null,448383056256493,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[18,75,"MoveTo",576994443738303,false,[[0,[21,18,false,null,0]],[0,[21,18,false,null,1]]]],[19,75,"MoveTo",664066818448917,false,[[0,[21,19,false,null,0]],[0,[21,19,false,null,1]]]]]],[0,null,false,null,813987173387856,[[19,74,null,0,false,false,false,360548133253360,false,[[8,0],[0,[21,19,false,null,1]]]]],[[15,50,null,900927220158965,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[18,76,"MoveTo",564863130284639,false,[[4,16]]],[19,76,"MoveTo",753250951346862,false,[[4,16]]]]]]],[0,null,false,null,398375489714286,[[3,47,null,1,false,false,false,723806263526938,false,[[4,19]]],[19,74,null,0,false,false,false,181942908228041,false,[[8,0],[0,[21,19,false,null,1]]]]],[[15,50,null,956111466416572,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]]],[[0,null,false,null,859972771487505,[[19,77,null,0,false,false,false,990148759371186,false,[[8,0],[0,[0,0]]]]],[[19,41,null,728229426682011,false,[[0,[0,1]]]],[15,78,null,436791612138112,false,[[3,0]]]]],[0,null,false,null,474877987440232,[[-1,42,null,0,false,false,false,904405232089990,false]],[[19,41,null,569169335937351,false,[[0,[0,0]]]],[15,78,null,898083323827850,false,[[3,1]]]]]]],[0,null,false,null,246743788520867,[[3,47,null,1,false,false,false,801931205987650,false,[[4,18]]],[18,74,null,0,false,false,false,551526414582339,false,[[8,0],[0,[21,18,false,null,1]]]]],[[15,50,null,362517594952131,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[0,51,null,135302385113891,false],[18,76,"MoveTo",959639910199972,false,[[4,16]]],[19,76,"MoveTo",258657396501857,false,[[4,16]]],[-1,54,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]]],[21,15,null,502424126884419,false,[[3,1]]]]],[0,null,false,null,600080256108869,[[3,47,null,1,false,false,false,304672810310041,false,[[4,21]]],[21,48,null,0,false,false,false,303482445048985,false]],[[15,50,null,908224956633417,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[21,15,null,785653027129768,false,[[3,0]]],[0,57,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,79,"DragDrop",1,false,false,false,528907557634308,false]],[[15,50,null,162558464641912,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]]],[[0,null,false,null,266963171745346,[[7,80,null,0,false,false,false,673397366023432,false,[[10,3],[8,1],[7,[0,-1]]]],[6,80,null,0,false,false,false,577869128870380,false,[[10,0],[8,0],[7,[21,7,false,null,3]]]],[7,81,null,0,false,false,false,609479521709627,false,[[4,10]]]],[[6,24,null,445026196152632,false,[[10,1],[7,[2,"_"]]]],[7,82,null,670463517581139,false],[10,83,null,538995332098798,false]]],[0,null,false,null,816493828433722,[[-1,42,null,0,false,false,false,390659514117980,false]],[],[[0,null,false,null,487754364377713,[[7,81,null,0,false,false,false,443159185077976,false,[[4,10]]]],[[7,82,null,774809908055048,false],[10,83,null,501986465343455,false]]]]]]],[0,null,false,null,946639210805430,[[7,84,"DragDrop",1,false,false,false,155941787306139,false]],[[15,50,null,361413524752870,false,[[2,["immersivecontrol-button-click-sound-463065",false]],[3,0],[0,[0,-2]],[1,[2,""]]]]],[[0,null,false,null,504792991445212,[[7,81,null,0,false,false,false,845450333794375,false,[[4,6]]],[6,85,null,0,false,true,false,204552588897544,false,[[10,2]]]],[],[[0,null,false,null,106550985509374,[[6,86,null,0,false,false,true,170480452496238,false,[[3,0],[0,[20,7,25,false,null]],[0,[20,7,26,false,null]]]],[6,80,null,0,false,false,false,938809230173413,false,[[10,1],[8,0],[7,[2,"_"]]]]],[[7,87,"MoveTo",350887864650832,false,[[0,[0,350]]]],[7,75,"MoveTo",122919247741976,false,[[0,[20,6,25,false,null]],[0,[20,6,26,false,null]]]],[6,24,null,568930528296173,false,[[10,1],[7,[21,7,true,null,0]]]]],[[0,null,false,null,101266177713061,[[7,80,null,0,false,false,false,148334850256636,false,[[10,3],[8,0],[7,[0,-1]]]]],[[7,24,null,762068200313175,false,[[10,3],[7,[21,6,false,null,0]]]],[-1,43,null,348122173801647,false,[[11,"filledCount"],[7,[0,1]]]]]],[0,null,false,null,296319278611324,[[-1,42,null,0,false,false,false,250133201929726,false]],[[7,24,null,116855994129968,false,[[10,3],[7,[21,6,false,null,0]]]]]]]],[0,null,false,null,180540551233675,[[-1,42,null,0,false,false,false,806523891610870,false],[7,80,null,0,false,false,false,831308228851461,false,[[10,3],[8,1],[7,[0,-1]]]]],[[7,87,"MoveTo",416883713281691,false,[[0,[0,1200]]]],[7,75,"MoveTo",572186182608955,false,[[0,[21,7,false,null,1]],[0,[21,7,false,null,2]]]],[7,24,null,370498434376498,false,[[10,3],[7,[0,-1]]]],[-1,43,null,250504698972287,false,[[11,"filledCount"],[7,[0,-1]]]]]],[0,null,false,null,664272208282422,[[-1,42,null,0,false,false,false,895425177786413,false],[7,80,null,0,false,false,false,246894625675163,false,[[10,3],[8,0],[7,[0,-1]]]]],[[7,87,"MoveTo",888826482377214,false,[[0,[0,1200]]]],[7,75,"MoveTo",393405307018971,false,[[0,[21,7,false,null,1]],[0,[21,7,false,null,2]]]],[7,24,null,503673017513230,false,[[10,3],[7,[0,-1]]]]]]]],[0,null,false,null,818745098688947,[[-1,42,null,0,false,false,false,929804756669469,false],[7,80,null,0,false,false,false,177859681995434,false,[[10,3],[8,1],[7,[0,-1]]]]],[[7,87,"MoveTo",449724002535088,false,[[0,[0,1200]]]],[7,75,"MoveTo",721292388859295,false,[[0,[21,7,false,null,1]],[0,[21,7,false,null,2]]]],[7,24,null,733212651291432,false,[[10,3],[7,[0,-1]]]],[-1,43,null,739300525987860,false,[[11,"filledCount"],[7,[0,-1]]]]]],[0,null,false,null,358120937494399,[[-1,42,null,0,false,false,false,416712700522674,false],[7,80,null,0,false,false,false,261187518957115,false,[[10,3],[8,0],[7,[0,-1]]]]],[[7,87,"MoveTo",431242330954619,false,[[0,[0,1200]]]],[7,75,"MoveTo",754072653542168,false,[[0,[21,7,false,null,1]],[0,[21,7,false,null,2]]]],[7,24,null,272960877861772,false,[[10,3],[7,[0,-1]]]]]]]],[0,null,false,null,580675938654997,[[7,88,"DragDrop",0,false,false,false,411147921527630,false]],[[7,27,null,610567804677855,false,[[0,[20,3,89,false,null]],[0,[20,3,90,false,null]]]]]],[0,null,false,null,622060364017684,[[-1,60,null,0,false,false,false,228576696549219,false]],[],[[0,null,false,null,108730370076990,[[-1,49,null,0,false,false,false,538413628199561,false,[[11,"filledCount"],[8,0],[7,[23,"end"]]]]],[[2,15,null,445242465744130,false,[[3,1]]]]],[0,null,false,null,218835501607731,[[-1,42,null,0,false,false,false,933470660702724,false]],[[2,15,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,["G2810S1T30"]],["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",78048,0,0,353,155,1,0.5014164447784424,0.374193549156189,[],[],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",214371,1,1,381,137,1,0.4986876547336578,0.2554744482040405,[],[-0.4986876547336578,-0.2116788476705551,0.5013123750686646,-0.2116788476705551,0.5013123750686646,0.6934305429458618,-0.4986876547336578,0.6934305429458618],0],["images/slot-sheet0.png",214371,1,140,381,137,1,0.5013123154640198,0.277372270822525,[],[],0],["images/slot-sheet0.png",214371,1,401,200,85,1,0.5,0.4235294163227081,[],[],0],["images/slot-sheet0.png",214371,203,401,200,85,1,0.5049999952316284,0.4235294163227081,[],[],0],["images/slot-sheet0.png",214371,1,279,319,120,1,0.5015674233436585,0.4333333373069763,[],[],0]]]],[["Fade",8,588103285968005]],false,false,530929310100717,[],null],["t7",5,false,[617093471778717,401281652261798,308058330719086,937883104346632,243525000976275,435711195864159],4,0,null,[["Default",0,false,1,0,false,344548683716056,[["images/btn_worditem-sheet0.png",58005,0,0,381,137,1,0.4986876547336578,0.3649635016918182,[],[-0.4225721657276154,-0.3065693080425263,0.4225723445415497,-0.3065693080425263,0.4225723445415497,0.5693434476852417,-0.4225721657276154,0.5693434476852417],0]]]],[["DragDrop",9,551257499299552],["Fade",8,430149822241515],["MoveTo",10,551694077436381],["Pin",11,739718864734046]],false,false,515230787966511,[],null],["t8",2,false,[],0,0,null,null,[],false,false,825652157577718,[],null,[]],["t9",4,false,[],0,0,["images/txt_texttimer.png",157188,0],null,[],false,false,428453985749595,[],null],["t10",4,false,[],0,0,["images/txt_worditem.png",103796,0],null,[],false,false,125516006976486,[],null],["t11",4,false,[],0,0,["images/txt_worditem.png",103796,0],null,[],false,false,680183373657896,[],null],["t12",5,false,[],0,0,null,[["Default",5,false,1,0,false,174194635978617,[["images/senaaikhoi-sheet0.png",242672,0,0,590,301,1,0.5,0.5016611218452454,[],[],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",129759,0,0,298,237,1,0.5,0.502109706401825,[],[],0]]]],[],false,false,444899307061590,[],null],["t16",5,false,[],0,0,null,[["Default",5,false,1,0,false,922486781068681,[["images/panel-sheet0.png",432760,0,0,651,648,1,0.5007680654525757,0.5,[],[],0]]]],[],false,false,150393696478915,[],null],["t17",4,false,[],0,0,["images/txt_texttimer.png",157188,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",123569,0,0,298,237,1,0.5,0.502109706401825,[],[],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",273344,1,1,298,237,1,0.5,0.502109706401825,[],[],0],["images/btn_music-sheet0.png",273344,1,240,298,237,1,0.5,0.502109706401825,[],[],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",12,152768910804631]],false,false,822735679292648,[],null],["t22",3,false,[],0,0,null,null,[],true,false,262867654071762,[],null],["t23",5,false,[],0,0,null,[["Default",5,false,1,0,false,562756187089019,[["images/img-sheet0.png",168,0,0,250,250,1,0.5,0.5,[],[],0]]]],[],false,false,948012257438000,[],null],["t24",4,true,[],1,0,null,null,[["Pin",11,693926857619114]],false,false,154178255437462,[],null],["t25",5,true,[],0,0,null,null,[],false,false,909098946188328,[],null]],[[24,17,11,9,10],[25,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.549194335938,0,353,155,0,0,0.7900000214576721,0.5014164447784424,0.374193549156189,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]],[[12,-1117,0,204,137,0,0,1,0.4986876547336578,0.2554744482040405,0,0,[]],6,7,[[0],[""],[0]],[[0,0,0,2,1]],[0,"Default",0,1]],[[-291,-1011,0,288,88,0,0,1,0.5,0.5,0,0,[]],11,12,[],[[]],[85,107,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`/@°+=*$£€<>%ÁÀẢẠÃĂẰẮẶẲẴÂẦẤẬẨẪĐÉÈẺẸẼÊỀẾỆỂỄÍÌỊỈĨÓÒỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÚÙỤỦŨƯỪỨỰỬỮÝỲỴỶỸáàảạãăằắặẳẵâầấậẩẫđéèẻẹẽêềếệểễíìịỉĩóòọỏõôồốộổỗơờớợởỡúùụủũưừứựửữýỳỵỷỹ","Text",0.7,0,1,1,1,0,0,0,"{\"\"c2array\"\":true,\"\"size\"\":[2,43,1],\"\"data\"\":[[[28],[21],[23],[24],[25],[26],[28],[30],[31],[32],[33],[34],[35],[36],[37],[38],[39],[40],[41],[42],[44],[45],[46],[47],[48],[49],[50],[51],[52],[53],[54],[55],[56],[57],[59],[61],[62],[65],[66],[68],[69],[71],[83]],[[\"\" \"\"],[\"\"'|\"\"],[\"\"IlỊỈ\"\"],[\"\"!ỉ\"\"],[\"\"i.,:ị\"\"],[\"\";\"\"],[\"\"[]\"\"],[\"\"í\"\"],[\"\"-`ÍÌì\"\"],[\"\"()°\"\"],[\"\"1\"\"],[\"\"j\\\"\"\"\"],[\"\"r\"\"],[\"\"t\"\"],[\"\"Ĩĩ\"\"],[\"\"Jf\"\"],[\"\"*\"\"],[\"\"s?\"\"],[\"\"Fc\"\"],[\"\"EL_ÉÈẺẸẼÊỆỄ\"\"],[\"\"z35\"\"],[\"\"a2<>áàảạãăằắặẳẵâậẫ\"\"],[\"\"ehn$£€éèẻẹẽêệễ\"\"],[\"\"Su679/+=Ểúùụủũ\"\"],[\"\"k08\"\"],[\"\"Pbdgpq~\"\"],[\"\"Bo4ẩểóòọỏõôộỗ\"\"],[\"\"Cvxy#Ếổýỳỵỷỹ\"\"],[\"\"TZỀầ\"\"],[\"\"ề\"\"],[\"\"KRUÚÙỤỦŨấđếơờớợởỡ\"\"],[\"\"H\"\"],[\"\"DGYÝỲỴỶỸồ\"\"],[\"\"Nốưừứựửữ\"\"],[\"\"VX\"\"],[\"\"AOÁÀẢẠÃĂẰẮẶẲẴÂẤẬẨẪÓÒỌỎÕÔỒỘỔỖ\"\"],[\"\"ẦĐỐ\"\"],[\"\"ƯỪỨỰỬỮ\"\"],[\"\"QƠỜỚỢỞỠ\"\"],[\"\"w%\"\"],[\"\"Mm&\"\"],[\"\"@\"\"],[\"\"W\"\"]]]}",-1]],[[1077,71,0,205.9116973876953,105.0498809814453,0,0,1,0.5,0.5016611218452454,0,0,[]],12,14,[],[],[0,"Default",0,1]],[[1078,70,0,132,77,0,0,1,0.5,0.5,0,0,[]],9,10,[],[[]],[73,91,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`/@°+=*$£€<>%ÁÀẢẠÃĂẰẮẶẲẴÂẦẤẬẨẪĐÉÈẺẸẼÊỀẾỆỂỄÍÌỊỈĨÓÒỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÚÙỤỦŨƯỪỨỰỬỮÝỲỴỶỸáàảạãăằắặẳẵâầấậẩẫđéèẻẹẽêềếệểễíìịỉĩóòọỏõôồốộổỗơờớợởỡúùụủũưừứựửữýỳỵỷỹ","TIME",0.6,0,1,1,1,0,0,0,"{\"\"c2array\"\":true,\"\"size\"\":[2,40,1],\"\"data\"\":[[[22],[11],[13],[14],[15],[19],[20],[21],[22],[23],[24],[26],[27],[28],[29],[30],[37],[38],[39],[40],[41],[42],[43],[44],[45],[46],[47],[49],[50],[51],[52],[53],[54],[55],[56],[58],[59],[61],[62],[71]],[[\"\" \"\"],[\"\"|\"\"],[\"\":\"\"],[\"\"Iil.,;'Ịị\"\"],[\"\"!\"\"],[\"\"Ỉỉ\"\"],[\"\"`ÍÌíì\"\"],[\"\"[]\"\"],[\"\"j()\"\"],[\"\"-\"\"],[\"\"/\"\"],[\"\"t°\"\"],[\"\"1\"\"],[\"\"rĨĩ\"\"],[\"\"*\"\"],[\"\"f\\\"\"\"\"],[\"\"Juz078úùụủũ\"\"],[\"\"hn3569$\"\"],[\"\"Faceks2+=<>áàảạãăằắặẳẵâầấậẩẫéèẻẹẽêềếệểễ\"\"],[\"\"Ldgq\"\"],[\"\"bp4?~\"\"],[\"\"oy£€óòọỏõôồốộổỗýỳỵỷỹ\"\"],[\"\"EPvx#ÉÈẺẸẼÊỀẾỆỂỄ\"\"],[\"\"đ\"\"],[\"\"HNTU_ÚÙỤỦŨ\"\"],[\"\"SZ\"\"],[\"\"BD\"\"],[\"\"C\"\"],[\"\"KR\"\"],[\"\"VX&ưừứựửữ\"\"],[\"\"GYÝỲỴỶỸơờớợởỡ\"\"],[\"\"MĐ\"\"],[\"\"OÓÒỌỎÕÔỒỐỘỔỖ\"\"],[\"\"AÁÀẢẠÃĂẰẮẶẲẴÂẦẤẬẨẪ\"\"],[\"\"Q\"\"],[\"\"ƯỪỨỰỬỮ\"\"],[\"\"mw\"\"],[\"\"%\"\"],[\"\"ƠỜỚỢỞỠ\"\"],[\"\"W@\"\"]]]}",-1]],[[109,-653,0,140,140,0,0,1,0.5,0.5,0,0,[]],13,15,[],[],[0,"Default",0,1]],[[599.9134521484375,323.9134521484375,0,415.8268737792969,415.8268737792969,0,0,1,0.5,0.5,0,0,[]],23,13,[],[],[0,"Default",0,1]],[[599.9130249023438,323.9129943847656,0,573.8181762695313,571.1738891601563,0,0,0.699999988079071,0.5007680654525757,0.5,0,0,[]],16,18,[],[],[0,"Default",0,1]],[[1106,990,0,142.7879943847656,113.5599975585938,0,0,1,0.5,0.502109706401825,0,0,[]],18,20,[[0],[0]],[[1,400,0,0]],[0,"Default",0,1]],[[1106,863,0,142.7879943847656,113.5599975585938,0,0,1,0.5,0.502109706401825,0,0,[]],19,21,[[0],[0]],[[1,400,0,0]],[0,"Default",0,1]],[[1106,1120,0,142.7882385253906,113.5597686767578,0,0,1,0.5,0.502109706401825,0,0,[]],15,17,[],[],[0,"Default",0,1]],[[-894,-923,0,381,137,0,0,1,0.4986876547336578,0.3649635016918182,0,0,[]],7,28,[[0],[""],[0],[0],[-1],[0]],[[0,1],[0,0,0,2,1],[1,1200,0,0],[]],[0,"Default",2,1]],[[72,-925,0,381,137,0,0,1,0.5013123154640198,0.277372270822525,0,0,[]],6,30,[[0],[""],[0]],[[0,0,0,2,1]],[0,"Default",1,1]],[[1198,-1068,0,642,205,0,0,1,0.5,0.5,0,0,[]],17,19,[],[[]],[73,91,"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,40,1],\"\"data\"\":[[[22],[11],[13],[14],[15],[19],[20],[21],[22],[23],[24],[26],[27],[28],[29],[30],[37],[38],[39],[40],[41],[42],[43],[44],[45],[46],[47],[49],[50],[51],[52],[53],[54],[55],[56],[58],[59],[61],[62],[71]],[[\"\" \"\"],[\"\"|\"\"],[\"\":\"\"],[\"\"Iil.,;'Ịị\"\"],[\"\"!\"\"],[\"\"Ỉỉ\"\"],[\"\"`ÍÌíì\"\"],[\"\"[]\"\"],[\"\"j()\"\"],[\"\"-\"\"],[\"\"/\"\"],[\"\"t°\"\"],[\"\"1\"\"],[\"\"rĨĩ\"\"],[\"\"*\"\"],[\"\"f\\\"\"\"\"],[\"\"Juz078úùụủũ\"\"],[\"\"hn3569$\"\"],[\"\"Faceks2+=<>áàảạãăằắặẳẵâầấậẩẫéèẻẹẽêềếệểễ\"\"],[\"\"Ldgq\"\"],[\"\"bp4?~\"\"],[\"\"oy£€óòọỏõôồốộổỗýỳỵỷỹ\"\"],[\"\"EPvx#ÉÈẺẸẼÊỀẾỆỂỄ\"\"],[\"\"đ\"\"],[\"\"HNTU_ÚÙỤỦŨ\"\"],[\"\"SZ\"\"],[\"\"BD\"\"],[\"\"C\"\"],[\"\"KR\"\"],[\"\"VX&ưừứựửữ\"\"],[\"\"GYÝỲỴỶỸơờớợởỡ\"\"],[\"\"MĐ\"\"],[\"\"OÓÒỌỎÕÔỒỐỘỔỖ\"\"],[\"\"AÁÀẢẠÃĂẰẮẶẲẴÂẦẤẬẨẪ\"\"],[\"\"Q\"\"],[\"\"ƯỪỨỰỬỮ\"\"],[\"\"mw\"\"],[\"\"%\"\"],[\"\"ƠỜỚỢỞỠ\"\"],[\"\"W@\"\"]]]}",-1]],[[42,-905,0,288,88,0,0,1,0.5,0.5,0,0,[]],10,25,[],[[]],[85,107,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,;:?!-_~#\"'&()[]|`/@°+=*$£€<>%ÁÀẢẠÃĂẰẮẶẲẴÂẦẤẬẨẪĐÉÈẺẸẼÊỀẾỆỂỄÍÌỊỈĨÓÒỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÚÙỤỦŨƯỪỨỰỬỮÝỲỴỶỸáàảạãăằắặẳẵâầấậẩẫđéèẻẹẽêềếệểễíìịỉĩóòọỏõôồốộổỗơờớợởỡúùụủũưừứựửữýỳỵỷỹ","THE",0.7,0,1,1,1,0,0,0,"{\"\"c2array\"\":true,\"\"size\"\":[2,43,1],\"\"data\"\":[[[28],[21],[23],[24],[25],[26],[28],[30],[31],[32],[33],[34],[35],[36],[37],[38],[39],[40],[41],[42],[44],[45],[46],[47],[48],[49],[50],[51],[52],[53],[54],[55],[56],[57],[59],[61],[62],[65],[66],[68],[69],[71],[83]],[[\"\" \"\"],[\"\"'|\"\"],[\"\"IlỊỈ\"\"],[\"\"!ỉ\"\"],[\"\"i.,:ị\"\"],[\"\";\"\"],[\"\"[]\"\"],[\"\"í\"\"],[\"\"-`ÍÌì\"\"],[\"\"()°\"\"],[\"\"1\"\"],[\"\"j\\\"\"\"\"],[\"\"r\"\"],[\"\"t\"\"],[\"\"Ĩĩ\"\"],[\"\"Jf\"\"],[\"\"*\"\"],[\"\"s?\"\"],[\"\"Fc\"\"],[\"\"EL_ÉÈẺẸẼÊỆỄ\"\"],[\"\"z35\"\"],[\"\"a2<>áàảạãăằắặẳẵâậẫ\"\"],[\"\"ehn$£€éèẻẹẽêệễ\"\"],[\"\"Su679/+=Ểúùụủũ\"\"],[\"\"k08\"\"],[\"\"Pbdgpq~\"\"],[\"\"Bo4ẩểóòọỏõôộỗ\"\"],[\"\"Cvxy#Ếổýỳỵỷỹ\"\"],[\"\"TZỀầ\"\"],[\"\"ề\"\"],[\"\"KRUÚÙỤỦŨấđếơờớợởỡ\"\"],[\"\"H\"\"],[\"\"DGYÝỲỴỶỸồ\"\"],[\"\"Nốưừứựửữ\"\"],[\"\"VX\"\"],[\"\"AOÁÀẢẠÃĂẰẮẶẲẴÂẤẬẨẪÓÒỌỎÕÔỒỘỔỖ\"\"],[\"\"ẦĐỐ\"\"],[\"\"ƯỪỨỰỬỮ\"\"],[\"\"QƠỜỚỢỞỠ\"\"],[\"\"w%\"\"],[\"\"Mm&\"\"],[\"\"@\"\"],[\"\"W\"\"]]]}",-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,[]],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,421297551205104,[[-1,13,null,1,false,false,false,438843515576193,false]],[[0,14,null,551138518888793,false],[-1,15,null,392038834754127,false,[[5,[0,2]],[3,0]]],[6,16,null,227093858363506,false],[7,16,null,601277174090980,false]]],[0,null,false,null,432411265738905,[[0,17,null,1,false,false,false,913106290597646,false]],[[1,18,null,260483465573520,false,[[3,0],[7,[2,"Load dữ liệu xong"]]]],[1,18,null,330854144982241,false,[[3,0],[7,[20,0,19,true,null]]]]],[[0,null,false,null,122100426567399,[],[[0,20,null,458181517098292,false]]]]],[0,null,false,null,495673204159818,[[0,21,null,1,false,false,false,157454832331304,false]],[[1,18,null,816803828558793,false,[[3,0],[7,[10,[10,[10,[2,"Question :"],[20,0,22,true,null]],[2," with value : "]],[20,0,23,true,null]]]]],[1,18,null,585706784629547,false,[[3,0],[7,[10,[10,[10,[2,"Request :"],[20,0,24,true,null]],[2," with value : "]],[20,0,25,true,null]]]]],[1,18,null,103090682922262,false,[[3,0],[7,[10,[2,"Options Count :"],[20,0,26,false,null]]]]],[1,18,null,460050924307031,false,[[3,0],[7,[10,[2,"Hint Count :"],[20,0,27,false,null]]]]],[-1,28,null,623599131030475,false,[[11,"isTimeUp"],[7,[0,0]]]],[17,29,"Pin",210783341114782,false,[[4,16],[3,0]]],[9,29,"Pin",636254900159958,false,[[4,12],[3,0]]],[17,30,null,808593987399542,false,[[7,[20,0,23,true,null]]]],[18,31,null,756761854102448,false,[[10,0],[7,[20,18,32,false,null]]]],[18,31,null,843231659647898,false,[[10,1],[7,[20,18,33,false,null]]]],[18,34,null,429067541495196,false,[[0,[20,15,32,false,null]],[0,[20,15,33,false,null]]]],[19,31,null,312955471850139,false,[[10,0],[7,[20,19,32,false,null]]]],[19,31,null,725880314927928,false,[[10,1],[7,[20,19,33,false,null]]]],[19,34,null,588637745430653,false,[[0,[20,15,32,false,null]],[0,[20,15,33,false,null]]]],[23,35,null,679165227027517,false,[[1,[20,0,36,true,null]],[3,1],[3,0]]]],[[0,null,false,null,822104816469346,[],[],[[0,null,false,null,922818724982241,[[-1,37,null,0,true,false,false,578727808501421,false,[[0,[19,38,[[20,0,27,false,null]]]]]]],[[1,18,null,807666034483826,false,[[3,0],[7,[10,[10,[10,[10,[10,[2,"Hint "],[19,39]],[2," : "]],[20,0,40,true,null]],[2," with value : "]],[20,0,41,false,null,[[19,39]]]]]]],[-1,42,null,651771033828547,false,[[4,6],[5,[0,1]],[0,[0,0]],[0,[0,0]]]],[6,31,null,704622762564719,false,[[10,0],[7,[19,39]]]],[6,31,null,695187469527078,false,[[10,1],[7,[20,0,41,false,null,[[19,39]]]]]]],[[0,null,false,null,604960297620975,[[-1,43,null,0,false,false,false,844495449650107,false,[[7,[20,0,41,false,null,[[19,39]]]],[8,1],[7,[2,"_"]]]]],[[6,44,null,823022840733889,false,[[10,2],[3,1]]],[-1,42,null,958284889834122,false,[[4,11],[5,[0,1]],[0,[20,6,32,false,null]],[0,[20,6,33,false,null]]]],[11,29,"Pin",825467296870188,false,[[4,6],[3,0]]],[11,30,null,803189241402852,false,[[7,[21,6,true,null,1]]]],[6,45,null,856529103233458,false,[[0,[0,1]]]],[6,46,null,785587981903003,false,[[0,[4,[20,11,47,false,null],[0,55]]]]],[0,48,null,305159202206615,false,[[0,[19,39]],[0,[20,6,49,false,null]]]],[11,50,null,247694523519901,false],[6,16,null,469126797493941,false]]],[0,null,false,null,785602319872296,[[-1,51,null,0,false,false,false,563695588455666,false]],[[6,44,null,921480770631311,false,[[10,2],[3,0]]],[6,45,null,666455255522669,false,[[0,[0,0]]]],[0,48,null,890029307940799,false,[[0,[19,39]],[0,[20,6,49,false,null]]]],[6,16,null,284415432774208,false]]]]],[0,null,false,null,920731157755918,[],[[0,52,null,643973518572382,false,[[0,[19,38,[[20,0,27,false,null]]]],[0,[0,0]],[0,[0,5]],[0,[0,1200]],[0,[0,0]],[0,[0,130]],[1,[2,"slot"]],[0,[0,0]]]]]],[0,null,false,null,441467613146144,[[-1,37,null,0,true,false,false,218190693390519,false,[[0,[19,38,[[20,0,26,false,null]]]]]]],[[-1,42,null,722355474670048,false,[[4,7],[5,[0,1]],[0,[0,0]],[0,[0,0]]]],[7,31,null,811282502817081,false,[[10,1],[7,[20,0,53,true,null,[[19,39]]]]]],[-1,42,null,820542104698850,false,[[4,10],[5,[0,1]],[0,[20,7,32,false,null]],[0,[20,7,33,false,null]]]],[10,29,"Pin",165265909130423,false,[[4,7],[3,0]]],[10,30,null,752256115955919,false,[[7,[21,7,true,null,1]]]],[7,46,null,155561272720672,false,[[0,[4,[20,10,47,false,null],[0,55]]]]],[0,48,null,692927617920425,false,[[0,[19,39]],[0,[20,7,49,false,null]]]],[10,50,null,864841283022193,false],[7,16,null,576092429841287,false]]],[0,null,false,null,848165074712850,[],[[0,52,null,737719939649407,false,[[0,[19,38,[[20,0,26,false,null]]]],[0,[0,0]],[0,[0,5]],[0,[0,1200]],[0,[0,0]],[0,[0,130]],[1,[2,"word"]],[0,[0,0]]]],[2,54,null,256704970269789,false,[[0,[4,[20,0,55,false,null,[[0,0]]],[0,800]]]]]]]]]]],[0,null,false,null,997314674077454,[[0,56,null,1,false,false,false,556163418608689,false]],[],[[0,null,false,null,355153915147616,[[-1,37,null,0,true,false,false,479740563968203,false,[[0,[19,38,[[20,0,26,false,null]]]]]]],[[1,18,null,689103076681826,false,[[3,0],[7,[10,[10,[10,[10,[10,[2,"Options "],[19,39]],[2," : "]],[20,0,57,true,null]],[2," with value : "]],[20,0,53,true,null,[[19,39]]]]]]],[-1,42,null,536021616792282,false,[[4,7],[5,[0,1]],[0,[20,0,58,false,null,[[19,39]]]],[0,[4,[20,0,55,false,null,[[19,39]]],[0,710]]]]],[7,31,null,491204402301957,false,[[10,0],[7,[19,39]]]],[7,31,null,925119020627679,false,[[10,1],[7,[20,0,53,true,null,[[19,39]]]]]],[7,31,null,279026344200979,false,[[10,4],[7,[0,-1]]]],[7,31,null,641677468774405,false,[[10,2],[7,[20,7,32,false,null]]]],[7,31,null,774280661547726,false,[[10,3],[7,[20,7,33,false,null]]]],[-1,42,null,100725827513558,false,[[4,10],[5,[0,1]],[0,[20,7,32,false,null]],[0,[20,7,33,false,null]]]],[10,29,"Pin",505562954529213,false,[[4,7],[3,0]]],[10,30,null,391419035005796,false,[[7,[21,7,true,null,1]]]],[7,46,null,860988481953726,false,[[0,[4,[20,10,47,false,null],[0,55]]]]],[0,48,null,103271143582978,false,[[0,[19,39]],[0,[20,7,49,false,null]]]]]]]],[0,null,false,null,388616216124882,[[0,59,null,1,false,false,false,873344899497889,false]],[],[[0,null,false,null,227594386821892,[[-1,37,null,0,true,false,false,788089564561534,false,[[0,[19,38,[[20,0,27,false,null]]]]]]],[[1,18,null,538515159765835,false,[[3,0],[7,[10,[10,[10,[10,[10,[2,"Hint "],[19,39]],[2," : "]],[20,0,40,true,null]],[2," with value : "]],[20,0,41,false,null,[[19,39]]]]]]],[-1,42,null,917423513497860,false,[[4,6],[5,[0,1]],[0,[20,0,58,false,null,[[19,39]]]],[0,[4,[20,0,55,false,null,[[19,39]]],[0,680]]]]],[6,31,null,885155242519331,false,[[10,0],[7,[19,39]]]],[6,31,null,170311315024008,false,[[10,1],[7,[20,0,41,false,null,[[19,39]]]]]]],[[0,null,false,null,932083303817316,[[-1,43,null,0,false,false,false,832596978727902,false,[[7,[20,0,41,false,null,[[19,39]]]],[8,1],[7,[2,"_"]]]]],[[6,44,null,674435878930204,false,[[10,2],[3,1]]],[-1,42,null,598659803385515,false,[[4,11],[5,[0,1]],[0,[20,6,32,false,null]],[0,[20,6,33,false,null]]]],[11,29,"Pin",988991898604501,false,[[4,6],[3,0]]],[11,30,null,972496488135703,false,[[7,[21,6,true,null,1]]]],[6,45,null,151981119976494,false,[[0,[0,1]]]],[6,46,null,854754102590480,false,[[0,[4,[20,11,47,false,null],[0,55]]]]],[0,48,null,475492564317210,false,[[0,[19,39]],[0,[20,6,49,false,null]]]]]],[0,null,false,null,253535619821753,[[-1,51,null,0,false,false,false,596843830651572,false]],[[6,44,null,474962435503345,false,[[10,2],[3,0]]],[6,45,null,463298175284581,false,[[0,[0,0]]]],[0,48,null,380730123367630,false,[[0,[19,39]],[0,[20,6,49,false,null]]]],[-1,60,null,125836199326093,false,[[11,"end"],[7,[0,1]]]]]]]]]],[0,null,false,null,137496831767080,[[0,61,null,1,false,false,false,346135299892592,false]],[],[[0,null,false,null,916974100288240,[[-1,62,null,0,true,false,false,543455768136315,false,[[4,6]]]],[[6,34,null,417809743337938,false,[[0,[20,0,58,false,null,[[19,39]]]],[0,[4,[20,0,55,false,null,[[19,39]]],[0,680]]]]]],[[0,null,false,null,879941464486947,[[-1,63,null,0,false,false,false,417542307709594,false,[[4,7],[7,[21,7,false,null,4]],[8,0],[7,[21,6,false,null,0]]]]],[[7,34,null,848187759165276,false,[[0,[20,6,32,false,null]],[0,[20,6,33,false,null]]]]]]]]]],[0,null,false,null,763597622682356,[[3,64,null,1,false,false,false,148754164973502,false,[[4,2]]],[2,65,null,0,false,false,false,378361995735280,false],[-1,66,null,0,false,false,false,162773589948112,false,[[11,"Paused"],[8,0],[7,[0,0]]]]],[[14,67,null,875006900842783,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[0,68,null,517084261342335,false],[7,69,"DragDrop",352636312980555,false,[[3,0]]],[-1,28,null,898398251674971,false,[[11,"answer"],[7,[2,""]]]],[8,70,null,883647667738561,false,[[1,[2,"currentAnswer"]],[13]]],[-1,71,null,512432222163791,false,[[0,[0,3]]]]]],[0,null,false,null,136988596360100,[[0,72,null,1,false,false,false,156300277320938,false]],[[14,67,null,852018787691909,false,[[2,["correct",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[-1,42,null,875693788454205,false,[[4,13],[5,[0,1]],[0,[20,2,32,false,null]],[0,[20,2,33,false,null]]]],[13,45,null,839154739990506,false,[[0,[0,0]]]]]],[0,null,false,null,488252630180568,[[0,73,null,1,false,false,false,126590912667103,false]],[[14,67,null,979948713775875,false,[[2,["error-010-206498",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[-1,42,null,747791078913276,false,[[4,13],[5,[0,1]],[0,[20,2,32,false,null]],[0,[20,2,33,false,null]]]],[13,45,null,616147821154826,false,[[0,[0,1]]]]]],[0,null,false,null,661948158679917,[[3,64,null,1,false,false,false,505083980566323,false,[[4,4]]]],[[0,68,null,221115629617334,false]]],[0,null,false,null,871816213339027,[[3,64,null,1,false,false,false,203945147432710,false,[[4,5]]]],[[0,74,null,299687746228930,false]]],[0,null,false,null,317150235088713,[[0,75,null,1,false,false,false,191847409940776,false]],[[-1,28,null,610917235070761,false,[[11,"Paused"],[7,[0,1]]]]]],[0,null,false,null,274698478784687,[[0,76,null,1,false,false,false,882196292313245,false]],[[-1,28,null,511887800092603,false,[[11,"Paused"],[7,[0,0]]]]]],[0,null,false,null,195066173189518,[[-1,77,null,0,false,false,false,290390615201190,false]],[],[[0,null,false,null,360442996781782,[[-1,43,null,0,false,false,false,548786409907532,false,[[7,[20,0,78,false,null]],[8,4],[7,[0,0]]]]],[[-1,28,null,188457301435729,false,[[11,"timeLeft"],[7,[19,79,[[0,0],[5,[20,0,78,false,null],[20,0,80,false,null]]]]]]],[9,30,null,186957390014795,false,[[7,[19,38,[[23,"timeLeft"]]]]]]]]]],[0,null,false,null,294529570370137,[[-1,77,null,0,false,false,false,737378517361957,false]],[],[[0,null,false,null,554738329309418,[[-1,43,null,0,false,false,false,716392425028141,false,[[7,[20,0,80,false,null]],[8,4],[7,[20,0,78,false,null]]]],[-1,66,null,0,false,false,false,780183147912832,false,[[11,"isTimeUp"],[8,0],[7,[0,0]]]],[-1,81,null,0,false,false,false,525077339862079,false]],[[-1,28,null,143657325576872,false,[[11,"isTimeUp"],[7,[0,1]]]],[7,69,"DragDrop",816065893034813,false,[[3,0]]],[10,50,null,965564233186280,false],[7,82,"Fade",532407797948589,false],[-1,71,null,127771899136112,false,[[0,[1,1]]]],[6,82,"Fade",840135179749270,false],[7,16,null,280448711318062,false],[11,50,null,860486584174303,false],[0,83,null,722573403513740,false,[[7,[23,"answer"]]]]]]]],[0,null,false,null,681702081983565,[[8,84,null,2,false,false,false,298041374468676,false,[[1,[2,"currentAnswer"]]]]],[],[[0,null,false,null,137994023265162,[[-1,85,null,0,true,false,false,555590637488718,false,[[1,[2,"i"]],[0,[0,0]],[0,[5,[19,38,[[20,0,27,false,null]]],[0,1]]]]]],[],[[0,null,false,null,985822966767783,[[-1,63,null,0,false,false,false,624232920295487,false,[[4,6],[7,[21,6,false,null,0]],[8,0],[7,[19,39]]]]],[[-1,28,null,857204506251739,false,[[11,"answer"],[7,[10,[10,[23,"answer"],[21,6,true,null,1]],[2,"|"]]]]]]]]],[0,null,false,null,940103363702696,[],[[-1,28,null,562027140905701,false,[[11,"answer"],[7,[19,86,[[23,"answer"],[5,[19,87,[[23,"answer"]]],[0,1]]]]]]],[0,83,null,169098649828276,false,[[7,[23,"answer"]]]]]]]],[0,null,false,null,727817921462789,[[3,64,null,1,false,false,false,108505438464022,false,[[4,15]]],[-1,88,null,0,false,false,false,610596175587088,false,[[5,[0,1]]]]],[],[[0,null,false,null,235491499504531,[[19,89,null,0,false,false,false,155448615733244,false,[[8,0],[0,[20,15,33,false,null]]]]],[[14,67,null,294820226005928,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[18,90,"MoveTo",755380023179324,false,[[0,[21,18,false,null,0]],[0,[21,18,false,null,1]]]],[19,90,"MoveTo",901484735891669,false,[[0,[21,19,false,null,0]],[0,[21,19,false,null,1]]]]]],[0,null,false,null,101845070576145,[[19,89,null,0,false,false,false,252338104312800,false,[[8,0],[0,[21,19,false,null,1]]]]],[[14,67,null,302680351912155,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[18,91,"MoveTo",478407850108954,false,[[4,15]]],[19,91,"MoveTo",149592764052604,false,[[4,15]]]]]]],[0,null,false,null,425688163884150,[[3,64,null,1,false,false,false,234631560209387,false,[[4,19]]],[19,89,null,0,false,false,false,226854573439244,false,[[8,0],[0,[21,19,false,null,1]]]]],[[14,67,null,673559809421156,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]]],[[0,null,false,null,289041913893922,[[19,92,null,0,false,false,false,987327175843166,false,[[8,0],[0,[0,0]]]]],[[19,45,null,527221309063653,false,[[0,[0,1]]]],[14,93,null,512396695148483,false,[[3,0]]]]],[0,null,false,null,723297863178989,[[-1,51,null,0,false,false,false,442294654095608,false]],[[19,45,null,889768403943904,false,[[0,[0,0]]]],[14,93,null,575251195374348,false,[[3,1]]]]]]],[0,null,false,null,797604063574455,[[3,64,null,1,false,false,false,435979848233842,false,[[4,18]]],[18,89,null,0,false,false,false,428645173671679,false,[[8,0],[0,[21,18,false,null,1]]]]],[[14,67,null,278201420832843,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[0,68,null,293121306154050,false],[18,91,"MoveTo",361279997459133,false,[[4,15]]],[19,91,"MoveTo",775451581878906,false,[[4,15]]],[-1,71,null,443896622001002,false,[[0,[1,0.5]]]],[-1,15,null,958274146221115,false,[[5,[0,1]],[3,0]]],[-1,15,null,350999554669409,false,[[5,[0,2]],[3,1]]]]],[0,null,false,null,784412967489758,[[3,64,null,1,false,false,false,357044148333403,false,[[4,21]]],[-1,88,null,0,false,false,false,279540051091502,false,[[5,[0,2]]]]],[[14,67,null,816121502780137,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[0,74,null,724669397859175,false],[-1,15,null,929561454791375,false,[[5,[0,1]],[3,1]]],[-1,15,null,645435946734615,false,[[5,[0,2]],[3,0]]]]]]],["DrapDrop",[[1,"filledCount",0,-1,false,false,528865922993012,false],[0,null,false,null,197106660861514,[[7,94,"DragDrop",1,false,false,false,528907557634308,false]],[[14,67,null,162558464641912,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]]],[[0,null,false,null,266963171745346,[[7,95,null,0,false,false,false,673397366023432,false,[[10,4],[8,1],[7,[0,-1]]]],[6,95,null,0,false,false,false,577869128870380,false,[[10,0],[8,0],[7,[21,7,false,null,4]]]],[7,96,null,0,false,false,false,609479521709627,false,[[4,10]]]],[[6,31,null,445026196152632,false,[[10,1],[7,[2,"_"]]]],[7,97,null,670463517581139,false],[10,98,null,538995332098798,false]]],[0,null,false,null,816493828433722,[[-1,51,null,0,false,false,false,390659514117980,false]],[],[[0,null,false,null,487754364377713,[[7,96,null,0,false,false,false,443159185077976,false,[[4,10]]]],[[7,97,null,774809908055048,false],[10,98,null,501986465343455,false]]]]]]],[0,null,false,null,946639210805430,[[7,99,"DragDrop",1,false,false,false,155941787306139,false]],[[14,67,null,361413524752870,false,[[2,["immersivecontrol-button-click-sound-463065",false]],[3,0],[0,[0,-2]],[1,[2,""]]]]],[[0,null,false,null,504792991445212,[[7,96,null,0,false,false,false,845450333794375,false,[[4,6]]],[6,100,null,0,false,true,false,204552588897544,false,[[10,2]]]],[],[[0,null,false,null,106550985509374,[[6,101,null,0,false,false,true,170480452496238,false,[[3,0],[0,[20,7,32,false,null]],[0,[20,7,33,false,null]]]],[6,95,null,0,false,false,false,938809230173413,false,[[10,1],[8,0],[7,[2,"_"]]]]],[],[[0,null,false,null,800826128186269,[[7,95,null,0,false,false,false,542293663517978,false,[[10,4],[8,0],[7,[0,-1]]]]],[[6,31,null,568930528296173,false,[[10,1],[7,[21,7,true,null,1]]]],[6,46,null,848464562069708,false,[[0,[20,7,49,false,null]]]],[7,31,null,319064212608435,false,[[10,4],[7,[21,6,false,null,0]]]],[-1,60,null,416857348260297,false,[[11,"filledCount"],[7,[0,1]]]],[0,102,null,419250460039333,false,[[1,[19,103,[[21,7,true,null,1]]]],[1,[19,103,[[21,6,false,null,0]]]],[1,[2,""]],[1,[2,""]],[1,[2,""]]]],[0,104,null,278619922018473,false]]],[0,null,false,null,296319278611324,[[-1,51,null,0,false,false,false,250133201929726,false]],[[6,31,null,347684935320096,false,[[10,1],[7,[21,7,true,null,1]]]],[6,46,null,166802160277172,false,[[0,[20,7,49,false,null]]]],[7,31,null,116855994129968,false,[[10,4],[7,[21,6,false,null,0]]]],[0,102,null,842443888451723,false,[[1,[19,103,[[21,7,true,null,1]]]],[1,[19,103,[[21,6,false,null,0]]]],[1,[2,""]],[1,[2,""]],[1,[2,""]]]],[0,104,null,156485599688224,false]]]]],[0,null,false,null,180540551233675,[[-1,51,null,0,false,false,false,806523891610870,false],[7,95,null,0,false,false,false,831308228851461,false,[[10,4],[8,1],[7,[0,-1]]]]],[[7,105,"MoveTo",416883713281691,false,[[0,[0,1200]]]],[7,90,"MoveTo",572186182608955,false,[[0,[21,7,false,null,2]],[0,[21,7,false,null,3]]]],[7,31,null,370498434376498,false,[[10,4],[7,[0,-1]]]],[-1,60,null,250504698972287,false,[[11,"filledCount"],[7,[0,-1]]]],[0,102,null,506661306954504,false,[[1,[19,103,[[21,7,true,null,1]]]],[1,[2,"-1"]],[1,[2,"d3"]],[1,[2,"d4"]],[1,[2,"d5"]]]],[0,104,null,412688010532382,false]]],[0,null,false,null,664272208282422,[[-1,51,null,0,false,false,false,895425177786413,false],[7,95,null,0,false,false,false,246894625675163,false,[[10,4],[8,0],[7,[0,-1]]]]],[[7,105,"MoveTo",888826482377214,false,[[0,[0,1200]]]],[7,90,"MoveTo",393405307018971,false,[[0,[21,7,false,null,2]],[0,[21,7,false,null,3]]]],[7,31,null,503673017513230,false,[[10,4],[7,[0,-1]]]],[0,102,null,872163608896537,false,[[1,[19,103,[[21,7,true,null,1]]]],[1,[2,"-1"]],[1,[2,"d3"]],[1,[2,"d4"]],[1,[2,"d5"]]]],[0,104,null,249407021381141,false]]]]],[0,null,false,null,818745098688947,[[-1,51,null,0,false,false,false,929804756669469,false],[7,95,null,0,false,false,false,177859681995434,false,[[10,4],[8,1],[7,[0,-1]]]]],[[7,105,"MoveTo",449724002535088,false,[[0,[0,1200]]]],[7,90,"MoveTo",721292388859295,false,[[0,[21,7,false,null,2]],[0,[21,7,false,null,3]]]],[7,31,null,733212651291432,false,[[10,4],[7,[0,-1]]]],[-1,60,null,739300525987860,false,[[11,"filledCount"],[7,[0,-1]]]],[0,102,null,712656902299986,false,[[1,[19,103,[[21,7,true,null,1]]]],[1,[2,"-1"]],[1,[2,"d3"]],[1,[2,"d4"]],[1,[2,"d5"]]]],[0,104,null,662902606044899,false]]],[0,null,false,null,358120937494399,[[-1,51,null,0,false,false,false,416712700522674,false],[7,95,null,0,false,false,false,261187518957115,false,[[10,4],[8,0],[7,[0,-1]]]]],[[7,105,"MoveTo",431242330954619,false,[[0,[0,1200]]]],[7,90,"MoveTo",754072653542168,false,[[0,[21,7,false,null,2]],[0,[21,7,false,null,3]]]],[7,31,null,272960877861772,false,[[10,4],[7,[0,-1]]]],[0,102,null,303992708864385,false,[[1,[19,103,[[21,7,true,null,1]]]],[1,[2,"-1"]],[1,[2,"d3"]],[1,[2,"d4"]],[1,[2,"d5"]]]],[0,104,null,102997629264439,false]]],[0,null,false,null,701043374178700,[[6,95,null,0,false,false,false,425036129926507,false,[[10,1],[8,0],[7,[2,"_"]]]]],[[6,46,null,490670519672817,false,[[0,[0,200]]]]]]]],[0,null,false,null,580675938654997,[[7,106,"DragDrop",0,false,false,false,411147921527630,false]],[]],[0,null,false,null,622060364017684,[[-1,77,null,0,false,false,false,228576696549219,false]],[],[[0,null,false,null,108730370076990,[[-1,66,null,0,false,false,false,538413628199561,false,[[11,"filledCount"],[8,0],[7,[23,"end"]]]]],[[2,107,null,445242465744130,false,[[3,1]]]]],[0,null,false,null,218835501607731,[[-1,51,null,0,false,false,false,933470660702724,false]],[[2,107,null,797052197521566,false,[[3,0]]]]]]],[0,null,false,null,382266478838536,[[7,99,"DragDrop",1,false,false,false,468373822389217,false]],[],[[0,null,false,null,669608212668633,[[-1,62,null,0,true,false,false,763136610920305,false,[[4,6]]]],[[0,48,null,216937320154014,false,[[0,[19,39]],[0,[20,6,49,false,null]]]]]],[0,null,false,null,557294689920251,[],[[0,52,null,903284616101407,false,[[0,[19,38,[[20,0,27,false,null]]]],[0,[0,0]],[0,[0,5]],[0,[0,1200]],[0,[0,0]],[0,[0,130]],[1,[2,"slot2"]],[0,[0,0]]]]]]]]]],["move",[[0,null,false,null,247537098385321,[[0,108,null,1,false,false,false,357653839729988,false]],[[22,109,null,481034101118882,false,[[1,[20,0,110,true,null]],[3,0],[13]]],[-1,71,null,923787823234004,false,[[0,[1,0.0001]]]]],[[0,null,false,null,501329491159206,[[-1,63,null,0,false,false,false,329723730163277,false,[[4,7],[7,[21,7,true,null,1]],[8,0],[7,[19,103,[[20,22,111,false,null,[[0,0],[2,"data1"]]]]]]]]],[],[[0,null,false,null,373485886439115,[[-1,63,null,0,false,false,false,667505268608524,false,[[4,6],[7,[19,38,[[20,22,111,false,null,[[0,0],[2,"data2"]]]]]],[8,0],[7,[21,6,false,null,0]]]]],[[7,91,"MoveTo",724531557833079,false,[[4,6]]]]],[0,null,false,null,176622797861199,[[-1,51,null,0,false,false,false,494998059713904,false],[-1,63,null,0,false,false,false,646024827473206,false,[[4,7],[7,[21,7,true,null,1]],[8,0],[7,[19,103,[[20,22,111,false,null,[[0,0],[2,"data1"]]]]]]]]],[[7,90,"MoveTo",116962450760903,false,[[0,[21,7,false,null,2]],[0,[21,7,false,null,3]]]]]]]],[0,null,false,null,393296075303458,[[-1,43,null,0,false,false,false,423617115709335,false,[[7,[19,38,[[20,22,111,false,null,[[0,0],[2,"data3"]]]]]],[8,0],[7,[0,1]]]],[2,65,null,0,false,false,false,344349834250107,false]],[[14,67,null,886430907172802,false,[[2,["click",false]],[3,0],[0,[0,-2]],[1,[2,""]]]],[0,68,null,435408274602653,false],[7,69,"DragDrop",291762055141813,false,[[3,0]]],[-1,28,null,960430821480250,false,[[11,"answer"],[7,[2,""]]]],[8,70,null,411309036756794,false,[[1,[2,"currentAnswer"]],[13]]],[-1,71,null,928569719414780,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,31,false,true,1,true,"image_spelling_sequence_sentence_teacher_2",0,[]]} \ No newline at end of file diff --git a/image_spelling_sequence_sentence/images/5sosarahtakesoff-sheet0.png b/image_spelling_sequence_sentence/images/5sosarahtakesoff-sheet0.png deleted file mode 100644 index 16015c4..0000000 Binary files a/image_spelling_sequence_sentence/images/5sosarahtakesoff-sheet0.png and /dev/null differ diff --git a/image_spelling_sequence_sentence/images/btn_check-sheet0.png b/image_spelling_sequence_sentence/images/btn_check-sheet0.png index b7ff061..a063d9e 100644 Binary files a/image_spelling_sequence_sentence/images/btn_check-sheet0.png and b/image_spelling_sequence_sentence/images/btn_check-sheet0.png differ diff --git a/image_spelling_sequence_sentence/images/btn_music-sheet0.png b/image_spelling_sequence_sentence/images/btn_music-sheet0.png index d8da2aa..0a5a399 100644 Binary files a/image_spelling_sequence_sentence/images/btn_music-sheet0.png and b/image_spelling_sequence_sentence/images/btn_music-sheet0.png differ diff --git a/image_spelling_sequence_sentence/images/btn_music-sheet1.png b/image_spelling_sequence_sentence/images/btn_music-sheet1.png deleted file mode 100644 index 6a94568..0000000 Binary files a/image_spelling_sequence_sentence/images/btn_music-sheet1.png and /dev/null differ diff --git a/image_spelling_sequence_sentence/images/btn_pause-sheet0.png b/image_spelling_sequence_sentence/images/btn_pause-sheet0.png index 0171eb1..60681e8 100644 Binary files a/image_spelling_sequence_sentence/images/btn_pause-sheet0.png and b/image_spelling_sequence_sentence/images/btn_pause-sheet0.png differ diff --git a/image_spelling_sequence_sentence/images/btn_setting-sheet0.png b/image_spelling_sequence_sentence/images/btn_setting-sheet0.png index de69472..3a1dd99 100644 Binary files a/image_spelling_sequence_sentence/images/btn_setting-sheet0.png and b/image_spelling_sequence_sentence/images/btn_setting-sheet0.png differ diff --git a/image_spelling_sequence_sentence/images/btn_worditem-sheet0.png b/image_spelling_sequence_sentence/images/btn_worditem-sheet0.png new file mode 100644 index 0000000..defdace Binary files /dev/null and b/image_spelling_sequence_sentence/images/btn_worditem-sheet0.png differ diff --git a/image_spelling_sequence_sentence/images/img-sheet0.png b/image_spelling_sequence_sentence/images/img-sheet0.png new file mode 100644 index 0000000..892b862 Binary files /dev/null and b/image_spelling_sequence_sentence/images/img-sheet0.png differ diff --git a/image_spelling_sequence_sentence/images/layer2copy-sheet0.png b/image_spelling_sequence_sentence/images/layer2copy-sheet0.png deleted file mode 100644 index fe24a31..0000000 Binary files a/image_spelling_sequence_sentence/images/layer2copy-sheet0.png and /dev/null differ diff --git a/image_spelling_sequence_sentence/images/newwordpng-sheet0.png b/image_spelling_sequence_sentence/images/newwordpng-sheet0.png deleted file mode 100644 index 739d176..0000000 Binary files a/image_spelling_sequence_sentence/images/newwordpng-sheet0.png and /dev/null differ diff --git a/image_spelling_sequence_sentence/images/panel-sheet0.png b/image_spelling_sequence_sentence/images/panel-sheet0.png index 1fabe01..ae76e71 100644 Binary files a/image_spelling_sequence_sentence/images/panel-sheet0.png and b/image_spelling_sequence_sentence/images/panel-sheet0.png differ diff --git a/image_spelling_sequence_sentence/images/senaaikhoi-sheet0.png b/image_spelling_sequence_sentence/images/senaaikhoi-sheet0.png index 7f29f08..a3d31d1 100644 Binary files a/image_spelling_sequence_sentence/images/senaaikhoi-sheet0.png and b/image_spelling_sequence_sentence/images/senaaikhoi-sheet0.png differ diff --git a/image_spelling_sequence_sentence/images/slot-sheet0.png b/image_spelling_sequence_sentence/images/slot-sheet0.png index d45a87f..00f229a 100644 Binary files a/image_spelling_sequence_sentence/images/slot-sheet0.png and b/image_spelling_sequence_sentence/images/slot-sheet0.png differ diff --git a/image_spelling_sequence_sentence/images/txt_texttimer.png b/image_spelling_sequence_sentence/images/txt_texttimer.png index a756f4c..713c031 100644 Binary files a/image_spelling_sequence_sentence/images/txt_texttimer.png and b/image_spelling_sequence_sentence/images/txt_texttimer.png differ diff --git a/image_spelling_sequence_sentence/images/txt_worditem.png b/image_spelling_sequence_sentence/images/txt_worditem.png index 18d3a82..deae8e0 100644 Binary files a/image_spelling_sequence_sentence/images/txt_worditem.png and b/image_spelling_sequence_sentence/images/txt_worditem.png differ diff --git a/image_spelling_sequence_sentence/index.html b/image_spelling_sequence_sentence/index.html index 0df7d6f..1cd3da6 100644 --- a/image_spelling_sequence_sentence/index.html +++ b/image_spelling_sequence_sentence/index.html @@ -3,7 +3,7 @@ - Sequence + image_spelling_sequence_sentence_teacher_2 diff --git a/image_spelling_sequence_sentence/offline.js b/image_spelling_sequence_sentence/offline.js index 44caf77..2cef0aa 100644 --- a/image_spelling_sequence_sentence/offline.js +++ b/image_spelling_sequence_sentence/offline.js @@ -1,5 +1,5 @@ { - "version": 1769513293, + "version": 1772434281, "fileList": [ "data.js", "c2runtime.js", @@ -8,9 +8,9 @@ "images/btn_check-sheet0.png", "images/pause-sheet0.png", "images/slot-sheet0.png", + "images/btn_worditem-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", @@ -18,11 +18,9 @@ "images/panel-sheet0.png", "images/btn_pause-sheet0.png", "images/btn_music-sheet0.png", - "images/btn_music-sheet1.png", "images/panel_pause-sheet0.png", "images/layer-sheet0.png", - "images/newwordpng-sheet0.png", - "images/layer2copy-sheet0.png", + "images/img-sheet0.png", "media/click.ogg", "media/correct.ogg", "media/error-010-206498.ogg", diff --git a/image_spelling_sequence_sentence/sena_sdk.js b/image_spelling_sequence_sentence/sena_sdk.js index 21eed1a..42bdc73 100644 --- a/image_spelling_sequence_sentence/sena_sdk.js +++ b/image_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..c204253 100644 Binary files a/source/Sequence.capx and b/source/Sequence.capx differ diff --git a/source/Sequence.capx.autosave b/source/Sequence.capx.autosave new file mode 100644 index 0000000..07befd3 Binary files /dev/null and b/source/Sequence.capx.autosave differ diff --git a/source/Sequence.capx.backup1 b/source/Sequence.capx.backup1 new file mode 100644 index 0000000..364cff5 Binary files /dev/null and b/source/Sequence.capx.backup1 differ