mirror of
https://github.com/ZetaKebab/japanese-conjugation-drill.git
synced 2025-01-14 22:08:44 +00:00
Merge branch 'toxinu/go-to-next-question'
This commit is contained in:
commit
7e17d9cdad
@ -155,15 +155,30 @@
|
||||
|
||||
<div class="row justify-content-center mt-3 ml-2 mr-2">
|
||||
<div class="form-group">
|
||||
<div class="form-check"><input class="form-check-input" type="checkbox" id="trick" checked><label
|
||||
class="form-check-label" for="trick">Trick questions (answers may be the same as the given form)</label>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="trick" checked>
|
||||
<label class="form-check-label" for="trick">Trick questions (answers may be the same as the given form)</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="kana">
|
||||
<label class="form-check-label" for="kana">Use hiragana throughout the test (no kanji)</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="furigana_always" checked>
|
||||
<label class="form-check-label" for="furigana_always">Show furigana on questions</label>
|
||||
</div>
|
||||
<div class="form-check" id="goToNextQuestion">
|
||||
<input class="form-check-input" type="checkbox" id="go_to_next_question">
|
||||
<label class="form-check-label" for="go_to_next_question">Automatically go to the next question on success</label>
|
||||
</div>
|
||||
<div class="form-check" id="autoShowExplanatioj">
|
||||
<input class="form-check-input" type="checkbox" id="auto_show_explanation">
|
||||
<label class="form-check-label" for="auto_show_explanation">Automatically show the explanation on error</label>
|
||||
</div>
|
||||
<div class="form-check" id="useVoiceSection" style="display: none">
|
||||
<input class="form-check-input" type="checkbox" id="use_voice">
|
||||
<label class="form-check-label" for="use_voice">Use speech synthesis (experimental)</label>
|
||||
</div>
|
||||
<div class="form-check"><input class="form-check-input" type="checkbox" id="kana"><label
|
||||
class="form-check-label" for="kana">Use hiragana throughout the test (no kanji)</label></div>
|
||||
<div class="form-check"><input class="form-check-input" type="checkbox" id="furigana_always" checked><label
|
||||
class="form-check-label" for="furigana_always">Show furigana on questions</label></div>
|
||||
<div class="form-check" id="useVoiceSection" style="display: none"><input class="form-check-input" type="checkbox" id="use_voice"><label
|
||||
class="form-check-label" for="use_voice">Use speech synthesis (experimental)</label></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -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();
|
||||
|
||||
@ -579,6 +584,16 @@ function processAnswer() {
|
||||
|
||||
updateHistoryView(log);
|
||||
window.scrollTo(0, 0);
|
||||
|
||||
if (correct) {
|
||||
if (options.go_to_next_question) {
|
||||
proceed();
|
||||
}
|
||||
} else {
|
||||
if (options.auto_show_explanation) {
|
||||
$('#explanation').show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function shakeInputArea() {
|
||||
|
Loading…
Reference in New Issue
Block a user