precise mappings
This commit is contained in:
+3
-3
@@ -28,9 +28,9 @@
|
|||||||
<div class='answer' type="button" v-for='v in answers' v-on:click="answer(v)" :class="{disabled:wrongAnswers.contains(v)}">{{ v }}</div>
|
<div class='answer' type="button" v-for='v in answers' v-on:click="answer(v)" :class="{disabled:wrongAnswers.contains(v)}">{{ v }}</div>
|
||||||
</div>
|
</div>
|
||||||
<h3>Options</h3>
|
<h3>Options</h3>
|
||||||
<input type="checkbox" id="opt_rh" v-model="options.rh"><label for="opt_rh">Romaji ↔ ひらがな</label><br />
|
<input type="checkbox" id="opt_rh" v-model="options.rh"><label for="opt_rh">Romaji → ひらがな</label> <input type="checkbox" id="opt_hr" v-model="options.hr"><label for="opt_hr">ひらがな → Romaji</label><br />
|
||||||
<input type="checkbox" id="opt_rk" v-model="options.rk"><label for="opt_rk">Romaji ↔ カタカナ</label><br />
|
<input type="checkbox" id="opt_rk" v-model="options.rk"><label for="opt_rk">Romaji → カタカナ</label> <input type="checkbox" id="opt_kr" v-model="options.kr"><label for="opt_kr">カタカナ → Romaji</label><br />
|
||||||
<input type="checkbox" id="opt_hk" v-model="options.hk"><label for="opt_hk">ひらがな ↔ カタカナ</label><br />
|
<input type="checkbox" id="opt_hk" v-model="options.hk"><label for="opt_hk">ひらがな ↔ カタカナ</label> <input type="checkbox" id="opt_kh" v-model="options.kh"><label for="opt_kh">カタカナ → ひらがな</label><br />
|
||||||
<br />
|
<br />
|
||||||
<span v-for="char in options.available">
|
<span v-for="char in options.available">
|
||||||
<input type="checkbox" :id="'opt_' + char" v-model="options.selected" :value="char"><label :for="'opt_' + char">{{ char ? char : '()' }} </label>
|
<input type="checkbox" :id="'opt_' + char" v-model="options.selected" :value="char"><label :for="'opt_' + char">{{ char ? char : '()' }} </label>
|
||||||
|
|||||||
@@ -88,8 +88,11 @@ let app = {
|
|||||||
available: kanas.rows,
|
available: kanas.rows,
|
||||||
selected: kanas.rows,
|
selected: kanas.rows,
|
||||||
rh: true,
|
rh: true,
|
||||||
|
hr: true,
|
||||||
rk: false,
|
rk: false,
|
||||||
|
kr: false,
|
||||||
hk: false,
|
hk: false,
|
||||||
|
kh: false,
|
||||||
answers: 6,
|
answers: 6,
|
||||||
},
|
},
|
||||||
kanas: [],
|
kanas: [],
|
||||||
@@ -142,15 +145,12 @@ let app = {
|
|||||||
//TODO add difficulty
|
//TODO add difficulty
|
||||||
|
|
||||||
const mappings = [];
|
const mappings = [];
|
||||||
if (self.options.rh) {
|
if (self.options.rh) { mappings.push([0, 1]); }
|
||||||
mappings.push([0, 1], [1, 0]);
|
if (self.options.hr) { mappings.push([1, 0]); }
|
||||||
}
|
if (self.options.rk) { mappings.push([0, 2]); }
|
||||||
if (self.options.rk) {
|
if (self.options.kr) { mappings.push([2, 0]); }
|
||||||
mappings.push([0, 2], [2, 0]);
|
if (self.options.hk) { mappings.push([1, 2]); }
|
||||||
}
|
if (self.options.kh) { mappings.push([2, 1]); }
|
||||||
if (self.options.hk) {
|
|
||||||
mappings.push([1, 2], [2, 1]);
|
|
||||||
}
|
|
||||||
const mapping = utils.randitem(mappings);
|
const mapping = utils.randitem(mappings);
|
||||||
|
|
||||||
self.question = self.kanas[questionIndex][mapping[0]];
|
self.question = self.kanas[questionIndex][mapping[0]];
|
||||||
|
|||||||
Reference in New Issue
Block a user