diff --git a/src/game/typing/test/game.js b/src/game/typing/test/game.js index f3ebc7d..4971f75 100644 --- a/src/game/typing/test/game.js +++ b/src/game/typing/test/game.js @@ -395,8 +395,6 @@ var TypingTest = { if(this.typingIndex == this.typingContentLength) this.gameOver(); - // this.goResult(); - // this.state.start('TypingTestResult'); return; } @@ -443,10 +441,12 @@ var TypingTest = { }, getHighlioghtKey: function(inputContent, typingContent) { + var highlightKey = ""; + var inputLength = inputContent.length; var typingLength = typingContent.length; - console.log("inputLength : " + inputLength + " / " + inputContent); - console.log("typingLength : " + typingLength + " / " + typingContent); + // console.log("inputLength : " + inputLength + " / " + inputContent); + // console.log("typingLength : " + typingLength + " / " + typingContent); if(inputLength == typingLength) return undefined; @@ -460,37 +460,38 @@ var TypingTest = { // english typing test if(isEnglishTypingApp()) { - console.log("===== english"); - console.log("misspelledIndex : " + misspelledIndex); + // console.log("===== english"); + // console.log("misspelledIndex : " + misspelledIndex); if(misspelledIndex == -1) - return typingContent[inputLength]; + highlightKey = typingContent[inputLength]; else if(misspelledIndex > -1) + highlightKey = "Backspace"; + else + highlightKey = typingContent[misspelledIndex]; + } + // korean typing test + else { + + if(misspelledIndex > -1) return "Backspace"; - return typingContent[misspelledIndex]; - } + var inputIndex = inputContent.length - 1; + var inputLetter = inputContent[inputIndex]; + var typingLetter = typingContent[inputIndex]; + // console.log("inputLetter : " + inputLetter); + // console.log("typingLetter : " + typingLetter); - // korean typing test - if(misspelledIndex > -1) - return "Backspace"; - - var inputIndex = inputContent.length - 1; - var inputLetter = inputContent[inputIndex]; - var typingLetter = typingContent[inputIndex]; - console.log("inputLetter : " + inputLetter); - console.log("typingLetter : " + typingLetter); - - var typingAlphabet = ""; - if(isKoreanTypingApp()) { + var typingAlphabet = ""; // var inputLetterAlphabets = StringUtil.toKoreanAlphabets(inputContent[inputIndex]); // var typingLetterAlphabets = StringUtil.toKoreanAlphabets(typingContent[inputIndex]); // console.log("inputLetterAlphabets : " + inputLetterAlphabets); // console.log("typingLetterAlphabets : " + typingLetterAlphabets); - } else { - } - return "a"; + if(highlightKey == " ") + highlightKey = "Space"; + + return highlightKey; }, hideHighlightKey: function(highlightKey) {