feat:瀚高适配

hangao
wangxy 5 months ago
parent b4cac4c873
commit bf07843c67

@ -64,7 +64,7 @@ public class ExamManager {
this.calcScore(reqDTO);
ElExam elExam = Convert.convert(ElExam.class, reqDTO);
// 修复状态
if (Objects.nonNull(reqDTO.getTimeLimit()) && !reqDTO.getTimeLimit()
if (Objects.nonNull(reqDTO.getTimeLimit())
&& Objects.nonNull(reqDTO.getState())
&& Objects.equals(reqDTO.getState(), 2)) {
elExam.setState(0);

@ -218,8 +218,8 @@ public class PaperManager {
//保存试题信息
ElPaperQu paperQu = new ElPaperQu();
paperQu.setQuId(qu.getId());
paperQu.setAnswered(false);
paperQu.setIsRight(false);
paperQu.setAnswered(0);
paperQu.setIsRight(0);
paperQu.setQuType(qu.getQuType());
if (QuType.RADIO.equals(qu.getQuType())) {
@ -265,7 +265,7 @@ public class PaperManager {
paper.setUpdateTime(new Date());
paper.setQualifyScore(exam.getQualifyScore());
paper.setState(PaperState.ING);
paper.setHasSaq(false);
paper.setHasSaq(0);
// 截止时间
Calendar cl = Calendar.getInstance();
cl.setTimeInMillis(System.currentTimeMillis());
@ -303,7 +303,7 @@ public class PaperManager {
paperQuAnswer.setPaperId(paperId);
paperQuAnswer.setQuId(answer.getQuId());
paperQuAnswer.setAnswerId(answer.getId());
paperQuAnswer.setChecked(false);
paperQuAnswer.setChecked(0);
paperQuAnswer.setSort(ii);
paperQuAnswer.setAbc(ABC.get(ii));
paperQuAnswer.setIsRight(answer.getIsRight());
@ -403,18 +403,18 @@ public class PaperManager {
.eq(ElPaperQuAnswer::getQuId, reqDTO.getQuId());
List<ElPaperQuAnswer> list = paperQuAnswerService.list(wrapper);
//是否正确
boolean right = true;
int right = 1;
//更新正确答案
for (ElPaperQuAnswer item : list) {
if (reqDTO.getAnswers().contains(item.getId())) {
item.setChecked(true);
item.setChecked(1);
} else {
item.setChecked(false);
item.setChecked(0);
}
//有一个对不上就是错的
if (item.getIsRight()!=null && !item.getIsRight().equals(item.getChecked())) {
right = false;
right = 0;
}
paperQuAnswerService.updateById(item);
}
@ -424,7 +424,7 @@ public class PaperManager {
qu.setPaperId(reqDTO.getPaperId());
qu.setIsRight(right);
qu.setAnswer(reqDTO.getAnswer());
qu.setAnswered(true);
qu.setAnswered(1);
QueryWrapper<ElPaperQu> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(ElPaperQu::getPaperId, qu.getPaperId())
.eq(ElPaperQu::getQuId, qu.getQuId());
@ -457,8 +457,11 @@ public class PaperManager {
if(Boolean.TRUE.equals(paper.getHasSaq())) {
paper.setState(PaperState.WAIT_OPT);
}else {
// 同步保存考试成绩
userExamManager.joinResult(paper.getUserId(), paper.getExamId(), objScore, objScore>=paper.getQualifyScore());
if(objScore>=paper.getQualifyScore()){
// 同步保存考试成绩
}else{
userExamManager.joinResult(paper.getUserId(), paper.getExamId(), objScore, 0);
}
paper.setState(PaperState.FINISHED);
}
paper.setUpdateTime(new Date());

@ -182,7 +182,7 @@ public class QuManager {
if (StringUtils.isEmpty(a.getContent())) {
throw new ServiceException( no + "选项内容不为空!");
}
if (a.getIsRight()) {
if (a.getIsRight().equals(1)) {
trueCount += 1;
}
}
@ -267,7 +267,11 @@ public class QuManager {
List<QuAnswerDTO> list = new ArrayList<>(16);
for (QuExportDTO item : importList) {
QuAnswerDTO a = new QuAnswerDTO();
a.setIsRight("1".equals(item.getAIsRight()));
if("1".equals(item.getAIsRight())){
a.setIsRight(1);
}else{
a.setIsRight(0);
}
a.setContent(item.getAContent());
a.setAnalysis(item.getAAnalysis());
a.setId("");

@ -62,7 +62,7 @@ public class UserExamManager {
* @return void
*/
public void joinResult(Long userId, String examId, Integer score, boolean passed) {
public void joinResult(Long userId, String examId, Integer score, Integer passed) {
//查询条件
ElUserExam record = elUserExamService.lambdaQuery()
.eq(ElUserExam::getUserId, userId)

@ -116,9 +116,9 @@
<el-input-number v-model="postForm.totalTime" ></el-input-number>
</el-form-item>
<el-form-item label="是否限时">
<el-checkbox v-model="postForm.timeLimit" ></el-checkbox>
<el-checkbox v-model="postForm.timeLimit" :true-label="1" :false-label="0"></el-checkbox>
</el-form-item>
<el-form-item v-if="postForm.timeLimit" label="考试时间" prop="totalTime">
<el-form-item v-if="postForm.timeLimit === 1" label="考试时间" prop="totalTime">
<el-date-picker
v-model="dateValues"
format="yyyy-MM-dd"

@ -116,9 +116,9 @@
<el-input-number v-model="postForm.totalTime" ></el-input-number>
</el-form-item>
<el-form-item label="是否限时">
<el-checkbox v-model="postForm.timeLimit" ></el-checkbox>
<el-checkbox v-model="postForm.timeLimit" :true-label="1" :false-label="0"></el-checkbox>
</el-form-item>
<el-form-item v-if="postForm.timeLimit" label="考试时间" prop="totalTime">
<el-form-item v-if="postForm.timeLimit === 1" label="考试时间" prop="totalTime">
<el-date-picker
v-model="dateValues"
format="yyyy-MM-dd"

@ -71,7 +71,7 @@
align="center"
>
<template v-slot="scope">
<el-checkbox v-model="scope.row.isRight">答案</el-checkbox>
<el-checkbox v-model="scope.row.isRight" :true-label="1" :false-label="0">答案</el-checkbox>
</template>
</el-table-column>
<el-table-column
@ -247,21 +247,21 @@
handleTypeChange(v) {
this.postForm.answerList = []
if (v === 3) {
this.postForm.answerList.push({ isRight: true, content: '正确', analysis: '' })
this.postForm.answerList.push({ isRight: false, content: '错误', analysis: '' })
this.postForm.answerList.push({ isRight: 1, content: '正确', analysis: '' })
this.postForm.answerList.push({ isRight: 0, content: '错误', analysis: '' })
}
if (v === 1 || v === 2) {
this.postForm.answerList.push({ isRight: false, content: '', analysis: '' })
this.postForm.answerList.push({ isRight: false, content: '', analysis: '' })
this.postForm.answerList.push({ isRight: false, content: '', analysis: '' })
this.postForm.answerList.push({ isRight: false, content: '', analysis: '' })
this.postForm.answerList.push({ isRight: 0, content: '', analysis: '' })
this.postForm.answerList.push({ isRight: 0, content: '', analysis: '' })
this.postForm.answerList.push({ isRight: 0, content: '', analysis: '' })
this.postForm.answerList.push({ isRight: 0, content: '', analysis: '' })
}
},
// 添加子项
handleAdd() {
this.postForm.answerList.push({ isRight: false, content: '', analysis: '' })
this.postForm.answerList.push({ isRight: 0, content: '', analysis: '' })
},
removeItem(index) {
@ -297,7 +297,7 @@
submitForm() {
let rightCount = 0
this.postForm.answerList.forEach(function(item) {
if (item.isRight) {
if (item.isRight === 1) {
rightCount += 1
}
})

@ -70,7 +70,7 @@
align="center"
>
<template v-slot="scope">
<el-checkbox v-model="scope.row.isRight">答案</el-checkbox>
<el-checkbox v-model="scope.row.isRight" :true-label="1" :false-label="0">答案</el-checkbox>
</template>
</el-table-column>
<el-table-column
@ -258,21 +258,21 @@
handleTypeChange(v) {
this.postForm.answerList = []
if (v === 3) {
this.postForm.answerList.push({ isRight: true, content: '正确', analysis: '' })
this.postForm.answerList.push({ isRight: false, content: '错误', analysis: '' })
this.postForm.answerList.push({ isRight: 1, content: '正确', analysis: '' })
this.postForm.answerList.push({ isRight: 0, content: '错误', analysis: '' })
}
if (v === 1 || v === 2) {
this.postForm.answerList.push({ isRight: false, content: '', analysis: '' })
this.postForm.answerList.push({ isRight: false, content: '', analysis: '' })
this.postForm.answerList.push({ isRight: false, content: '', analysis: '' })
this.postForm.answerList.push({ isRight: false, content: '', analysis: '' })
this.postForm.answerList.push({ isRight: 0, content: '', analysis: '' })
this.postForm.answerList.push({ isRight: 0, content: '', analysis: '' })
this.postForm.answerList.push({ isRight: 0, content: '', analysis: '' })
this.postForm.answerList.push({ isRight: 0, content: '', analysis: '' })
}
},
// 添加子项
handleAdd() {
this.postForm.answerList.push({ isRight: false, content: '', analysis: '' })
this.postForm.answerList.push({ isRight: 0, content: '', analysis: '' })
},
removeItem(index) {
@ -308,7 +308,7 @@
submitForm() {
let rightCount = 0
this.postForm.answerList.forEach(function(item) {
if (item.isRight) {
if (item.isRight === 1) {
rightCount += 1
}
})

@ -9,6 +9,7 @@ import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;
/**
* <p>
@ -42,7 +43,7 @@ public class ExamDTO implements Serializable {
private Integer state;
@ApiModelProperty(value = "是否限时")
private Boolean timeLimit;
private Integer timeLimit;
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "开始时间")
@ -80,8 +81,7 @@ public class ExamDTO implements Serializable {
*/
public Integer getState(){
if(this.timeLimit!=null && this.timeLimit){
if(this.timeLimit != null && this.timeLimit != 0){
if(System.currentTimeMillis() < startTime.getTime() ){
return ExamState.READY_START;
}

@ -81,7 +81,7 @@ public class ElPaper implements Serializable {
/**
*
*/
private Boolean hasSaq;
private Integer hasSaq;
/**
*

@ -40,7 +40,7 @@ public class ElPaperQu implements Serializable {
/**
*
*/
private Boolean answered;
private Integer answered;
/**
*
@ -65,7 +65,7 @@ public class ElPaperQu implements Serializable {
/**
*
*/
private Boolean isRight;
private Integer isRight;
@TableField(exist = false)
private static final long serialVersionUID = 1L;

@ -40,12 +40,12 @@ public class ElPaperQuAnswer implements Serializable {
/**
*
*/
private Boolean isRight;
private Integer isRight;
/**
*
*/
private Boolean checked;
private Integer checked;
/**
*

@ -62,7 +62,7 @@ public class PaperDTO implements Serializable {
private Integer userScore;
@ApiModelProperty(value = "是否包含简答题")
private Boolean hasSaq;
private Integer hasSaq;
@ApiModelProperty(value = "试卷状态")
private Integer state;

@ -34,10 +34,10 @@ public class PaperQuAnswerDTO implements Serializable {
private String quId;
@ApiModelProperty(value = "是否正确项")
private Boolean isRight;
private Integer isRight;
@ApiModelProperty(value = "是否选中")
private Boolean checked;
private Integer checked;
@ApiModelProperty(value = "排序")
private Integer sort;

@ -34,7 +34,7 @@ public class PaperQuDTO implements Serializable {
private Integer quType;
@ApiModelProperty(value = "是否已答")
private Boolean answered;
private Integer answered;
@ApiModelProperty(value = "主观答案")
private String answer;
@ -49,6 +49,6 @@ public class PaperQuDTO implements Serializable {
private Integer actualScore;
@ApiModelProperty(value = "是否答对")
private Boolean isRight;
private Integer isRight;
}

@ -30,7 +30,7 @@ public class ElQuAnswer implements Serializable {
/**
*
*/
private Boolean isRight;
private Integer isRight;
/**
*

@ -30,7 +30,7 @@ public class QuAnswerDTO implements Serializable {
private String quId;
@ApiModelProperty(value = "是否正确")
private Boolean isRight;
private Integer isRight;
@ApiModelProperty(value = "选项图片")
private String image;

@ -47,7 +47,7 @@ public class ElUserExam implements Serializable {
/**
*
*/
private Boolean passed;
private Integer passed;
/**
*

@ -37,7 +37,7 @@ public class UserExamDTO implements Serializable {
private Integer maxScore;
@ApiModelProperty(value = "是否通过")
private Boolean passed;
private Integer passed;
@ApiModelProperty(value = "创建时间")
private Date createTime;

@ -27,11 +27,11 @@
<!-- 计算总分 -->
<select id="sumObjective" resultType="int">
SELECT IFNULL(SUM(actual_score),0) as total
SELECT COALESCE(SUM(CAST(actual_score AS INTEGER)), 0) AS total
FROM el_paper_qu
WHERE paper_id=#{paperId}
AND is_right=true
AND qu_type &lt; 4
AND is_right='1'
AND qu_type &lt; '4'
</select>

Loading…
Cancel
Save