| | |
| | | }, |
| | | // 切换题目 |
| | | changeSwiper(e) { |
| | | let index = e.detail.index - 1 >= 0 ? e.detail.index - 1 : 0; |
| | | const item = this.data.questionDataList[index]; |
| | | const lastItem = this.data.questionDataList[index + 1]; |
| | | let index = e.detail.index; |
| | | const lastItem = this.data.questionDataList[index]; |
| | | this.setData({ |
| | | currentIndex: e.detail.index, |
| | | showId: lastItem.id |
| | | }); |
| | | if ( |
| | | (this.data.answerType == "collectQuestion" || |
| | | this.data.answerType == "errorQuestion") && |
| | | !item.isComplete |
| | | ) { |
| | | let flag = this.isHaveAnswer(item.userAnswer); |
| | | if (flag) this.handleQuestion(index); |
| | | } |
| | | }, |
| | | // 我的错题,收藏查看解析按钮 |
| | | viewParsing() { |
| | |
| | | // 先遍历所有题目,将未批改的题目批改 |
| | | const qustionList = this.data.questionDataList; |
| | | if (qustionList.length) this.handleQuestion(); |
| | | this.setData({ |
| | | isShowDialog: true, |
| | | submitStatus: true, |
| | | }) |
| | | // 记录用户答题数据 |
| | | let saveData = []; |
| | | for (let index = 0; index < this.data.questionDataList.length; index++) { |
| | |
| | | loading: false, |
| | | showDialog: false, |
| | | }); |
| | | this.setData({ |
| | | isShowDialog: true, |
| | | submitStatus: true, |
| | | }); |
| | | }, |
| | | // 初始化函数 |
| | | async init(isReset) { |
| | | this.setData({ |
| | | loading: false, |
| | | loading: true, |
| | | }); |
| | | const questuionName = this.data.questuionName |
| | | const questuionList = pastData.postData.list |
| | |
| | | this.setData({ |
| | | questionDataList: newArr, |
| | | scoreDataList: scoreArr, |
| | | loading: false, |
| | | }) |
| | | } catch (error) { |
| | | this.setData({ |
| | | questionDataList: newArr, |
| | | scoreDataList: scoreArr |
| | | scoreDataList: scoreArr, |
| | | loading: false, |
| | | }) |
| | | console.log(error); |
| | | } |
| | | const e = { |
| | | detail: { |
| | | index: 0 |
| | | } |
| | | }; |
| | | this.changeSwiper(e) |
| | | }); |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 记录模考答题数据 |
| | | saveMockData() { |