|
|
|
@ -246,21 +246,16 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
|
|
|
|
|
* @param student
|
|
|
|
|
*/
|
|
|
|
|
public void setMyQuestionLogScoreInfo(List<TeacherOpenCourseQuestionSetting> list, Student student) {
|
|
|
|
|
if (ObjectUtil.isAllNotEmpty(list, student)) {
|
|
|
|
|
Long studentId = student.getStudentId();
|
|
|
|
|
list.forEach(item -> {
|
|
|
|
|
Long questionSettingId = item.getTeacherOpenCourseQuestionSettingId();
|
|
|
|
|
Optional.ofNullable(list).orElse(Collections.emptyList()).forEach(item -> {
|
|
|
|
|
Long questionSettingId = item.getTeacherOpenCourseQuestionSettingId();
|
|
|
|
|
if (ObjectUtil.isNotEmpty(student)) {
|
|
|
|
|
Long studentId = student.getStudentId();
|
|
|
|
|
QuestionLogSummaryQuery logSummaryQuery = new QuestionLogSummaryQuery();
|
|
|
|
|
logSummaryQuery.setPersonId(studentId);
|
|
|
|
|
logSummaryQuery.setQuestionLogSummaryStatus(1);
|
|
|
|
|
logSummaryQuery.setQuestionSettingId(questionSettingId);
|
|
|
|
|
List<QuestionLogSummary> logSummaryList = questionLogSummaryDao.getValuesByQueryNotWithPermission(logSummaryQuery);
|
|
|
|
|
|
|
|
|
|
QuestionLogSummaryQuery logSummaryQuery2 = new QuestionLogSummaryQuery();
|
|
|
|
|
logSummaryQuery2.setQuestionLogSummaryStatus(1);
|
|
|
|
|
logSummaryQuery2.setQuestionSettingId(questionSettingId);
|
|
|
|
|
List<QuestionLogSummary> logSummaryList2 = questionLogSummaryDao.getValuesByQueryNotWithPermission(logSummaryQuery2);
|
|
|
|
|
|
|
|
|
|
// 我的得分,完成时间
|
|
|
|
|
if (ObjectUtil.isNotEmpty(logSummaryList)) {
|
|
|
|
|
QuestionLogSummary scoreInfo = logSummaryList.get(0);
|
|
|
|
@ -268,18 +263,31 @@ public class TeacherOpenCourseQuestionSettingService extends CoreBaseService<Tea
|
|
|
|
|
item.set("finishSecondTime", scoreInfo.getFinishSecondTime());
|
|
|
|
|
item.set("myScore", scoreInfo.getQuestionLogSummaryStudentTotalScore());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 平均及格率,平均得分等等
|
|
|
|
|
if (ObjectUtil.isNotEmpty(logSummaryList2)) {
|
|
|
|
|
BigDecimal studentTotalScore = logSummaryList2.stream().map(QuestionLogSummary::getQuestionLogSummaryStudentTotalScore).reduce(BigDecimal::add).get();
|
|
|
|
|
int passTotalCount = logSummaryList2.stream().map(QuestionLogSummary::getQuestionLogSummaryIsPass).reduce(Integer::sum).get();
|
|
|
|
|
int logSummarySize = logSummaryList2.size();
|
|
|
|
|
item.set("avgScore", NumberUtil.div(studentTotalScore, logSummarySize));
|
|
|
|
|
item.set("avgPassRate", NumberUtil.mul(NumberUtil.div(passTotalCount, logSummarySize, 3), 100));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
QuestionLogSummaryQuery logSummaryQuery2 = new QuestionLogSummaryQuery();
|
|
|
|
|
logSummaryQuery2.setQuestionLogSummaryStatus(1);
|
|
|
|
|
logSummaryQuery2.setQuestionSettingId(questionSettingId);
|
|
|
|
|
List<QuestionLogSummary> logSummaryList2 = questionLogSummaryDao.getValuesByQueryNotWithPermission(logSummaryQuery2);
|
|
|
|
|
|
|
|
|
|
// 平均及格率,平均得分等等
|
|
|
|
|
if (ObjectUtil.isNotEmpty(logSummaryList2)) {
|
|
|
|
|
BigDecimal studentTotalScore = logSummaryList2.stream().map(QuestionLogSummary::getQuestionLogSummaryStudentTotalScore).reduce(BigDecimal::add).get();
|
|
|
|
|
int passTotalCount = logSummaryList2.stream().map(QuestionLogSummary::getQuestionLogSummaryIsPass).reduce(Integer::sum).get();
|
|
|
|
|
int questionTotalCount = logSummaryList2.get(0).getQuestionLogSummaryQuestionTotalCount();
|
|
|
|
|
int totalSuccessCount = logSummaryList2.stream().map(QuestionLogSummary::getQuestionLogSummarySuccessCount).reduce(Integer::sum).get();
|
|
|
|
|
int totalErrorCount = logSummaryList2.stream().map(QuestionLogSummary::getQuestionLogSummaryErrorCount).reduce(Integer::sum).get();
|
|
|
|
|
BigDecimal totalSuccessRate = logSummaryList2.stream().map(QuestionLogSummary::getQuestionLogSummarySuccessRate).reduce(BigDecimal::add).get();
|
|
|
|
|
int logSummarySize = logSummaryList2.size();
|
|
|
|
|
|
|
|
|
|
item.set("avgScore", NumberUtil.div(studentTotalScore, logSummarySize, 1));
|
|
|
|
|
item.set("avgPassRate", NumberUtil.div(passTotalCount, logSummarySize, 1));
|
|
|
|
|
item.set("questionCount", questionTotalCount);
|
|
|
|
|
item.set("avgSuccessCount", NumberUtil.div(totalSuccessCount, logSummarySize, 1));
|
|
|
|
|
item.set("avgErrorCount", NumberUtil.div(totalErrorCount, logSummarySize, 1));
|
|
|
|
|
item.set("avgSuccessRate", NumberUtil.div(totalSuccessRate, logSummarySize, 1));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TeacherOpenCourseQuestionSetting getInfo (Long teacherOpenCourseQuestionSettingId){
|
|
|
|
|