|
|
|
@ -469,13 +469,14 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
|
|
|
|
|
// 只添加可以更新的数据
|
|
|
|
|
updateList.add(questionLog);
|
|
|
|
|
});
|
|
|
|
|
// 计算学生分数,并标记错题
|
|
|
|
|
calculateScoreOnSubmit(updateList);
|
|
|
|
|
// 学生做的题目的答案与日志关联
|
|
|
|
|
updateBatchTemplate(updateList);
|
|
|
|
|
|
|
|
|
|
// 最后提交试卷答案时候,才会记录错题
|
|
|
|
|
if (addType.equals(FINALLY_SUBMIT)) {
|
|
|
|
|
// 计算学生分数,并标记错题
|
|
|
|
|
calculateScoreOnSubmit(updateList);
|
|
|
|
|
updateBatchTemplate(updateList);
|
|
|
|
|
// 添加到题目日志汇总中
|
|
|
|
|
addQuestionLogSummary(updateList, student,
|
|
|
|
|
questionSetting.getTeacherOpenCourseQuestionSettingName(), questionSetting.getTeacherOpenCourseQuestionSettingType());
|
|
|
|
@ -497,6 +498,8 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
|
|
|
|
|
logList.forEach(questionLog -> {
|
|
|
|
|
// 题目原本设置的分数
|
|
|
|
|
final BigDecimal questionScore = questionLog.getQuestionScore();
|
|
|
|
|
// 题目类型
|
|
|
|
|
Integer questionType = questionLog.getQuestionType();
|
|
|
|
|
// 学生提交的结果
|
|
|
|
|
final String studentAnswer = defaultIfNull(questionLog.getTeacherOpenCourseQuestionLogAnswer(), "");
|
|
|
|
|
// 题目的答案
|
|
|
|
@ -504,7 +507,7 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
|
|
|
|
|
// 判断答案和学生提交的结果,都不能为空
|
|
|
|
|
final boolean allNotEmpty = isAllNotEmpty(questionAnswer, studentAnswer);
|
|
|
|
|
// 题目类型,答案属于一道题
|
|
|
|
|
final boolean oneQuestion = isOneQuestion(questionLog.getQuestionType());
|
|
|
|
|
final boolean oneQuestion = isOneQuestion(questionType);
|
|
|
|
|
|
|
|
|
|
// 一条日志记录,属于一道题
|
|
|
|
|
if (oneQuestion) {
|
|
|
|
@ -532,7 +535,7 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
|
|
|
|
|
final int studentAnswerLength = studentAnswerArr.length;
|
|
|
|
|
final int questionLength = successAnswerArr.length;
|
|
|
|
|
// 断言需要判断,题目答案的数量是否相等,不然会对不上答案,导致分数计算错误
|
|
|
|
|
Assert.isTrue(studentAnswerLength == questionLength, "题干:" + questionLog.getQuestionStem()+ ",有选项未提交!");
|
|
|
|
|
// Assert.isTrue(studentAnswerLength == questionLength, "题干:" + questionLog.getQuestionStem()+ ",有选项未提交!");
|
|
|
|
|
|
|
|
|
|
// 一道题的分数
|
|
|
|
|
BigDecimal simpleQuestionScore = NumberUtil.mul(questionScore, questionLength);
|
|
|
|
@ -695,8 +698,6 @@ public class TeacherOpenCourseQuestionLogService extends CoreBaseService<Teacher
|
|
|
|
|
logicDeleteBySettingIds(questionSettingId.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 断言
|
|
|
|
|
Assert.notBlank(resourcesQuestionSnapshots.get(0).getQuestionAnswer(), "题目快照选项不能为空!");
|
|
|
|
|
List<TeacherOpenCourseQuestionLog> teacherOpenCourseQuestionLogs = BeanUtil.copyToList(resourcesQuestionSnapshots, TeacherOpenCourseQuestionLog.class);
|
|
|
|
|
|
|
|
|
|
// 设计个单表,后面进行修改操作
|
|
|
|
|