Commit cb28f9c1 by 陈超

A

parent 75423860
......@@ -413,7 +413,6 @@
info: {},
temp: {},
current: 1,
currentType: 0,
paperOptions: {},
countDown: "00:00:00"
}
......@@ -427,6 +426,20 @@
})
return count
},
currentTypeIndex: function() {
let count = 0
let data = this.paperOptions.options_questions_data
let current = this.current
for(let i = 0; i < this.paperOptions.options_type.length; i++) {
let r = this.paperOptions.options_type[i]
let next = count + data[r.question_type].length
if(current > count && current <= next) {
return i
} else {
count = next
}
}
},
currentQuestions: function() {
let optionType = this.currentQuestionType
let questionType = optionType.question_type
......@@ -435,7 +448,7 @@
return questions
},
currentQuestionType: function() {
return this.paperOptions.options_type[this.currentType]
return this.paperOptions.options_type[this.currentTypeIndex]
},
currentQuestionTypeName: function() {
return this.currentQuestionType.type_info.question_type_title
......@@ -444,7 +457,18 @@
return this.currentQuestionType.question_type_key
},
currentQuestion: function() {
return this.currentQuestions[this.current]
let count = 0
let data = this.paperOptions.options_questions_data
let current = this.current
for(let i = 0; i < this.paperOptions.options_type.length; i++) {
let r = this.paperOptions.options_type[i]
let next = count + data[r.question_type].length
if(current > count && current <= next) {
return data[current - count - 1]
} else {
count = next
}
}
},
//Helper
showChoiceQuestion: function() {
......
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