修改考试

This commit is contained in:
zhaolongfei
2024-05-28 18:12:46 +08:00
parent 08763593cd
commit 06d14582cc

View File

@@ -71,6 +71,7 @@ public class StudyExamServiceImpl implements IStudyExamService{
//用于计算考试成绩
CourseExam cexam=cexamDao.get(exam.getTestId());
int prog=exam.getScore().intValue()>=exam.getPassLine()?100:exam.getScore().intValue();
//完成处理,判断是否已存在
Object obj=scItemDao.findField("id", FieldFilters.eq("studyId", exam.getStudyId()), FieldFilters.eq("contentId", exam.getContentId()));
int status=exam.getScore()>=exam.getPassLine()?StudyCourseItem.STATUS_FINISH:StudyCourseItem.STATUS_STUDYING;
@@ -99,8 +100,8 @@ public class StudyExamServiceImpl implements IStudyExamService{
//更新最终成绩
//if(exam.get)
//检查是否全部学习完成
int totalContent=courseContentDao.count(FieldFilters.eq("courseId", exam.getCourseId()),FieldFilters.eq("deleted",false));
//int totalContent = courseContentDao.getCount(exam.getCourseId());
// int totalContent=courseContentDao.count(FieldFilters.eq("courseId", exam.getCourseId()),FieldFilters.eq("deleted",false));
int totalContent = courseContentDao.getCount(exam.getCourseId());
scDao.finishCheck(exam.getStudyId(),exam.getCourseId(),totalContent,token);
}else {
@@ -111,10 +112,10 @@ public class StudyExamServiceImpl implements IStudyExamService{
scItemDao.updateFieldById(exam.getStudyItemId(), "progress",prog);
}
if(prog==100){
scDao.updateFieldById(exam.getStudyId(), "progress",100.0f);
scDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now());
scDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH);
scDao.updateFieldById(exam.getStudyId(), "last_score",100.0f);
scItemDao.updateFieldById(exam.getStudyId(), "progress",100.0f);
scItemDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now());
scItemDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH);
scItemDao.updateFieldById(exam.getStudyId(), "score",100.0f);
}
}
@@ -125,10 +126,10 @@ public class StudyExamServiceImpl implements IStudyExamService{
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());
if(f>=exam.getPassLine()){
scDao.updateFieldById(exam.getStudyId(), "progress",100.0f);
scDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now());
scDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH);
scDao.updateFieldById(exam.getStudyId(), "last_score",100.0f);
scItemDao.updateFieldById(exam.getStudyId(), "progress",100.0f);
scItemDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now());
scItemDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH);
scItemDao.updateFieldById(exam.getStudyId(), "score",100.0f);
}
}
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(exam.getStudyId() ,exam.getCourseId(), token);