Manual option preset.cat to test difficulty selection.
class WordQuiz {
dataselect(json) {
class WordQuiz {
dataselect(json) {
+ // find viable rows from json data
let rows = Object.values(json);
let rows = Object.values(json);
+ if (this.preset.level !== undefined) {
+ rows = rows.filter(row => row[1] <= this.preset.level);
+ }
return rows.shuffle();
}
load(dataurl) {
return rows.shuffle();
}
load(dataurl) {
fetch(dataurl).then(res => res.json()).then(json => {
this.words = this.dataselect(json)
this.setup();
fetch(dataurl).then(res => res.json()).then(json => {
this.words = this.dataselect(json)
this.setup();