add more choices
This commit is contained in:
@@ -69,11 +69,15 @@ const utils = {
|
|||||||
},
|
},
|
||||||
contains: function (array, item) {
|
contains: function (array, item) {
|
||||||
return array.indexOf(item) >= 0;
|
return array.indexOf(item) >= 0;
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
Array.prototype.shuffle = function() { return utils.shuffle(this);};
|
Array.prototype.shuffle = function () {
|
||||||
Array.prototype.contains = function(item) { return utils.contains(this, item);};
|
return utils.shuffle(this);
|
||||||
|
};
|
||||||
|
Array.prototype.contains = function (item) {
|
||||||
|
return utils.contains(this, item);
|
||||||
|
};
|
||||||
|
|
||||||
let app = {
|
let app = {
|
||||||
el: "#app",
|
el: "#app",
|
||||||
@@ -86,7 +90,7 @@ let app = {
|
|||||||
rh: true,
|
rh: true,
|
||||||
rk: false,
|
rk: false,
|
||||||
hk: false,
|
hk: false,
|
||||||
answers: 4,
|
answers: 6,
|
||||||
},
|
},
|
||||||
kanas: [],
|
kanas: [],
|
||||||
question: "あ",
|
question: "あ",
|
||||||
@@ -159,7 +163,7 @@ let app = {
|
|||||||
answer: function (v) {
|
answer: function (v) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
const question = self.kanas.filter(kana => {
|
const question = self.kanas.filter((kana) => {
|
||||||
return kana.contains(self.question);
|
return kana.contains(self.question);
|
||||||
})[0];
|
})[0];
|
||||||
|
|
||||||
@@ -170,7 +174,6 @@ let app = {
|
|||||||
self.score = 0;
|
self.score = 0;
|
||||||
self.wrongAnswers.push(v);
|
self.wrongAnswers.push(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
changeOption: function (v) {
|
changeOption: function (v) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|||||||
Reference in New Issue
Block a user