2025-02-28 08:35:11 +00:00
|
|
|
package com.zhangmeng.online.exam.entity;
|
|
|
|
|
|
|
|
|
|
import com.zhangmeng.online.exam.entity.baseEntity.BaseEntity;
|
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
import lombok.Data;
|
|
|
|
|
import lombok.EqualsAndHashCode;
|
|
|
|
|
import lombok.NoArgsConstructor;
|
|
|
|
|
|
|
|
|
|
import javax.persistence.*;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author zm
|
|
|
|
|
* @date 2025/2/28 16:06
|
|
|
|
|
* @version: 1.0
|
|
|
|
|
*/
|
|
|
|
|
@NoArgsConstructor
|
|
|
|
|
@Data
|
|
|
|
|
@AllArgsConstructor
|
|
|
|
|
@Entity
|
|
|
|
|
@EqualsAndHashCode(callSuper = false)
|
|
|
|
|
@Table(name = "question")
|
|
|
|
|
public class Question extends BaseEntity<Long> {
|
|
|
|
|
|
|
|
|
|
public enum Type {
|
2025-03-07 10:19:30 +00:00
|
|
|
SINGLE_CHOICE("单选题", 0),//单选题
|
|
|
|
|
MULTIPLE_CHOICE("多选题", 1),//多选题
|
|
|
|
|
JUDGMENT("判断题", 2),//判断题
|
|
|
|
|
SHORT_ANSWER("简答题", 3),//简答题
|
|
|
|
|
TRUE_OR_FALSE("判断题",4),//判断题
|
|
|
|
|
NUMERICAL("计算题",5);//计算题
|
|
|
|
|
|
|
|
|
|
private String desc;
|
|
|
|
|
|
|
|
|
|
private int index;
|
|
|
|
|
|
|
|
|
|
Type(String desc, int index) {
|
|
|
|
|
this.desc = desc;
|
|
|
|
|
this.index = index;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Type(String desc) {
|
|
|
|
|
this.desc = desc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getDesc() {
|
|
|
|
|
return desc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setDesc(String desc) {
|
|
|
|
|
this.desc = desc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getIndex() {
|
|
|
|
|
return index;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setIndex(int index) {
|
|
|
|
|
this.index = index;
|
|
|
|
|
}
|
2025-02-28 08:35:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String name;
|
|
|
|
|
|
|
|
|
|
private Type type;
|
|
|
|
|
|
|
|
|
|
@OneToMany(mappedBy = "question")
|
2025-03-05 09:20:22 +00:00
|
|
|
private List<QuestionOption> options = new ArrayList<>();
|
2025-02-28 08:35:11 +00:00
|
|
|
|
|
|
|
|
@ManyToOne(fetch = FetchType.LAZY)
|
|
|
|
|
private Subject subject;
|
|
|
|
|
}
|