|
@@ -155,11 +155,12 @@ export default {
|
|
this.addQuestionToExercise('select', 'single', questionDataList['select']);
|
|
this.addQuestionToExercise('select', 'single', questionDataList['select']);
|
|
},
|
|
},
|
|
// 创建新题
|
|
// 创建新题
|
|
- createNewQuestion() {
|
|
|
|
|
|
+ async createNewQuestion() {
|
|
if (this.index_list.length === 0) {
|
|
if (this.index_list.length === 0) {
|
|
this.createDefaultQuestion();
|
|
this.createDefaultQuestion();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ await this.$refs.createMain.saveQuestion();
|
|
let { type, additional_type } = this.index_list[this.curIndex];
|
|
let { type, additional_type } = this.index_list[this.curIndex];
|
|
this.addQuestionToExercise(type, additional_type, questionDataList[type]);
|
|
this.addQuestionToExercise(type, additional_type, questionDataList[type]);
|
|
},
|
|
},
|
|
@@ -240,13 +241,12 @@ export default {
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
* 选择练习
|
|
* 选择练习
|
|
- * @param {Number} index 练习索引
|
|
|
|
- * @param {object} data 练习数据
|
|
|
|
|
|
+ * @param {number} index 练习索引
|
|
*/
|
|
*/
|
|
- selectExerciseItem(index, data) {
|
|
|
|
|
|
+ selectExerciseItem(index) {
|
|
if (index < 0 || index > this.index_list.length - 1) return;
|
|
if (index < 0 || index > this.index_list.length - 1) return;
|
|
this.$refs.createMain.clearSaveDate();
|
|
this.$refs.createMain.clearSaveDate();
|
|
- this.$refs.createMain.saveQuestion(data);
|
|
|
|
|
|
+ this.$refs.createMain.saveQuestion();
|
|
this.curIndex = index;
|
|
this.curIndex = index;
|
|
},
|
|
},
|
|
// 设置
|
|
// 设置
|