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

fix:考试下一题

parent 4d4e9ac1
......@@ -110,6 +110,9 @@ export default {
this.applyExam();
// this.getUserExamInfo();
},
onUnload() {
clearTimeout(this.timer);
},
methods: {
formatTimeToMini(timestamp) {
let result = timestamp;
......@@ -470,42 +473,23 @@ export default {
//下一题
nextClick: function () {
clearTimeout(this.timer);
this.currentNumber = this.currentNumber + 1;
//this.getData()
this.handleAnswer();
//this.getNext()
},
//所选答案
handleAnswer: function () {
/*
userAnswerIds
本题回答。
多选题时id按从小到大排序,并英文逗号,分隔;
简答题时直接存问题答案。
如果是第一次答题,不需要传。
*/
//每次清空
//每次清空,多选题时id按从小到大排序,并英文逗号,分隔;
this.userAnswerIds = "";
this.currentItem.answerList.forEach((item) => {
if (item.isSelect) {
//this.userAnswerIds = item.id + ',' + this.userAnswerIds
//answerType 题目类型,1单选,2多选,3简答,
if (this.currentItem.question.answerType == 2) {
//多选
///*
if (this.userAnswerIds.length == 0) {
this.userAnswerIds = item.id;
} else {
// if(this.userAnswerIds.length == 1)
this.userAnswerIds =
this.userAnswerIds + "," + item.id;
this.userAnswerIds = this.userAnswerIds + "," + item.id;
}
//*/
} else {
//单选
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