修改bug

This commit is contained in:
zhaolongfei
2024-06-19 18:07:48 +08:00
parent 33fee46433
commit 1abd059820

View File

@@ -118,25 +118,25 @@ public class StudyExamServiceImpl implements IStudyExamService{
scItemDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now()); scItemDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now());
scItemDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH); scItemDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH);
scItemDao.updateFieldById(exam.getStudyId(), "score",100.0f); scItemDao.updateFieldById(exam.getStudyId(), "score",100.0f);
scDao.updateFieldById(exam.getStudyId(), "last_score",100.0f); //scDao.updateFieldById(exam.getStudyId(), "last_score",100.0f);
} }
} }
//1最高一次,用于最高一次的计算 //1最高一次,用于最高一次的计算
if(cexam.getScoringType()==CourseExam.SCORINGTYPE_MAX) { if(cexam.getScoringType()==CourseExam.SCORINGTYPE_MAX) {
Float f=(Float)dao.findField("max(score)", FieldFilters.eq("contentId", exam.getContentId())); Float f=(Float)dao.findField("max(score)", FieldFilters.eq("contentId", exam.getContentId()));
scItemDao.updateFieldById(exam.getStudyItemId(), "score", f); scItemDao.updateFieldById(exam.getStudyItemId(), "score", f);
scItemDao.updateFieldById(exam.getStudyItemId(), "status", f>=exam.getPassLine()?StudyCourseItem.STATUS_FINISH:StudyCourseItem.STATUS_STUDYING); scItemDao.updateFieldById(exam.getStudyItemId(), "status", f>=exam.getPassLine()?StudyCourseItem.STATUS_FINISH:StudyCourseItem.STATUS_STUDYING);
scItemDao.updateFieldById(exam.getStudyItemId(), "progress",f>=exam.getPassLine()?100:f.intValue()); scItemDao.updateFieldById(exam.getStudyItemId(), "progress",f>=exam.getPassLine()?100:f.intValue());
if(f>=exam.getPassLine()){ if(f>=exam.getPassLine()){
scItemDao.updateFieldById(exam.getStudyId(), "progress",100); scItemDao.updateFieldById(exam.getStudyId(), "progress",100);
scItemDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now()); scItemDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now());
scItemDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH); scItemDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH);
scItemDao.updateFieldById(exam.getStudyId(), "score",100.0f); scItemDao.updateFieldById(exam.getStudyId(), "score",100.0f);
scDao.updateFieldById(exam.getStudyId(), "last_score",100.0f); //scDao.updateFieldById(exam.getStudyId(), "last_score",100.0f);
} }
} }
scDao.updateFieldById(exam.getStudyId(), "last_score",exam.getScore());
//执行完毕 清除redis记录 //执行完毕 清除redis记录
// redisTemplate.delete(key); // redisTemplate.delete(key);
return ""; return "";