From 2502c099a36a814482937376f0572cc28fcf832c Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Tue, 26 Jan 2016 01:09:43 +0000 Subject: [PATCH] Answer input textbox colour is reset after wrong entry on next keypress. --- static/quiz_item.coffee | 3 +++ static/quiz_item.js | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/static/quiz_item.coffee b/static/quiz_item.coffee index a72bb3d..4c0516a 100644 --- a/static/quiz_item.coffee +++ b/static/quiz_item.coffee @@ -100,6 +100,9 @@ toggleQuizMode = () -> $(document).keypress (e) -> if(e.which == 13) $("#submit-answer").click(); + else + if($("#kana").hasClass("wrong")) + $("#kana").removeClass("wrong") $("#submit-answer").click (e) -> e.preventDefault(); diff --git a/static/quiz_item.js b/static/quiz_item.js index 4a9d8c1..4d869cb 100644 --- a/static/quiz_item.js +++ b/static/quiz_item.js @@ -147,6 +147,10 @@ $(document).keypress(function(e) { if (e.which === 13) { return $("#submit-answer").click(); + } else { + if ($("#kana").hasClass("wrong")) { + return $("#kana").removeClass("wrong"); + } } });