| | |
| | | startTime: "", //进入页面当前时间 |
| | | pauseTime: 0, //暂停时间 |
| | | showDialog: false, // 未提交退出拦截弹窗 |
| | | showId: '' |
| | | showId: '', |
| | | isShowDialog: false, // 测试报告弹窗是否显示 |
| | | }, |
| | | |
| | | /** |
| | |
| | | mockid: options.mockid, |
| | | }); |
| | | } |
| | | |
| | | const token = wx.getStorageSync(app.config.tokenKey) |
| | | |
| | | if (!token) { |
| | | loginInfo(app, (data) => { |
| | | if (data) {} else {} |
| | | if (data) { |
| | | this.init(); |
| | | } else { |
| | | this.init(); |
| | | } |
| | | }) |
| | | } else { |
| | | this.init() |
| | | } |
| | | this.init(); |
| | | |
| | | }, |
| | | |
| | | /** |
| | |
| | | * 用户点击右上角分享 |
| | | */ |
| | | onShareAppMessage() {}, |
| | | onShareTimeline() {}, |
| | | |
| | | // 监听watch |
| | | watch(context, variableName, callback) { |
| | |
| | | this.setData({ |
| | | sliderValue: e.detail.value, |
| | | }); |
| | | console.log(e.detail.value); |
| | | }, |
| | | // 返回 |
| | | goBack() { |
| | | console.log(this.data.submitStatus); |
| | | wx.navigateBack(); |
| | | }, |
| | | //设置背景色 |
| | |
| | | submitStatus: true, |
| | | loading: true, |
| | | }); |
| | | const child = this.selectComponent("#question-options"); |
| | | const child = this.selectComponent('#question-options'); |
| | | |
| | | if ( |
| | | this.data.answerType == "option" || |
| | | this.data.answerType == "errorQuestion" || |
| | |
| | | if (this.data.answerType == "option") { |
| | | this.toggleCountdown(); |
| | | this.recordAnswerData(); |
| | | child.openTestReportDialog(); |
| | | // this.selectComponent 拿不到 组件了, 改为监听组件传值 打开弹窗 |
| | | // child.openTestReportDialog(); |
| | | this.setData({ |
| | | isShowDialog: true |
| | | }) |
| | | } else if ( |
| | | this.data.answerType == "collectQuestion" || |
| | | this.data.answerType == "errorQuestion" |
| | |
| | | }), |
| | | }, ], |
| | | }); |
| | | child.openTestReportDialog(); |
| | | // child.openTestReportDialog(); |
| | | this.setData({ |
| | | isShowDialog: true |
| | | }) |
| | | } |
| | | this.setData({ |
| | | loading: false, |
| | |
| | | questionObj.questionType == "multipleChoice" |
| | | ) { |
| | | try { |
| | | questionObj.answer = JSON.parse(questionObj.answer).toString(); |
| | | // questionObj.answer = JSON.parse(questionObj.answer).toString(); |
| | | questionObj.answer = JSON.parse(questionObj.answer) |
| | | } catch (error) { |
| | | questionObj.answer = item.Embedded_QuestionBank_Answer; |
| | | } |
| | |
| | | } |
| | | // 有题目再开始倒计时 |
| | | if (this.data.questionDataList.length) { |
| | | console.log(this.data.questionDataList); |
| | | this.startCountdown(); |
| | | } else { |
| | | this.setData({ |
| | |
| | | // 简答 翻译 |
| | | questionList[index].isRight = null; |
| | | } else if (item.questionType == "completion") { |
| | | if (item.answer == "string") { |
| | | if (typeof item.answer == "string") { |
| | | item.isRight = item.answer == item.userAnswer[0]; |
| | | } else { |
| | | if (item.answer.length != item.userAnswer.length) { |
| | |
| | | questionObj.questionType == "completion" || |
| | | questionObj.questionType == "multipleChoice" |
| | | ) { |
| | | console.log(questionObj.answer, "111") |
| | | try { |
| | | questionObj.answer = JSON.parse(questionObj.answer).toString(); |
| | | } catch (error) { |
| | |
| | | cardList: cardList, |
| | | loading: false, |
| | | }); |
| | | console.log(this.data.questionDataList, "questionDataList"); |
| | | }); |
| | | }, |
| | | // 获取组卷结果 |