|
|
|
@ -1,133 +1,166 @@
|
|
|
|
package com.mindskip.xzs.viewmodel.admin.question;
|
|
|
|
package com.mindskip.xzs.viewmodel.admin.question;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.hibernate.validator.constraints.Range;
|
|
|
|
import org.hibernate.validator.constraints.Range;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
import javax.validation.Valid;
|
|
|
|
import javax.validation.constraints.*;
|
|
|
|
import javax.validation.constraints.*;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
//用于表示题目编辑请求的数据模型,后台管理系统中进行题目的修改和更新。
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @version 3.5.0
|
|
|
|
|
|
|
|
* @description: 问题编辑请求视图模型,表示用于编辑题目的请求数据,包括题目类型、科目、标题、题目项等信息。
|
|
|
|
|
|
|
|
* Copyright (C), 2020-2021, 武汉思维跳跃科技有限公司
|
|
|
|
|
|
|
|
* @date 2021/12/25 10:15
|
|
|
|
|
|
|
|
*/
|
|
|
|
public class QuestionEditRequestVM {
|
|
|
|
public class QuestionEditRequestVM {
|
|
|
|
// 题目的唯一标识符
|
|
|
|
|
|
|
|
private Integer id;
|
|
|
|
private Integer id; // 题目ID
|
|
|
|
@NotNull // 题目的类型(例如选择题、填空题等),不能为空
|
|
|
|
|
|
|
|
|
|
|
|
@NotNull // 不能为空,表示题目类型
|
|
|
|
private Integer questionType;
|
|
|
|
private Integer questionType;
|
|
|
|
@NotNull // 科目ID,不能为空
|
|
|
|
|
|
|
|
|
|
|
|
@NotNull // 不能为空,表示科目ID
|
|
|
|
private Integer subjectId;
|
|
|
|
private Integer subjectId;
|
|
|
|
@NotBlank// 题目的标题,不能为空
|
|
|
|
|
|
|
|
|
|
|
|
@NotBlank // 不能为空,表示题目标题
|
|
|
|
private String title;
|
|
|
|
private String title;
|
|
|
|
// 年级等级,可为空
|
|
|
|
|
|
|
|
private Integer gradeLevel;
|
|
|
|
private Integer gradeLevel; // 年级等级
|
|
|
|
// 题目项列表,@Valid 注解确保其中的每个项也进行验证
|
|
|
|
|
|
|
|
@Valid
|
|
|
|
@Valid // 题目项,必须是有效的列表
|
|
|
|
private List<QuestionEditItemVM> items;
|
|
|
|
private List<QuestionEditItemVM> items;
|
|
|
|
@NotBlank// 题目的解析内容,不能为空
|
|
|
|
|
|
|
|
|
|
|
|
@NotBlank // 不能为空,表示题目解析
|
|
|
|
private String analyze;
|
|
|
|
private String analyze;
|
|
|
|
// 正确答案的列表(可以为空)
|
|
|
|
|
|
|
|
private List<String> correctArray;
|
|
|
|
private List<String> correctArray; // 正确答案数组
|
|
|
|
// 正确答案(主要针对单选题),不能为空
|
|
|
|
|
|
|
|
private String correct;
|
|
|
|
private String correct; // 正确答案
|
|
|
|
@NotBlank// 题目的分数,不能为空
|
|
|
|
|
|
|
|
|
|
|
|
@NotBlank // 不能为空,表示题目分数
|
|
|
|
private String score;
|
|
|
|
private String score;
|
|
|
|
// 题目的难度级别,范围是1到5,不能为空
|
|
|
|
|
|
|
|
@Range(min = 1, max = 5, message = "请选择题目难度")
|
|
|
|
@Range(min = 1, max = 5, message = "请选择题目难度") // 题目难度,必须在1到5之间
|
|
|
|
private Integer difficult;
|
|
|
|
private Integer difficult;
|
|
|
|
// 题目项的排序顺序
|
|
|
|
|
|
|
|
private Integer itemOrder;
|
|
|
|
private Integer itemOrder; // 题目项顺序
|
|
|
|
//获得ID
|
|
|
|
|
|
|
|
|
|
|
|
// 获取题目ID
|
|
|
|
public Integer getId() {
|
|
|
|
public Integer getId() {
|
|
|
|
return id;
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//设置ID
|
|
|
|
|
|
|
|
|
|
|
|
// 设置题目ID
|
|
|
|
public void setId(Integer id) {
|
|
|
|
public void setId(Integer id) {
|
|
|
|
this.id = id;
|
|
|
|
this.id = id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获取问题类型
|
|
|
|
|
|
|
|
|
|
|
|
// 获取题目类型
|
|
|
|
public Integer getQuestionType() {
|
|
|
|
public Integer getQuestionType() {
|
|
|
|
return questionType;
|
|
|
|
return questionType;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//设置问题类型
|
|
|
|
|
|
|
|
|
|
|
|
// 设置题目类型
|
|
|
|
public void setQuestionType(Integer questionType) {
|
|
|
|
public void setQuestionType(Integer questionType) {
|
|
|
|
this.questionType = questionType;
|
|
|
|
this.questionType = questionType;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获得学科ID
|
|
|
|
|
|
|
|
|
|
|
|
// 获取科目ID
|
|
|
|
public Integer getSubjectId() {
|
|
|
|
public Integer getSubjectId() {
|
|
|
|
return subjectId;
|
|
|
|
return subjectId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//设置学科ID
|
|
|
|
|
|
|
|
|
|
|
|
// 设置科目ID
|
|
|
|
public void setSubjectId(Integer subjectId) {
|
|
|
|
public void setSubjectId(Integer subjectId) {
|
|
|
|
this.subjectId = subjectId;
|
|
|
|
this.subjectId = subjectId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获取标题
|
|
|
|
|
|
|
|
|
|
|
|
// 获取题目标题
|
|
|
|
public String getTitle() {
|
|
|
|
public String getTitle() {
|
|
|
|
return title;
|
|
|
|
return title;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//设置标题
|
|
|
|
|
|
|
|
|
|
|
|
// 设置题目标题
|
|
|
|
public void setTitle(String title) {
|
|
|
|
public void setTitle(String title) {
|
|
|
|
this.title = title;
|
|
|
|
this.title = title;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获取试卷等级
|
|
|
|
|
|
|
|
|
|
|
|
// 获取年级等级
|
|
|
|
public Integer getGradeLevel() {
|
|
|
|
public Integer getGradeLevel() {
|
|
|
|
return gradeLevel;
|
|
|
|
return gradeLevel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//设置试卷等级
|
|
|
|
|
|
|
|
|
|
|
|
// 设置年级等级
|
|
|
|
public void setGradeLevel(Integer gradeLevel) {
|
|
|
|
public void setGradeLevel(Integer gradeLevel) {
|
|
|
|
this.gradeLevel = gradeLevel;
|
|
|
|
this.gradeLevel = gradeLevel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获取问题类型
|
|
|
|
|
|
|
|
|
|
|
|
// 获取题目项列表
|
|
|
|
public List<QuestionEditItemVM> getItems() {
|
|
|
|
public List<QuestionEditItemVM> getItems() {
|
|
|
|
return items;
|
|
|
|
return items;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//设置问题类型
|
|
|
|
|
|
|
|
|
|
|
|
// 设置题目项列表
|
|
|
|
public void setItems(List<QuestionEditItemVM> items) {
|
|
|
|
public void setItems(List<QuestionEditItemVM> items) {
|
|
|
|
this.items = items;
|
|
|
|
this.items = items;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获得答案
|
|
|
|
|
|
|
|
|
|
|
|
// 获取题目解析
|
|
|
|
public String getAnalyze() {
|
|
|
|
public String getAnalyze() {
|
|
|
|
return analyze;
|
|
|
|
return analyze;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//设置答案
|
|
|
|
|
|
|
|
|
|
|
|
// 设置题目解析
|
|
|
|
public void setAnalyze(String analyze) {
|
|
|
|
public void setAnalyze(String analyze) {
|
|
|
|
this.analyze = analyze;
|
|
|
|
this.analyze = analyze;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获得正确答案数组
|
|
|
|
|
|
|
|
|
|
|
|
// 获取正确答案数组
|
|
|
|
public List<String> getCorrectArray() {
|
|
|
|
public List<String> getCorrectArray() {
|
|
|
|
return correctArray;
|
|
|
|
return correctArray;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//设置正确答案数组
|
|
|
|
|
|
|
|
|
|
|
|
// 设置正确答案数组
|
|
|
|
public void setCorrectArray(List<String> correctArray) {
|
|
|
|
public void setCorrectArray(List<String> correctArray) {
|
|
|
|
this.correctArray = correctArray;
|
|
|
|
this.correctArray = correctArray;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获得填写正确答案
|
|
|
|
|
|
|
|
|
|
|
|
// 获取正确答案
|
|
|
|
public String getCorrect() {
|
|
|
|
public String getCorrect() {
|
|
|
|
return correct;
|
|
|
|
return correct;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//设置填写正确答案
|
|
|
|
|
|
|
|
|
|
|
|
// 设置正确答案
|
|
|
|
public void setCorrect(String correct) {
|
|
|
|
public void setCorrect(String correct) {
|
|
|
|
this.correct = correct;
|
|
|
|
this.correct = correct;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获得分数
|
|
|
|
|
|
|
|
|
|
|
|
// 获取题目分数
|
|
|
|
public String getScore() {
|
|
|
|
public String getScore() {
|
|
|
|
return score;
|
|
|
|
return score;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//设置分数
|
|
|
|
|
|
|
|
|
|
|
|
// 设置题目分数
|
|
|
|
public void setScore(String score) {
|
|
|
|
public void setScore(String score) {
|
|
|
|
this.score = score;
|
|
|
|
this.score = score;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获得错误求解
|
|
|
|
|
|
|
|
|
|
|
|
// 获取题目难度
|
|
|
|
public Integer getDifficult() {
|
|
|
|
public Integer getDifficult() {
|
|
|
|
return difficult;
|
|
|
|
return difficult;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//设置错误求解
|
|
|
|
|
|
|
|
|
|
|
|
// 设置题目难度
|
|
|
|
public void setDifficult(Integer difficult) {
|
|
|
|
public void setDifficult(Integer difficult) {
|
|
|
|
this.difficult = difficult;
|
|
|
|
this.difficult = difficult;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//获得序号
|
|
|
|
|
|
|
|
|
|
|
|
// 获取题目项顺序
|
|
|
|
public Integer getItemOrder() {
|
|
|
|
public Integer getItemOrder() {
|
|
|
|
return itemOrder;
|
|
|
|
return itemOrder;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//设置序号
|
|
|
|
|
|
|
|
|
|
|
|
// 设置题目项顺序
|
|
|
|
public void setItemOrder(Integer itemOrder) {
|
|
|
|
public void setItemOrder(Integer itemOrder) {
|
|
|
|
this.itemOrder = itemOrder;
|
|
|
|
this.itemOrder = itemOrder;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|