zengh
2022-05-09 52c39f5e2711e5535b689b66dfa5e100c7882b7f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import store from '@/store/index.js'; //需要引入store
 
// Text页面对考题列表questionList数据预处理
const unique = (arr) => {
    return Array.from(new Set(arr));
}
 
export const ModifyQuesList = function(quesModules) {
    // store.state.questionList = []
    let questionList = []
 
    let queTypeArr = []
 
    quesModules.forEach((item, index) => {
 
 
 
        let quesType = item.choicesType
 
        // 是否答题了
        item.selectedFlag = false
        // 答题的结果
        item.tempAnswer = ""
        // 题目是否做对
        item.correctOrError = false
 
        queTypeArr.push(quesType)
 
        if (item.choicesType == 1 || item.choicesType == 3) {
            item.dualChooseArr = []
        }
 
 
        item.options = item.examSubjectOptions
 
        if (item.choicesType == 0 || item.choicesType == 1 || item.choicesType == 3) {
            item.options.reverse()
        }
 
 
        questionList.push(item)
 
    })
 
    store.state.queTypeArr = unique(queTypeArr)
 
    store.state.questionList = questionList
 
}