xiangpei
2024-06-04 81b6f1cc38a941b65f989ecdd40529f2648bdd8c
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
81
82
83
84
85
86
87
88
89
package com.ycl.jxkg.domain.entity;
 
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ycl.jxkg.domain.base.AbsEntity;
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
@TableName("t_question")
public class Question extends AbsEntity {
 
 
    /**
     *     1.单选题 2.多选题 3.判断题 4.填空题 5.简答题
     */
    @TableField("question_type")
    private Integer questionType;
 
    /**
     * 学科
     */
    @TableField("subject_id")
    private Integer subjectId;
 
    /**
     * 题目总分(千分制)
     */
    @TableField("score")
    private Integer score;
 
    /**
     * 级别
     */
    @TableField("grade_level")
    private Integer gradeLevel;
 
    /**
     * 题目难度
     */
    @TableField("difficult")
    private Integer difficult;
 
    /**
     * 正确答案
     */
    @TableField("correct")
    private String correct;
 
    /**
     * 题目 填空、 题干、解析、答案等信息
     */
    @TableField("info_text_content_id")
    private Integer infoTextContentId;
 
    /**
     * 创建人
     */
    @TableField("create_user")
    private Integer createUser;
 
    /**
     * 1.正常
     */
    @TableField("status")
    private Integer status;
 
    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;
 
    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);
        }
    }
}