mirror of
https://github.com/ZetaKebab/japanese-conjugation-drill.git
synced 2025-01-14 22:08:44 +00:00
Added kana only option.
This commit is contained in:
parent
5bf0c44e3f
commit
e062be04b3
@ -65,9 +65,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<label><input type="checkbox" id="trick" checked> Trick questions (answers may be the same as the given form)</label>
|
<label><input type="checkbox" id="trick" checked> Trick questions (answers may be the same as the given form)</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<label><input type="checkbox" id="kana"> Use hiragana throughout the test (no kanji)</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -354,6 +354,7 @@ function generateQuestion() {
|
|||||||
var to_form;
|
var to_form;
|
||||||
var from_form;
|
var from_form;
|
||||||
var forms;
|
var forms;
|
||||||
|
var options = getOptions();
|
||||||
|
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
|
||||||
@ -395,13 +396,25 @@ function generateQuestion() {
|
|||||||
var kanaForms = forms["hiragana"];
|
var kanaForms = forms["hiragana"];
|
||||||
var furiganaForms = forms["furigana"];
|
var furiganaForms = forms["furigana"];
|
||||||
|
|
||||||
var givenWord = wordWithFurigana(furiganaForms[from_form]).randomElement();
|
var givenWord;
|
||||||
|
|
||||||
|
if (options["kana"]) {
|
||||||
|
givenWord = kanaForms[from_form].randomElement();
|
||||||
|
} else {
|
||||||
|
givenWord = wordWithFurigana(furiganaForms[from_form]).randomElement();
|
||||||
|
}
|
||||||
|
|
||||||
var question = "What is the " + transformation.phrase + " version of " +
|
var question = "What is the " + transformation.phrase + " version of " +
|
||||||
givenWord + "?";
|
givenWord + "?";
|
||||||
|
|
||||||
var answer = kanjiForms[to_form];
|
var answer = kanjiForms[to_form];
|
||||||
var answer2 = kanaForms[to_form];
|
var answer2 = kanaForms[to_form];
|
||||||
|
var answerWithFurigana = wordWithFurigana(furiganaForms[to_form]);
|
||||||
|
|
||||||
|
if (options["kana"]) {
|
||||||
|
answer = answer2;
|
||||||
|
answerWithFurigana = kanaForms[to_form];
|
||||||
|
}
|
||||||
|
|
||||||
$('#question').html(question);
|
$('#question').html(question);
|
||||||
|
|
||||||
@ -409,9 +422,9 @@ function generateQuestion() {
|
|||||||
entry: entry,
|
entry: entry,
|
||||||
transformation: transformation,
|
transformation: transformation,
|
||||||
question: question,
|
question: question,
|
||||||
answer: kanjiForms[to_form],
|
answer: answer,
|
||||||
answer2: answer2,
|
answer2: answer2,
|
||||||
answerWithFurigana: wordWithFurigana(furiganaForms[to_form]),
|
answerWithFurigana: answerWithFurigana,
|
||||||
givenWord: givenWord,
|
givenWord: givenWord,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -436,7 +449,11 @@ function generateQuestion() {
|
|||||||
dictionary = dictionary.replace(/だ$/, '')
|
dictionary = dictionary.replace(/だ$/, '')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!options["kana"]) {
|
||||||
dictionary = wordWithFurigana(dictionary);
|
dictionary = wordWithFurigana(dictionary);
|
||||||
|
} else {
|
||||||
|
dictionary = kanaForm(dictionary);
|
||||||
|
}
|
||||||
|
|
||||||
$('#explain-given').html(givenWord);
|
$('#explain-given').html(givenWord);
|
||||||
$('#explain-given-tags').html(data.transformation.from_tags.map(function (tag) { return "<span class='tag'>" + tag + "</span>"; }).join(" "));
|
$('#explain-given-tags').html(data.transformation.from_tags.map(function (tag) { return "<span class='tag'>" + tag + "</span>"; }).join(" "));
|
||||||
@ -739,7 +756,7 @@ function getOptions() {
|
|||||||
var options = ["plain", "polite", "negative", "past", "te-form",
|
var options = ["plain", "polite", "negative", "past", "te-form",
|
||||||
"progressive", "potential", "imperative", "passive", "causative",
|
"progressive", "potential", "imperative", "passive", "causative",
|
||||||
"godan", "ichidan", "iku", "kuru", "suru", "i-adjective", "na-adjective",
|
"godan", "ichidan", "iku", "kuru", "suru", "i-adjective", "na-adjective",
|
||||||
"ii", "trick"];
|
"ii", "trick", "kana"];
|
||||||
|
|
||||||
var result = {};
|
var result = {};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user