=correct.length-1; G.lastAnswerOk=ok; G.lastCorrectAnswer=ok?null:ex.word.en; } else if(ex.mode==='translate_en'){ // Fuzzy check: must contain the key English word var keyWord=ex.word.en.toLowerCase(); ok=val.includes(keyWord)||keyWord.includes(val)&&val.length>3; // Also check length - should be a sentence attempt if(val.split(' ').length<2) ok=false; G.lastAnswerOk=ok; G.lastCorrectAnswer=ok?null:ex.word.ex; } else if(ex.mode==='translate_ru'){ // Fuzzy check: must contain key Russian word var keyRu=ex.word.ru.split(',')[0].toLowerCase().trim(); ok=val.includes(keyRu.split(' ')[0])||val.length>5&&val.split(' ').length>1; G.lastAnswerOk=ok; G.lastCorrectAnswer=ok?null:ex.word.ru; } processAnswer(ok,ex.word.id); }; var fi=document.getElementById('fill-in'); if(fi){ fi.focus(); fi.onkeydown=function(e){ if(e.key==='Enter'){ var ck2=document.getElementById('btn-check'); if(ck2) ck2.click(); var nx2=document.getElementById('btn-next'); if(nx2) nx2.click(); } }; } } >