|
@@ -464,6 +464,7 @@ export default {
|
|
|
recordId: "",
|
|
|
chapterId: "",
|
|
|
moduleId: "",
|
|
|
+ doMode: 1, // 1-普通章卷,2-随机练习
|
|
|
};
|
|
|
},
|
|
|
onLoad(option) {
|
|
@@ -472,7 +473,7 @@ export default {
|
|
|
this.chapterId = option.chapterId || "";
|
|
|
this.moduleId = option.moduleId || "";
|
|
|
this.recordId = option.recordId || "";
|
|
|
-
|
|
|
+ this.doMode = option.doMode
|
|
|
let showDialog = uni.getStorageSync("showDialog");
|
|
|
|
|
|
if (showDialog) {
|
|
@@ -481,7 +482,12 @@ export default {
|
|
|
this.showDialog = true;
|
|
|
uni.setStorageSync("showDialog", "1");
|
|
|
}
|
|
|
+ console.log('------解析解析', this.doMode);
|
|
|
+ if (this.doMode == 2) {
|
|
|
+ this.getQuestionTempList()
|
|
|
+ } else {
|
|
|
this.goodsQuestionList();
|
|
|
+ }
|
|
|
},
|
|
|
onUnload() {},
|
|
|
methods: {
|
|
@@ -491,6 +497,14 @@ export default {
|
|
|
hasImgs(bank) {
|
|
|
return bank.ansText.imageList.length == 0;
|
|
|
},
|
|
|
+ // 获取随机练习解析题
|
|
|
+ getQuestionTempList() {
|
|
|
+ this.$api.goodsQuestionTempList({examId: this.id,}).then((res) => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.analyseData(res.data.data)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
goodsQuestionList() {
|
|
|
//解析
|
|
|
this.$api
|
|
@@ -498,7 +512,13 @@ export default {
|
|
|
examId: this.id,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- res.data.data.forEach((item, index) => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ this.analyseData(res.data.data)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ analyseData(datas = []) {
|
|
|
+ datas.forEach((item, index) => {
|
|
|
if (typeof item.jsonStr == "string") {
|
|
|
item.jsonStr = JSON.parse(item.jsonStr);
|
|
|
|
|
@@ -568,10 +588,8 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- this.questionList = res.data.data;
|
|
|
- });
|
|
|
+ this.questionList = datas
|
|
|
},
|
|
|
-
|
|
|
openFooterTab() {
|
|
|
this.show = true;
|
|
|
},
|