|
|
|
@ -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 {
|
|
|
|
|
if(objScore>=paper.getQualifyScore()){
|
|
|
|
|
// 同步保存考试成绩
|
|
|
|
|
userExamManager.joinResult(paper.getUserId(), paper.getExamId(), objScore, objScore>=paper.getQualifyScore());
|
|
|
|
|
}else{
|
|
|
|
|
userExamManager.joinResult(paper.getUserId(), paper.getExamId(), objScore, 0);
|
|
|
|
|
}
|
|
|
|
|
paper.setState(PaperState.FINISHED);
|
|
|
|
|
}
|
|
|
|
|
paper.setUpdateTime(new Date());
|
|
|
|
|