|
|
|
@ -242,9 +242,10 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
|
|
|
|
|
return teacherOpenCourseQuestionLogDao.getValuesByQueryNotWithPermission(teacherOpenCourseQuestionLogQuery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<TeacherOpenCourseQuestionLog> getValuesBySettingIds (String settingIds){
|
|
|
|
|
public List<TeacherOpenCourseQuestionLog> getValuesBySettingIds (String settingIds, Long studentId){
|
|
|
|
|
TeacherOpenCourseQuestionLogQuery logQuery = new TeacherOpenCourseQuestionLogQuery();
|
|
|
|
|
logQuery.setTeacherOpenCourseQuestionSettingIdPlural(settingIds);
|
|
|
|
|
logQuery.setStudentId(studentId);
|
|
|
|
|
logQuery.setTeacherOpenCourseQuestionLogStatus(1);
|
|
|
|
|
return teacherOpenCourseQuestionLogDao.getValuesByQueryNotWithPermission(logQuery);
|
|
|
|
|
}
|
|
|
|
@ -478,21 +479,19 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
|
|
|
|
|
.studentId(student.getStudentId())
|
|
|
|
|
.teacherOpenCourseQuestionSettingId(questionSettingId)
|
|
|
|
|
.build();
|
|
|
|
|
List<TeacherOpenCourseQuestionLog> logList = teacherOpenCourseQuestionLogDao.getValuesByQueryNotWithPermission(questionLogQuery);
|
|
|
|
|
List<TeacherOpenCourseQuestionLog> logListBySnapshotIds = teacherOpenCourseQuestionLogDao.getValuesByQueryNotWithPermission(questionLogQuery);
|
|
|
|
|
|
|
|
|
|
final List<QuestionLogAddTypeEnum> tempList = Arrays.asList(PRE_SUBMIT, null);
|
|
|
|
|
// 只是未提交的数据
|
|
|
|
|
logList = logList.stream().filter(item -> tempList.contains(item.getQuestionLogAddType())).collect(Collectors.toList());
|
|
|
|
|
Assert.notEmpty(logList, "未查询到题目信息!");
|
|
|
|
|
// 题目日志IDs汇总
|
|
|
|
|
String logsIds = logList.stream().map(item -> item.getTeacherOpenCourseQuestionLogId().toString()).collect(joining(","));
|
|
|
|
|
logListBySnapshotIds = logListBySnapshotIds.stream().filter(item -> tempList.contains(item.getQuestionLogAddType())).collect(Collectors.toList());
|
|
|
|
|
Assert.notEmpty(logListBySnapshotIds, "未查询到题目信息!");
|
|
|
|
|
|
|
|
|
|
// 当前时间, 存储要更新的题目日志集合
|
|
|
|
|
Date now = new Date(); List<TeacherOpenCourseQuestionLog> updateList = new ArrayList<>();
|
|
|
|
|
// 代表填空题和分析题的类型
|
|
|
|
|
List<Integer> questionType = Arrays.asList(4, 5);
|
|
|
|
|
// 处理答案和分数
|
|
|
|
|
logList.forEach(questionLog -> {
|
|
|
|
|
logListBySnapshotIds.forEach(questionLog -> {
|
|
|
|
|
// 验证最新的提交时间,防止网络延迟
|
|
|
|
|
if (!validateQuestionLogAddTimeLatest(questionSettingId, questionLog.getResourcesQuestionSnapshotId().toString(), studentId, addTime)) {
|
|
|
|
|
return;
|
|
|
|
@ -585,14 +584,14 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
|
|
|
|
|
if (addType.equals(FINALLY_SUBMIT)) {
|
|
|
|
|
// 计算学生分数,并标记错题
|
|
|
|
|
// calculateScoreOnSubmit(updateList);
|
|
|
|
|
updateBatchTemplate(updateList);
|
|
|
|
|
// updateBatchTemplate(updateList);
|
|
|
|
|
// 添加到题目日志汇总中
|
|
|
|
|
addQuestionLogSummary(student, questionSettingId, updateList);
|
|
|
|
|
// 批量插入错题集(错题库),方法内部自带分数判断。内部方法更新log中的错题标记。
|
|
|
|
|
teacherOpenCourseQuestionLogWrongService.insertBatchByQuestionLogList(updateList);
|
|
|
|
|
|
|
|
|
|
// 最终提交以后,将日志更改为2 删除状态,仅用于查看
|
|
|
|
|
deleteTeacherOpenCourseQuestionLog(listJoin(updateList, TeacherOpenCourseQuestionLog::getTeacherOpenCourseQuestionLogId));
|
|
|
|
|
deleteTeacherOpenCourseQuestionLog(listJoin(this.getValuesBySettingIds(questionSettingId.toString(), studentId), TeacherOpenCourseQuestionLog::getTeacherOpenCourseQuestionLogId));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -691,7 +690,7 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<TeacherOpenCourseQuestionLog> logList = new CopyOnWriteArrayList<>(getValuesBySettingIds(questionSettingId.toString()));
|
|
|
|
|
List<TeacherOpenCourseQuestionLog> logList = new CopyOnWriteArrayList<>(getValuesBySettingIds(questionSettingId.toString(), student.getStudentId()));
|
|
|
|
|
|
|
|
|
|
setErrorSuccessCountField(updateList, logList);
|
|
|
|
|
|
|
|
|
|