diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyExamServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyExamServiceImpl.java index 4e33d7d9..3a9401d4 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyExamServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyExamServiceImpl.java @@ -112,18 +112,18 @@ public class StudyExamServiceImpl implements IStudyExamService{ if(cexam.getScoringType()==CourseExam.SCORINGTYPE_LAST){ scItemDao.updateFieldById(exam.getStudyItemId(), "score",exam.getScore()); scItemDao.updateFieldById(exam.getStudyItemId(), "progress",prog); - } - if(prog==100){ - scItemDao.updateFieldById(exam.getStudyId(), "progress",100); - scItemDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now()); - scItemDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH); - scItemDao.updateFieldById(exam.getStudyId(), "score",100.0f); - //scDao.updateFieldById(exam.getStudyId(), "last_score",100.0f); + if(exam.getScore()>=exam.getPassLine()){ + scItemDao.updateFieldById(exam.getStudyId(), "progress",100); + scItemDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now()); + scItemDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH); + scItemDao.updateFieldById(exam.getStudyId(), "score",exam.getScore()); + //scDao.updateFieldById(exam.getStudyId(), "last_score",100.0f); + } } } //1最高一次,用于最高一次的计算 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()), FieldFilters.eq("courseId", exam.getCourseId()), FieldFilters.eq("studyId", exam.getStudyId())); scItemDao.updateFieldById(exam.getStudyItemId(), "score", f); 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());