Fix: convert space to Space

This commit is contained in:
2019-05-16 09:31:10 +09:00
parent beec67a1e9
commit 431e3a8881
+25 -24
View File
@@ -395,8 +395,6 @@ var TypingTest = {
if(this.typingIndex == this.typingContentLength) if(this.typingIndex == this.typingContentLength)
this.gameOver(); this.gameOver();
// this.goResult();
// this.state.start('TypingTestResult');
return; return;
} }
@@ -443,10 +441,12 @@ var TypingTest = {
}, },
getHighlioghtKey: function(inputContent, typingContent) { getHighlioghtKey: function(inputContent, typingContent) {
var highlightKey = "";
var inputLength = inputContent.length; var inputLength = inputContent.length;
var typingLength = typingContent.length; var typingLength = typingContent.length;
console.log("inputLength : " + inputLength + " / " + inputContent); // console.log("inputLength : " + inputLength + " / " + inputContent);
console.log("typingLength : " + typingLength + " / " + typingContent); // console.log("typingLength : " + typingLength + " / " + typingContent);
if(inputLength == typingLength) if(inputLength == typingLength)
return undefined; return undefined;
@@ -460,37 +460,38 @@ var TypingTest = {
// english typing test // english typing test
if(isEnglishTypingApp()) { if(isEnglishTypingApp()) {
console.log("===== english"); // console.log("===== english");
console.log("misspelledIndex : " + misspelledIndex); // console.log("misspelledIndex : " + misspelledIndex);
if(misspelledIndex == -1) if(misspelledIndex == -1)
return typingContent[inputLength]; highlightKey = typingContent[inputLength];
else if(misspelledIndex > -1) else if(misspelledIndex > -1)
highlightKey = "Backspace";
else
highlightKey = typingContent[misspelledIndex];
}
// korean typing test
else {
if(misspelledIndex > -1)
return "Backspace"; 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 var typingAlphabet = "";
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 inputLetterAlphabets = StringUtil.toKoreanAlphabets(inputContent[inputIndex]); // var inputLetterAlphabets = StringUtil.toKoreanAlphabets(inputContent[inputIndex]);
// var typingLetterAlphabets = StringUtil.toKoreanAlphabets(typingContent[inputIndex]); // var typingLetterAlphabets = StringUtil.toKoreanAlphabets(typingContent[inputIndex]);
// console.log("inputLetterAlphabets : " + inputLetterAlphabets); // console.log("inputLetterAlphabets : " + inputLetterAlphabets);
// console.log("typingLetterAlphabets : " + typingLetterAlphabets); // console.log("typingLetterAlphabets : " + typingLetterAlphabets);
} else {
} }
return "a"; if(highlightKey == " ")
highlightKey = "Space";
return highlightKey;
}, },
hideHighlightKey: function(highlightKey) { hideHighlightKey: function(highlightKey) {