both sides in memory helper
This commit is contained in:
@@ -36,6 +36,11 @@
|
|||||||
<div>
|
<div>
|
||||||
<h2 v-on:click="showConfig = !showConfig" class="expand">{{showConfig ? '▾' : '▸'}} List ({{ available.length }})</h2>
|
<h2 v-on:click="showConfig = !showConfig" class="expand">{{showConfig ? '▾' : '▸'}} List ({{ available.length }})</h2>
|
||||||
<table class="config" v-if="showConfig">
|
<table class="config" v-if="showConfig">
|
||||||
|
<tr>
|
||||||
|
<td><input type="checkbox" v-model="q2a" @click="nextQuestion"/> Q → A</td>
|
||||||
|
<td><input type="checkbox" v-model="a2q" @click="nextQuestion"/> A → Q</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
<tr v-for="(row, i) in available">
|
<tr v-for="(row, i) in available">
|
||||||
<td><input placeholder="question" v-bind:value="row[0]" v-on:change="row[0] = $event.target.value"></td>
|
<td><input placeholder="question" v-bind:value="row[0]" v-on:change="row[0] = $event.target.value"></td>
|
||||||
<td><input placeholder="answer" v-bind:value="row[1]" v-on:change="row[1] = $event.target.value"></td>
|
<td><input placeholder="answer" v-bind:value="row[1]" v-on:change="row[1] = $event.target.value"></td>
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ let app = {
|
|||||||
done: [],
|
done: [],
|
||||||
newRow: [ '', '' ],
|
newRow: [ '', '' ],
|
||||||
showConfig: true,
|
showConfig: true,
|
||||||
|
q2a: true,
|
||||||
|
a2q: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -112,9 +114,14 @@ let app = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.current.length > 0) {
|
if (this.current.length > 0) {
|
||||||
|
if ((this.a2q && !this.q2a) || (this.a2q === this.q2a && utils.randint(0, 2) === 1)) {
|
||||||
|
this.anser = this.current[0][0];
|
||||||
|
this.question = this.current[0][1];
|
||||||
|
} else {
|
||||||
this.question = this.current[0][0];
|
this.question = this.current[0][0];
|
||||||
this.answer = this.current[0][1];
|
this.answer = this.current[0][1];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
|
|||||||
Reference in New Issue
Block a user