mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 19:06:49 +08:00
修改考试
This commit is contained in:
@@ -71,6 +71,7 @@ public class StudyExamServiceImpl implements IStudyExamService{
|
|||||||
//用于计算考试成绩
|
//用于计算考试成绩
|
||||||
CourseExam cexam=cexamDao.get(exam.getTestId());
|
CourseExam cexam=cexamDao.get(exam.getTestId());
|
||||||
int prog=exam.getScore().intValue()>=exam.getPassLine()?100:exam.getScore().intValue();
|
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()));
|
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;
|
int status=exam.getScore()>=exam.getPassLine()?StudyCourseItem.STATUS_FINISH:StudyCourseItem.STATUS_STUDYING;
|
||||||
@@ -99,8 +100,8 @@ public class StudyExamServiceImpl implements IStudyExamService{
|
|||||||
//更新最终成绩
|
//更新最终成绩
|
||||||
//if(exam.get)
|
//if(exam.get)
|
||||||
//检查是否全部学习完成
|
//检查是否全部学习完成
|
||||||
int totalContent=courseContentDao.count(FieldFilters.eq("courseId", exam.getCourseId()),FieldFilters.eq("deleted",false));
|
// int totalContent=courseContentDao.count(FieldFilters.eq("courseId", exam.getCourseId()),FieldFilters.eq("deleted",false));
|
||||||
//int totalContent = courseContentDao.getCount(exam.getCourseId());
|
int totalContent = courseContentDao.getCount(exam.getCourseId());
|
||||||
scDao.finishCheck(exam.getStudyId(),exam.getCourseId(),totalContent,token);
|
scDao.finishCheck(exam.getStudyId(),exam.getCourseId(),totalContent,token);
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
@@ -111,10 +112,10 @@ public class StudyExamServiceImpl implements IStudyExamService{
|
|||||||
scItemDao.updateFieldById(exam.getStudyItemId(), "progress",prog);
|
scItemDao.updateFieldById(exam.getStudyItemId(), "progress",prog);
|
||||||
}
|
}
|
||||||
if(prog==100){
|
if(prog==100){
|
||||||
scDao.updateFieldById(exam.getStudyId(), "progress",100.0f);
|
scItemDao.updateFieldById(exam.getStudyId(), "progress",100.0f);
|
||||||
scDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now());
|
scItemDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now());
|
||||||
scDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH);
|
scItemDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH);
|
||||||
scDao.updateFieldById(exam.getStudyId(), "last_score",100.0f);
|
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(), "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()){
|
||||||
scDao.updateFieldById(exam.getStudyId(), "progress",100.0f);
|
scItemDao.updateFieldById(exam.getStudyId(), "progress",100.0f);
|
||||||
scDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now());
|
scItemDao.updateFieldById(exam.getStudyId(), "finish_time",LocalDateTime.now());
|
||||||
scDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH);
|
scItemDao.updateFieldById(exam.getStudyId(), "status",StudyCourseItem.STATUS_FINISH);
|
||||||
scDao.updateFieldById(exam.getStudyId(), "last_score",100.0f);
|
scItemDao.updateFieldById(exam.getStudyId(), "score",100.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(exam.getStudyId() ,exam.getCourseId(), token);
|
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(exam.getStudyId() ,exam.getCourseId(), token);
|
||||||
|
|||||||
Reference in New Issue
Block a user