From bca1382230f4fa4b1717b4c32eb3418484281b9d Mon Sep 17 00:00:00 2001 From: toxinu Date: Sun, 10 Oct 2021 20:51:14 +0000 Subject: [PATCH] Add auto next question and auto explanation options --- conjugation/drill.html | 31 +++++++++++++++++++++++-------- conjugation/drill.js | 17 ++++++++++++++++- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/conjugation/drill.html b/conjugation/drill.html index 0a6007f..fd41f9d 100755 --- a/conjugation/drill.html +++ b/conjugation/drill.html @@ -168,15 +168,30 @@
-
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ -
-
-
diff --git a/conjugation/drill.js b/conjugation/drill.js index 14d0ebb..6d76f55 100755 --- a/conjugation/drill.js +++ b/conjugation/drill.js @@ -9,7 +9,9 @@ const configOptions = { options: ["plain", "polite", "negative", "past", "te-form", "progressive", "potential", "imperative", "passive", "causative", "godan", "ichidan", "iku", "kuru", "suru", "i-adjective", "na-adjective", "ii", "desire", - "volitional", "trick", "kana", "furigana_always", "use_voice"], + "volitional", "trick", "kana", "furigana_always", "use_voice", "go_to_next_question", + "auto_show_explanation", + ], selects: ["questionFocus"], @@ -40,6 +42,8 @@ const defaultConfig = { "trick": true, "kana": false, "furigana_always": true, + "go_to_next_question": false, + "auto_show_explanation": false, "use_voice": false, "questionFocus": "none", "numQuestions": "10" @@ -529,6 +533,7 @@ function generateQuestion() { function processAnswer() { + var options = getOptions(); var questionData = window.questionData; var response = $('#answer').val().trim(); @@ -578,6 +583,16 @@ function processAnswer() { $('#proceed button').focus(); updateHistoryView(log); + + if (correct) { + if (options.go_to_next_question) { + proceed(); + } + } else { + if (options.auto_show_explanation) { + $('#explanation').show(); + } + } } function shakeInputArea() {