|
@@ -55,6 +55,7 @@ public class UpdateCorrectAnswerAndReFixScoreTask implements TaskService {
|
|
|
|
|
|
Long examId = jsonParams.get("examId").asLong(0L);
|
|
|
String courseCodes = jsonParams.get("courseCodes").asText("");
|
|
|
+ String questionIds = jsonParams.get("questionIds").asText("");
|
|
|
|
|
|
//是否更新客观题答案
|
|
|
Boolean updateObjectiveAnswer = jsonParams.get("updateObjectiveAnswer").asBoolean(false);
|
|
@@ -63,8 +64,8 @@ public class UpdateCorrectAnswerAndReFixScoreTask implements TaskService {
|
|
|
//是否更新主观题分值
|
|
|
Boolean updateSubjectiveScore = jsonParams.get("updateSubjectiveScore").asBoolean(false);
|
|
|
|
|
|
- log.info("examId:{} courseCodes:{} updateObjectiveAnswer:{} updateObjectiveScore:{} updateSubjectiveScore:{}",
|
|
|
- examId, courseCodes, updateObjectiveAnswer, updateObjectiveScore, updateSubjectiveScore);
|
|
|
+ log.info("examId:{} courseCodes:{} questionIds:{} updateObjectiveAnswer:{} updateObjectiveScore:{} updateSubjectiveScore:{}",
|
|
|
+ examId, courseCodes, questionIds, updateObjectiveAnswer, updateObjectiveScore, updateSubjectiveScore);
|
|
|
|
|
|
// 待处理的课程列表(未指定课程则按考试的全部课程)
|
|
|
List<CourseVO> todoCourses;
|
|
@@ -88,20 +89,20 @@ public class UpdateCorrectAnswerAndReFixScoreTask implements TaskService {
|
|
|
for (CourseVO course : todoCourses) {
|
|
|
// 按考试课程逐个处理
|
|
|
log.info("examId:{} todoCourseCount:{} curIndex:{}", examId, todoCourses.size(), index);
|
|
|
- this.process(loginUser, examId, course, updateObjectiveAnswer, updateObjectiveScore, updateSubjectiveScore);
|
|
|
+ this.process(loginUser, examId, course, questionIds, updateObjectiveAnswer, updateObjectiveScore, updateSubjectiveScore);
|
|
|
index++;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void process(User loginUser, Long examId, CourseVO course, Boolean updateObjectiveAnswer,
|
|
|
- Boolean updateObjectiveScore, Boolean updateSubjectiveScore) {
|
|
|
+ public void process(User loginUser, Long examId, CourseVO course, String questionIds,
|
|
|
+ Boolean updateObjectiveAnswer, Boolean updateObjectiveScore, Boolean updateSubjectiveScore) {
|
|
|
List<ExamStudentVO> examStudents = this.getExamStudentList(loginUser, examId, course.getCourseId());
|
|
|
|
|
|
int index = 0, total = examStudents.size();
|
|
|
for (ExamStudentVO examStudent : examStudents) {
|
|
|
// 按考生逐个重新算分
|
|
|
this.fix(loginUser, examId, course.getCourseId(), examStudent.getExamStudentId(), updateObjectiveAnswer,
|
|
|
- updateObjectiveScore, updateSubjectiveScore);
|
|
|
+ updateObjectiveScore, updateSubjectiveScore, questionIds);
|
|
|
|
|
|
index++;
|
|
|
if (index % 100 == 0) {
|
|
@@ -118,7 +119,7 @@ public class UpdateCorrectAnswerAndReFixScoreTask implements TaskService {
|
|
|
}
|
|
|
|
|
|
private void fix(User loginUser, Long examId, Long courseId, Long examStudentId, Boolean updateObjectiveAnswer,
|
|
|
- Boolean updateObjectiveScore, Boolean updateSubjectiveScore) {
|
|
|
+ Boolean updateObjectiveScore, Boolean updateSubjectiveScore, String questionIds) {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
params.put("examId", examId);
|
|
|
params.put("courseId", courseId);
|
|
@@ -126,6 +127,7 @@ public class UpdateCorrectAnswerAndReFixScoreTask implements TaskService {
|
|
|
params.put("updateObjectiveAnswer", updateObjectiveAnswer);
|
|
|
params.put("updateObjectiveScore", updateObjectiveScore);
|
|
|
params.put("updateSubjectiveScore", updateSubjectiveScore);
|
|
|
+ params.put("questionIds", questionIds);
|
|
|
|
|
|
Map<String, String> headers = new HashMap<>();
|
|
|
headers.put("key", loginUser.getKey());
|