Commit cb28f9c1 by 陈超

A

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