Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions conjugation/drill.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,30 @@ <h4 class="text-left mt-2 mb-4">Adjectives</h4>

<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>

Expand Down
17 changes: 16 additions & 1 deletion conjugation/drill.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"],

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -529,6 +533,7 @@ function generateQuestion() {

function processAnswer() {

var options = getOptions();
var questionData = window.questionData;
var response = $('#answer').val().trim();

Expand Down Expand Up @@ -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() {
Expand Down