xiangpei
2024-05-31 16d10cef208de048f8b325facd143c54b7be9963
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package com.ycl.jxkg.domain;
 
import com.ycl.jxkg.domain.enums.QuestionTypeEnum;
import com.ycl.jxkg.utils.ExamUtil;
import lombok.Data;
 
import java.io.Serializable;
import java.util.Date;
import java.util.List;
 
@Data
public class Question implements Serializable {
 
    private static final long serialVersionUID = 8826266720383164363L;
 
    private Integer id;
 
    /**
     *     1.单选题 2.多选题 3.判断题 4.填空题 5.简答题
     */
    private Integer questionType;
 
    /**
     * 学科
     */
    private Integer subjectId;
 
    /**
     * 题目总分(千分制)
     */
    private Integer score;
 
    /**
     * 级别
     */
    private Integer gradeLevel;
 
    /**
     * 题目难度
     */
    private Integer difficult;
 
    /**
     * 正确答案
     */
    private String correct;
 
    /**
     * 题目 填空、 题干、解析、答案等信息
     */
    private Integer infoTextContentId;
 
    /**
     * 创建人
     */
    private Integer createUser;
 
    /**
     * 1.正常
     */
    private Integer status;
 
    /**
     * 创建时间
     */
    private Date createTime;
 
    private Boolean deleted;
 
 
    public void setCorrectFromVM(String correct, List<String> correctArray) {
        int qType = this.getQuestionType();
        if (qType == QuestionTypeEnum.MultipleChoice.getCode()) {
            String correctJoin = ExamUtil.contentToString(correctArray);
            this.setCorrect(correctJoin);
        } else {
            this.setCorrect(correct);
        }
    }
}