diff --git a/src/pages/questionBank/components/Question.vue b/src/pages/questionBank/components/Question.vue
index fcd5306..e921e4a 100644
--- a/src/pages/questionBank/components/Question.vue
+++ b/src/pages/questionBank/components/Question.vue
@@ -120,16 +120,16 @@
-
+ color="rgb(249,236,141)" size="20">
+
{{collectList.includes(questionList[topicIndex].questionId)?'已收藏':'收藏'}}
- {{rightList.length}}
+ {{type=='exam'?rightList.length:storageRightList.length}}
答对
- {{wrongList.length}}
+ {{type=='exam'?wrongList.length:storageWrongList.length}}
答错
@@ -212,16 +212,16 @@
-
+ color="rgb(249,236,141)" size="20">
+
{{collectList.includes(questionList[topicIndex].questionId)?'已收藏':'收藏'}}
- {{rightList.length}}
+ {{type=='exam'?rightList.length:storageRightList.length}}
答对
- {{wrongList.length}}
+ {{type=='exam'?wrongList.length:storageWrongList.length}}
答错
@@ -232,15 +232,17 @@
-
{{index+1}}
+
@@ -334,6 +336,8 @@
tCurrent: 0,
index: 0,
qIndex: 0,
+ storageRightList:storage.get(`rightList_subject${this.subject}`) || [],
+ storageWrongList: storage.get(`wrongList_subject${this.subject}`) || [],
rightList: [],
wrongList: [],
collectList: storage.get(`collectList_subject${this.subject}`) || [],
@@ -407,8 +411,8 @@
if (this.tCurrent != 1) {
this.originArray = JSON.stringify(this.questionList)
}
- const falseList = storage.get(`wrongList_subject${this.subject}`) || []
- const trueList = storage.get(`rightList_subject${this.subject}`) || []
+ // const falseList = storage.get(`wrongList_subject${this.subject}`) || []
+ // const trueList = storage.get(`rightList_subject${this.subject}`) || []
if (this.tCurrent !== 1) {
const arr1 = this.questionList[this.topicIndex].clickAnswer.split('')
const arr2 = this.questionList[this.topicIndex].trueAnswer.split('')
@@ -418,18 +422,18 @@
if (!this.rightList.includes(this.questionList[this.topicIndex].questionId)) {
this.rightList.push(this.questionList[this.topicIndex].questionId)
}
- if (!trueList.includes(this.questionList[this.topicIndex].questionId)) {
- trueList.push(this.questionList[this.topicIndex].questionId)
- storage.set(`rightList_subject${this.subject}`, trueList)
+ if (!this.storageRightList.includes(this.questionList[this.topicIndex].questionId)) {
+ this.storageRightList.push(this.questionList[this.topicIndex].questionId)
+ storage.set(`rightList_subject${this.subject}`, this.storageRightList)
}
if (this.wrongList.includes(this.questionList[this.topicIndex].questionId)) {
const wIndex = this.wrongList.indexOf(this.questionList[this.topicIndex].questionId)
this.wrongList.splice(wIndex, 1)
}
- if (falseList.includes(this.questionList[this.topicIndex].questionId)) {
- const wIndex = falseList.indexOf(this.questionList[this.topicIndex].questionId)
- falseList.splice(wIndex, 1)
- storage.set(`wrongList_subject${this.subject}`, falseList)
+ if (this.storageWrongList.includes(this.questionList[this.topicIndex].questionId)) {
+ const wIndex = this.storageWrongList.indexOf(this.questionList[this.topicIndex].questionId)
+ this.storageWrongList.splice(wIndex, 1)
+ storage.set(`wrongList_subject${this.subject}`, this.storageWrongList)
}
//答对题目 如果不是最后一题,跳下一题
if (this.topicIndex < this.questionList.length - 1) {
@@ -455,14 +459,14 @@
if (!this.wrongList.includes(this.questionList[this.topicIndex].questionId)) {
this.wrongList.push(this.questionList[this.topicIndex].questionId)
}
- if (!falseList.includes(this.questionList[this.topicIndex].questionId)) {
- falseList.push(this.questionList[this.topicIndex].questionId)
- storage.set(`wrongList_subject${this.subject}`, falseList)
+ if (!this.storageWrongList.includes(this.questionList[this.topicIndex].questionId)) {
+ this.storageWrongList.push(this.questionList[this.topicIndex].questionId)
+ storage.set(`wrongList_subject${this.subject}`, this.storageWrongList)
}
- if (trueList.includes(this.questionList[this.topicIndex].questionId)) {
- const rIndex = trueList.indexOf(this.questionList[this.topicIndex].questionId)
- trueList.splice(rIndex, 1)
- storage.set(`rightList_subject${this.subject}`, trueList)
+ if (this.storageRightList.includes(this.questionList[this.topicIndex].questionId)) {
+ const rIndex = this.storageRightList.indexOf(this.questionList[this.topicIndex].questionId)
+ this.storageRightList.splice(rIndex, 1)
+ storage.set(`rightList_subject${this.subject}`, this.storageRightList)
}
}
}
@@ -674,8 +678,8 @@
},
//答题
answerQues(op, index) {
- const falseList = storage.get(`wrongList_subject${this.subject}`) || []
- const trueList = storage.get(`rightList_subject${this.subject}`) || []
+ // const falseList = storage.get(`wrongList_subject${this.subject}`) || []
+ // const trueList = storage.get(`rightList_subject${this.subject}`) || []
if (!this.questionList[this.topicIndex].clickAnswer) {
this.questionList[this.topicIndex].optionList[index].chooseOption =
`${this.questionList[this.topicIndex].optionList[index].chooseOption?this.questionList[this.topicIndex].optionList[index].chooseOption:''}${op}`
@@ -708,18 +712,18 @@
if (!this.rightList.includes(this.questionList[this.topicIndex].questionId)) {
this.rightList.push(this.questionList[this.topicIndex].questionId)
}
- if (!trueList.includes(this.questionList[this.topicIndex].questionId)) {
- trueList.push(this.questionList[this.topicIndex].questionId)
- storage.set(`rightList_subject${this.subject}`, trueList)
+ if (!this.storageRightList.includes(this.questionList[this.topicIndex].questionId)) {
+ this.storageRightList.push(this.questionList[this.topicIndex].questionId)
+ storage.set(`rightList_subject${this.subject}`, this.storageRightList)
}
if (this.wrongList.includes(this.questionList[this.topicIndex].questionId)) {
const wIndex = this.wrongList.indexOf(this.questionList[this.topicIndex].questionId)
this.wrongList.splice(wIndex, 1)
}
- if (falseList.includes(this.questionList[this.topicIndex].questionId)) {
- const wIndex = falseList.indexOf(this.questionList[this.topicIndex].questionId)
- falseList.splice(wIndex, 1)
- storage.set(`wrongList_subject${this.subject}`, falseList)
+ if (this.storageWrongList.includes(this.questionList[this.topicIndex].questionId)) {
+ const wIndex = this.storageWrongList.indexOf(this.questionList[this.topicIndex].questionId)
+ this.storageWrongList.splice(wIndex, 1)
+ storage.set(`wrongList_subject${this.subject}`, this.storageWrongList)
}
//答对题目 如果不是最后一题,跳下一题
if (this.topicIndex < this.questionList.length - 1) {
@@ -745,14 +749,14 @@
if (!this.wrongList.includes(this.questionList[this.topicIndex].questionId)) {
this.wrongList.push(this.questionList[this.topicIndex].questionId)
}
- if (!falseList.includes(this.questionList[this.topicIndex].questionId)) {
- falseList.push(this.questionList[this.topicIndex].questionId)
- storage.set(`wrongList_subject${this.subject}`, falseList)
+ if (!this.storageWrongList.includes(this.questionList[this.topicIndex].questionId)) {
+ this.storageWrongList.push(this.questionList[this.topicIndex].questionId)
+ storage.set(`wrongList_subject${this.subject}`, this.storageWrongList)
}
- if (trueList.includes(this.questionList[this.topicIndex].questionId)) {
- const rIndex = trueList.indexOf(this.questionList[this.topicIndex].questionId)
- trueList.splice(rIndex, 1)
- storage.set(`rightList_subject${this.subject}`, trueList)
+ if (this.storageRightList.includes(this.questionList[this.topicIndex].questionId)) {
+ const rIndex = this.storageRightList.indexOf(this.questionList[this.topicIndex].questionId)
+ this.storageRightList.splice(rIndex, 1)
+ storage.set(`rightList_subject${this.subject}`, this.storageRightList)
}
}
}