From 333f29f008e27642c49b2d9c0fe19b0778b48965 Mon Sep 17 00:00:00 2001 From: zhaolongfei <2651195677@qq.com> Date: Fri, 5 Jul 2024 15:17:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E8=AF=BE=E8=80=83=E8=AF=95?= =?UTF-8?q?=E5=88=86=E6=95=B0=E7=8A=B6=E6=80=81=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../study/service/impl/StudyExamServiceImpl.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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());