From 1a7789c4c18fa437b3cc945702ea384cb8c9a8e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Fri, 17 May 2019 07:35:57 +0900 Subject: [PATCH] Fix: over typing error --- src/game/typing/test/game.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/game/typing/test/game.js b/src/game/typing/test/game.js index a9388d6..111bede 100644 --- a/src/game/typing/test/game.js +++ b/src/game/typing/test/game.js @@ -233,13 +233,13 @@ var TypingTest = { initTypingData: function() { var typingTextMan = new TypingTextManager(); + // var typingPracticeContents = [ "꿰뚫다" , "워머신", "홧김에" ]; // for debug var typingPracticeContents = this.getTypingTestContents(); - var typingPracticeContents = [ "꿰뚫다" , "워머신", "홧김에" ]; // console.log(typingPracticeContents); typingTextMan.makeTestContents(typingPracticeContents); var wordCountForStage = TypingTest.WORD_COUNT_FOR_STAGE; - if(isDebugMode()) - wordCountForStage = 3; + // if(isDebugMode()) + // wordCountForStage = 3; typingTextMan.slice(0, wordCountForStage); this.typingRandomContents = typingTextMan.getContents(); // console.log(this.typingRandomContents); @@ -464,10 +464,20 @@ var TypingTest = { } } + // over typing + if(inputLength > typingLength) { + highlightKey = "Backspace"; + } + + // complete typing + else if(inputContent == typingContent) { + highlightKey = "Enter"; + } + // english typing test - if(isEnglishTypingApp()) { - // console.log("===== english"); - // console.log("misspelledIndex : " + misspelledIndex); + else if(isEnglishTypingApp()) { + console.log("===== english"); + console.log("misspelledIndex : " + misspelledIndex); if(inputLength == typingLength) highlightKey = "Enter"; else if(misspelledIndex == -1) @@ -480,8 +490,6 @@ var TypingTest = { // korean typing test else { // console.log(misspelledIndex + " / " + typingContent[misspelledIndex]); - if(inputContent == typingContent) - highlightKey = "Enter"; else if(typingContent[misspelledIndex] == " ") highlightKey = " "; else {