Commit b23c72f4 authored by 林文清's avatar 林文清

fix:考试下一题

parent 4d4e9ac1
...@@ -110,6 +110,9 @@ export default { ...@@ -110,6 +110,9 @@ export default {
this.applyExam(); this.applyExam();
// this.getUserExamInfo(); // this.getUserExamInfo();
}, },
onUnload() {
clearTimeout(this.timer);
},
methods: { methods: {
formatTimeToMini(timestamp) { formatTimeToMini(timestamp) {
let result = timestamp; let result = timestamp;
...@@ -470,42 +473,23 @@ export default { ...@@ -470,42 +473,23 @@ export default {
//下一题 //下一题
nextClick: function () { nextClick: function () {
clearTimeout(this.timer); clearTimeout(this.timer);
this.currentNumber = this.currentNumber + 1; this.currentNumber = this.currentNumber + 1;
//this.getData()
this.handleAnswer(); this.handleAnswer();
//this.getNext()
}, },
//所选答案 //所选答案
handleAnswer: function () { handleAnswer: function () {
/* //每次清空,多选题时id按从小到大排序,并英文逗号,分隔;
userAnswerIds
本题回答。
多选题时id按从小到大排序,并英文逗号,分隔;
简答题时直接存问题答案。
如果是第一次答题,不需要传。
*/
//每次清空
this.userAnswerIds = ""; this.userAnswerIds = "";
this.currentItem.answerList.forEach((item) => { this.currentItem.answerList.forEach((item) => {
if (item.isSelect) { if (item.isSelect) {
//this.userAnswerIds = item.id + ',' + this.userAnswerIds
//answerType 题目类型,1单选,2多选,3简答, //answerType 题目类型,1单选,2多选,3简答,
if (this.currentItem.question.answerType == 2) { if (this.currentItem.question.answerType == 2) {
//多选 //多选
///*
if (this.userAnswerIds.length == 0) { if (this.userAnswerIds.length == 0) {
this.userAnswerIds = item.id; this.userAnswerIds = item.id;
} else { } else {
// if(this.userAnswerIds.length == 1) this.userAnswerIds = this.userAnswerIds + "," + item.id;
this.userAnswerIds =
this.userAnswerIds + "," + item.id;
} }
//*/
} else { } else {
//单选 //单选
this.userAnswerIds = item.id; this.userAnswerIds = item.id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment