shuishen
2022-02-26 c765784d2d2d4db55bfcb629cc3f6ec0b57dddcc
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
50
51
52
53
54
55
56
57
58
59
60
61
62
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
        
        queTypeArr.push(quesType)
        
        item.template = item.choicesType
        
        item.tempAnswer = ""
        
        item.options = item.examSubjectOptions
        
        item.options.forEach(it => {
            it.newOptLetter = it.optionName
            it.optContent = it.optionContent
            it.optLetter = it.newOptLetter
        })
        
        questionList.push(item)
        
    })
 
    store.state.queTypeArr = unique(queTypeArr)
 
    store.state.questionList = questionList
 
}
 
export const topicOptions = (options) => {
 
    var questionList = store.state.questionList
 
    questionList.forEach((item, index) => {
 
    })
 
    store.state.questionList = questionList
 
    // for (let j = 0; j < quesModules[i].examSubjectOptions.length; j++) {
    //     // 解决theoryExamAnswer可能为null的问题,把它赋值为字符串
    //     quesModules[i].examSubjectOptions[j].tempAnswer = "" //暂存每题的答案
    //     quesModules[i].examSubjectOptions[j].template = quesModules[i].choicesType //防止template初始值是null
    //     quesModules[i].examSubjectOptions[j].recordId = store.state.examDetail
    //         .id //搬移recordId的位置
    //     quesModules[i].examSubjectOptions[j].blankArr = [] //新建blankArr属性,临时保存填空题答案
    //     quesModules[i].examSubjectOptions[j].dualChooseArr = [] //新建blankArr属性,临时保存填空题答案
    //     questionList.push(quesModules[i].examSubjectOptions[j])
    // }
}