|
@@ -1,11 +1,11 @@
|
|
|
package cn.com.qmth.stmms.biz.mark.service.Impl;
|
|
|
|
|
|
-import cn.com.qmth.stmms.biz.exam.dao.*;
|
|
|
+import cn.com.qmth.stmms.biz.exam.dao.MarkGroupDao;
|
|
|
+import cn.com.qmth.stmms.biz.exam.dao.MarkGroupStudentDao;
|
|
|
+import cn.com.qmth.stmms.biz.exam.dao.MarkerDao;
|
|
|
+import cn.com.qmth.stmms.biz.exam.dao.SubjectiveScoreDao;
|
|
|
import cn.com.qmth.stmms.biz.exam.model.*;
|
|
|
-import cn.com.qmth.stmms.biz.exam.service.ExamQuestionService;
|
|
|
-import cn.com.qmth.stmms.biz.exam.service.ExamService;
|
|
|
-import cn.com.qmth.stmms.biz.exam.service.ExamStudentService;
|
|
|
-import cn.com.qmth.stmms.biz.exam.service.ExamSubjectService;
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.*;
|
|
|
import cn.com.qmth.stmms.biz.mark.dao.*;
|
|
|
import cn.com.qmth.stmms.biz.mark.model.*;
|
|
|
import cn.com.qmth.stmms.biz.mark.query.MarkLibrarySearchQuery;
|
|
@@ -15,7 +15,6 @@ import cn.com.qmth.stmms.biz.utils.TaskLock;
|
|
|
import cn.com.qmth.stmms.biz.utils.TaskLockUtil;
|
|
|
import cn.com.qmth.stmms.common.enums.*;
|
|
|
import cn.com.qmth.stmms.common.utils.BigDecimalUtils;
|
|
|
-import org.apache.commons.lang.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -23,6 +22,7 @@ import org.springframework.data.domain.Sort;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
|
@@ -36,6 +36,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
|
|
|
protected static final Logger log = LoggerFactory.getLogger(MarkServiceImpl.class);
|
|
|
|
|
|
+ public static final int UN_SELECTIVE_SCORE = -1;
|
|
|
+
|
|
|
@Autowired
|
|
|
private ExamStudentService studentService;
|
|
|
|
|
@@ -52,7 +54,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
private SubjectiveScoreDao scoreDao;
|
|
|
|
|
|
@Autowired
|
|
|
- private ExamQuestionDao questionDao;
|
|
|
+ private ExamQuestionService questionService;
|
|
|
|
|
|
@Autowired
|
|
|
private MarkerDao markerDao;
|
|
@@ -72,9 +74,6 @@ public class MarkServiceImpl implements MarkService {
|
|
|
@Autowired
|
|
|
private TrialLibraryDao trialLibraryDao;
|
|
|
|
|
|
- @Autowired
|
|
|
- private TrialHistoryDao trialHistoryDao;
|
|
|
-
|
|
|
@Autowired
|
|
|
private TrialTrackDao trialTrackDao;
|
|
|
|
|
@@ -88,7 +87,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
private ExamService examService;
|
|
|
|
|
|
@Autowired
|
|
|
- private ExamQuestionService questionService;
|
|
|
+ private SelectiveGroupService selectiveGroupService;
|
|
|
|
|
|
private Map<Integer, Long> markerLastUpdateTime = new ConcurrentHashMap<>();
|
|
|
|
|
@@ -100,12 +99,9 @@ public class MarkServiceImpl implements MarkService {
|
|
|
*/
|
|
|
@Override
|
|
|
public int applyCount(MarkGroup group) {
|
|
|
+ TaskLock taskLock = getTaskLock(group);
|
|
|
int count = 0;
|
|
|
- if (group.getStatus() == MarkStatus.TRIAL) {
|
|
|
- TaskLock taskLock = TaskLockUtil.getTrialTask(getGroupKey(group));
|
|
|
- count = taskLock.count();
|
|
|
- } else if (group.getStatus() == MarkStatus.FORMAL) {
|
|
|
- TaskLock taskLock = TaskLockUtil.getFormalTask(getGroupKey(group));
|
|
|
+ if (taskLock != null) {
|
|
|
count = taskLock.count();
|
|
|
}
|
|
|
return count;
|
|
@@ -119,20 +115,26 @@ public class MarkServiceImpl implements MarkService {
|
|
|
*/
|
|
|
@Override
|
|
|
public int applyCount(Marker marker) {
|
|
|
+ int count = 0;
|
|
|
MarkGroup group = marker.getGroup();
|
|
|
if (group == null) {
|
|
|
group = groupDao.findOne(marker.getExamId(), marker.getSubjectCode(), marker.getGroupNumber());
|
|
|
}
|
|
|
- if (group != null) {
|
|
|
- if (group.getStatus() == MarkStatus.FORMAL) {
|
|
|
- TaskLock taskLock = TaskLockUtil.getFormalTask(getGroupKey(marker));
|
|
|
- return taskLock.count(marker.getId());
|
|
|
- } else if (group.getStatus() == MarkStatus.TRIAL) {
|
|
|
- TaskLock taskLock = TaskLockUtil.getTrialTask(getGroupKey(marker));
|
|
|
- return taskLock.count(marker.getId());
|
|
|
- }
|
|
|
+ TaskLock taskLock = getTaskLock(group);
|
|
|
+ if (taskLock != null) {
|
|
|
+ count = taskLock.count(marker.getId());
|
|
|
}
|
|
|
- return 0;
|
|
|
+ return count;
|
|
|
+ }
|
|
|
+
|
|
|
+ private TaskLock getTaskLock(MarkGroup group) {
|
|
|
+ if (group.getStatus() == MarkStatus.FORMAL) {
|
|
|
+ return TaskLockUtil.getFormalTask(getGroupKey(group));
|
|
|
+
|
|
|
+ } else if (group.getStatus() == MarkStatus.TRIAL) {
|
|
|
+ return TaskLockUtil.getTrialTask(getGroupKey(group));
|
|
|
+ }
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -149,7 +151,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
}
|
|
|
if (group != null) {
|
|
|
if (group.getStatus() == MarkStatus.TRIAL) {
|
|
|
- return trialHistoryDao.countByMarkerId(marker.getId());
|
|
|
+ return trialLibraryDao.countByMarkerId(marker.getId());
|
|
|
} else {
|
|
|
return libraryDao.countByMarkerAndStatus(marker.getId(), LibraryStatus.MARKED, LibraryStatus.ARBITRATED,
|
|
|
LibraryStatus.INSPECTED);
|
|
@@ -165,13 +167,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
*/
|
|
|
@Override
|
|
|
public void releaseByGroup(MarkGroup group) {
|
|
|
- if (group.getStatus() == MarkStatus.TRIAL) {
|
|
|
- TaskLock taskLock = TaskLockUtil.getTrialTask(getGroupKey(group));
|
|
|
- taskLock.clear();
|
|
|
- } else if (group.getStatus() == MarkStatus.FORMAL) {
|
|
|
- TaskLock taskLock = TaskLockUtil.getFormalTask(getGroupKey(group));
|
|
|
- taskLock.clear();
|
|
|
- }
|
|
|
+ TaskLock taskLock = getTaskLock(group);
|
|
|
+ taskLock.clear();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -197,8 +194,6 @@ public class MarkServiceImpl implements MarkService {
|
|
|
trialTrackDao.deleteByExamIdAndSubjectCodeAndGroupNumber(group.getExamId(), group.getSubjectCode(),
|
|
|
group.getNumber());
|
|
|
trialTagDao.deleteByExamAndSubjectAndGroup(group.getExamId(), group.getSubjectCode(), group.getNumber());
|
|
|
- trialHistoryDao.deleteByExamIdAndSubjectCodeAndGroupNumber(group.getExamId(), group.getSubjectCode(),
|
|
|
- group.getNumber());
|
|
|
trialLibraryDao.deleteByExamIdAndSubjectCodeAndGroupNumber(group.getExamId(), group.getSubjectCode(),
|
|
|
group.getNumber());
|
|
|
// 正评相关数据
|
|
@@ -215,7 +210,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
markerDao.deleteByExamIdAndSubjectCodeAndGroupNumber(group.getExamId(), group.getSubjectCode(),
|
|
|
group.getNumber());
|
|
|
// 小题数据
|
|
|
- questionDao
|
|
|
+ questionService
|
|
|
.resetByExamIdAndSubjectCodeAndObjectiveAndGroupNumber(group.getExamId(), group.getSubjectCode(), false,
|
|
|
group.getNumber());
|
|
|
// 考生分组状态与得分明细
|
|
@@ -227,7 +222,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
releaseByGroup(group);
|
|
|
groupDao.delete(group);
|
|
|
// 未分组的题目
|
|
|
- long unGroupQuestionCount = questionDao
|
|
|
+ long unGroupQuestionCount = questionService
|
|
|
.countByExamIdAndSubjectAndObjectiveAndGroupNumberIsNull(group.getExamId(), group.getSubjectCode(),
|
|
|
false);
|
|
|
// 考生整体状态与总分更新
|
|
@@ -235,6 +230,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
if (groupCount == 0 || unGroupQuestionCount > 0) {
|
|
|
studentService.updateSubjectiveStatusAndScoreAndInspectorId(group.getExamId(), group.getSubjectCode(),
|
|
|
SubjectiveStatus.UNMARK, 0, null, null, null);
|
|
|
+ subjectService.updateTrialCount(group.getExamId(), group.getSubjectCode(), 0);
|
|
|
} else {
|
|
|
List<Integer> studentList = studentService
|
|
|
.findIdByExamIdAndSubjectCodeAndSubjectiveStatus(group.getExamId(), group.getSubjectCode(),
|
|
@@ -252,25 +248,27 @@ public class MarkServiceImpl implements MarkService {
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public void updateGroup(MarkGroup group, List<ExamQuestion> questionList, ScorePolicy policy, ThirdPolicy third) {
|
|
|
- List<ExamQuestion> old = questionDao
|
|
|
- .findByExamIdAndSubjectCodeAndObjectiveAndGroupNumber(group.getExamId(), group.getSubjectCode(), false,
|
|
|
+ public void updateGroup(MarkGroup group, List<ExamQuestion> questionList, ScorePolicy policy, ThirdPolicy third,
|
|
|
+ boolean selective) {
|
|
|
+ List<ExamQuestion> old = questionService
|
|
|
+ .findByExamAndSubjectAndObjectiveAndGroupNumber(group.getExamId(), group.getSubjectCode(), false,
|
|
|
group.getNumber());
|
|
|
for (ExamQuestion question : old) {
|
|
|
question.setGroupNumber(null);
|
|
|
- questionDao.saveAndFlush(question);
|
|
|
+ questionService.saveAndFlush(question);
|
|
|
}
|
|
|
- double totalScore = 0d;
|
|
|
+ BigDecimal totalScore = BigDecimal.ZERO;
|
|
|
for (ExamQuestion question : questionList) {
|
|
|
- totalScore += question.getTotalScore();
|
|
|
+ totalScore = totalScore.add(BigDecimal.valueOf(question.getTotalScore()));
|
|
|
question.setGroupNumber(group.getNumber());
|
|
|
- questionDao.saveAndFlush(question);
|
|
|
+ questionService.saveAndFlush(question);
|
|
|
}
|
|
|
- groupDao.updateTotalScore(group.getExamId(), group.getSubjectCode(), group.getNumber(), totalScore);
|
|
|
+ groupDao.updateTotalScore(group.getExamId(), group.getSubjectCode(), group.getNumber(),
|
|
|
+ totalScore.doubleValue());
|
|
|
groupDao.updateScorePolicy(group.getExamId(), group.getSubjectCode(), group.getNumber(), policy);
|
|
|
groupDao.updateThirdPolicy(group.getExamId(), group.getSubjectCode(), group.getNumber(), third);
|
|
|
- subjectService.updateScore(group.getExamId(), group.getSubjectCode(), false,
|
|
|
- sumTotalScore(group.getExamId(), group.getSubjectCode()));
|
|
|
+ groupDao.updateSelective(group.getExamId(), group.getSubjectCode(), group.getNumber(), selective);
|
|
|
+
|
|
|
resetGroup(group);
|
|
|
if (group.getStatus() == MarkStatus.FORMAL) {
|
|
|
libraryDao.deleteByExamIdAndSubjectCodeAndGroupNumber(group.getExamId(), group.getSubjectCode(),
|
|
@@ -435,7 +433,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
} else if (group.getStatus() == MarkStatus.TRIAL) {
|
|
|
trialTagDao.deleteByMarkerId(marker.getId());
|
|
|
trialTrackDao.deleteByMarkerId(marker.getId());
|
|
|
- trialHistoryDao.deleteByMarkerId(marker.getId());
|
|
|
+ trialLibraryDao.resetByMarkerId(marker.getId());
|
|
|
}
|
|
|
updateMarkedCount(group);
|
|
|
releaseByMarker(marker);
|
|
@@ -458,7 +456,6 @@ public class MarkServiceImpl implements MarkService {
|
|
|
// 试评相关数据
|
|
|
trialTrackDao.deleteByStudentId(student.getId());
|
|
|
trialTagDao.deleteByStudentId(student.getId());
|
|
|
- trialHistoryDao.deleteByStudentId(student.getId());
|
|
|
trialLibraryDao.deleteByStudentId(student.getId());
|
|
|
// 主观状态与得分明细
|
|
|
groupStudentDao.deleteByStudentId(student.getId());
|
|
@@ -483,71 +480,73 @@ public class MarkServiceImpl implements MarkService {
|
|
|
return SubmitResult.faile();
|
|
|
}
|
|
|
|
|
|
+ Date now = new Date();
|
|
|
// 根据评卷状态选择读取不同的评卷任务
|
|
|
if (group.getStatus() == MarkStatus.FORMAL) {
|
|
|
MarkLibrary library = libraryDao.findOne(result.getLibraryId());
|
|
|
- if (library != null && result.isProblem()) {
|
|
|
- // 状态更新
|
|
|
- Date now = new Date();
|
|
|
- if (libraryDao.updateProblemResult(library.getId(), LibraryStatus.PROBLEM, marker.getId(), now,
|
|
|
- result.getSpent(), LibraryStatus.WAITING, LibraryStatus.MARKED, LibraryStatus.INSPECTED,
|
|
|
- LibraryStatus.REJECTED) != 0) {
|
|
|
- saveProblemHistory(result, library);
|
|
|
- updateMarkedCount(group);
|
|
|
- // 未评完
|
|
|
- resetStudentGroup(library.getStudentId(), library.getExamId(), library.getSubjectCode(),
|
|
|
- library.getGroupNumber());
|
|
|
- trackDao.deleteByLibraryId(library.getId());
|
|
|
- specialTagDao.deleteByLibraryId(library.getId());
|
|
|
- return SubmitResult.success(library);
|
|
|
- }
|
|
|
- }
|
|
|
if (library != null && library.getExamId().equals(group.getExamId()) && library.getSubjectCode()
|
|
|
- .equals(group.getSubjectCode()) && library.getGroupNumber().equals(group.getNumber())
|
|
|
- && result.getMarkerScore() <= group.getTotalScore() && StringUtils
|
|
|
- .isNotBlank(result.getScoreList())) {
|
|
|
- if (submitLibrary(library, marker, group, result)) {
|
|
|
- updateMarkedCount(group);
|
|
|
- return SubmitResult.success(library);
|
|
|
+ .equals(group.getSubjectCode()) && library.getGroupNumber().equals(group.getNumber())) {
|
|
|
+ // 问题卷
|
|
|
+ if (result.isProblem()) {
|
|
|
+ // 状态更新
|
|
|
+ if (libraryDao.updateProblemResult(library.getId(), LibraryStatus.PROBLEM, marker.getId(), now,
|
|
|
+ result.getSpent(), 0d, null, LibraryStatus.WAITING, LibraryStatus.MARKED,
|
|
|
+ LibraryStatus.INSPECTED, LibraryStatus.REJECTED) != 0) {
|
|
|
+ saveProblemHistory(result, library, marker);
|
|
|
+ updateMarkedCount(group);
|
|
|
+ // 未评完
|
|
|
+ resetStudentGroup(library.getStudentId(), library.getExamId(), library.getSubjectCode(),
|
|
|
+ library.getGroupNumber());
|
|
|
+ trackDao.deleteByLibraryId(library.getId());
|
|
|
+ specialTagDao.deleteByLibraryId(library.getId());
|
|
|
+ return SubmitResult.success(library);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (result.getMarkerScore() <= group.getTotalScore()) {
|
|
|
+ if (submitLibrary(library, marker, group, result)) {
|
|
|
+ updateMarkedCount(group);
|
|
|
+ return SubmitResult.success(library);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else if (group.getStatus() == MarkStatus.TRIAL) {
|
|
|
TrialLibrary library = trialLibraryDao.findOne(result.getLibraryId());
|
|
|
if (library != null && library.getExamId().equals(group.getExamId()) && library.getSubjectCode()
|
|
|
.equals(group.getSubjectCode()) && library.getGroupNumber().equals(group.getNumber())
|
|
|
- && result.getMarkerScore() <= group.getTotalScore() && StringUtils
|
|
|
- .isNotBlank(result.getScoreList())) {
|
|
|
- TrialHistory history = new TrialHistory();
|
|
|
- history.setExamId(library.getExamId());
|
|
|
- history.setSubjectCode(library.getSubjectCode());
|
|
|
- history.setGroupNumber(library.getGroupNumber());
|
|
|
- history.setLibraryId(library.getId());
|
|
|
- history.setStudentId(library.getStudentId());
|
|
|
- history.setMarkerId(marker.getId());
|
|
|
- history.setMarkerTime(new Date());
|
|
|
- history.setMarkerScore(result.getMarkerScore());
|
|
|
- history.setMarkerScoreList(result.getScoreList());
|
|
|
- history.setSecretNumber(library.getSecretNumber());
|
|
|
- history = trialHistoryDao.save(history);
|
|
|
- if (history != null) {
|
|
|
- if (result.getTrackList() != null) {
|
|
|
- trialTrackDao.deleteByLibraryIdAndMarkerId(history.getLibraryId(), history.getMarkerId());
|
|
|
- trialTrackDao.save(result.getTrackList(history));
|
|
|
- }
|
|
|
- if (result.getSpecialTagList() != null) {
|
|
|
- trialTagDao.deleteByLibraryIdAndMarkerId(history.getLibraryId(), history.getMarkerId());
|
|
|
- trialTagDao.save(result.getTagList(history));
|
|
|
- }
|
|
|
- updateMarkedCount(group);
|
|
|
- // releaseLibrary(library, marker);
|
|
|
- return SubmitResult.success(library);
|
|
|
+ && result.getMarkerScore() <= group.getTotalScore()) {
|
|
|
+ if ((library.getMarkerId() == null && !hasApplied(library, marker)) || (library.getMarkerId() != null
|
|
|
+ && !library.getMarkerId().equals(marker.getId()))) {
|
|
|
+ return SubmitResult.faile();
|
|
|
+ }
|
|
|
+ library.setMarkerId(marker.getId());
|
|
|
+ library.setMarkerTime(new Date());
|
|
|
+ // 未选做
|
|
|
+ if (result.isUnselective() && group.isSelective()) {
|
|
|
+ result.setMarkerScore(UN_SELECTIVE_SCORE);
|
|
|
+ result.setScoreList(new Double[0]);
|
|
|
+ trialTrackDao.deleteByLibraryIdAndMarkerId(library.getId(), library.getMarkerId());
|
|
|
+ trialTagDao.deleteByLibraryIdAndMarkerId(library.getId(), library.getMarkerId());
|
|
|
}
|
|
|
+ library.setMarkerScore(result.getMarkerScore());
|
|
|
+ library.setMarkerScoreList(result.getScoreList());
|
|
|
+ library = trialLibraryDao.save(library);
|
|
|
+ if (result.getTrackList() != null && !result.isUnselective()) {
|
|
|
+ trialTrackDao.deleteByLibraryIdAndMarkerId(library.getId(), library.getMarkerId());
|
|
|
+ trialTrackDao.save(result.getTrackList(library));
|
|
|
+ }
|
|
|
+ if (result.getSpecialTagList() != null && !result.isUnselective()) {
|
|
|
+ trialTagDao.deleteByLibraryIdAndMarkerId(library.getId(), library.getMarkerId());
|
|
|
+ trialTagDao.save(result.getTagList(library));
|
|
|
+ }
|
|
|
+ checkStudentTrial(library, group);
|
|
|
+ updateMarkedCount(group);
|
|
|
+ return SubmitResult.success(library);
|
|
|
}
|
|
|
}
|
|
|
return SubmitResult.faile();
|
|
|
}
|
|
|
|
|
|
- private void saveProblemHistory(MarkResult result, MarkLibrary library) {
|
|
|
+ private void saveProblemHistory(MarkResult result, MarkLibrary library, Marker marker) {
|
|
|
ProblemHistory history = problemHistoryDao.findByLibraryIdAndStatus(library.getId(), HistoryStatus.WAITING);
|
|
|
if (history == null) {
|
|
|
history = new ProblemHistory();
|
|
@@ -562,6 +561,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
history.setGroupNumber(library.getGroupNumber());
|
|
|
history.setProblemId(result.getProblemTypeId());
|
|
|
history.setStatus(HistoryStatus.WAITING);
|
|
|
+ history.setMarkerId(marker.getId());
|
|
|
problemHistoryDao.save(history);
|
|
|
}
|
|
|
|
|
@@ -589,6 +589,13 @@ public class MarkServiceImpl implements MarkService {
|
|
|
> 0) {
|
|
|
return false;
|
|
|
}
|
|
|
+ // 未选做
|
|
|
+ if (result.isUnselective() && group.isSelective()) {
|
|
|
+ result.setMarkerScore(UN_SELECTIVE_SCORE);
|
|
|
+ result.setScoreList(new Double[0]);
|
|
|
+ trackDao.deleteByLibraryId(library.getId());
|
|
|
+ specialTagDao.deleteByLibraryId(library.getId());
|
|
|
+ }
|
|
|
// 尝试提交评卷结果
|
|
|
Date now = new Date();
|
|
|
if (libraryDao
|
|
@@ -599,7 +606,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
return false;
|
|
|
}
|
|
|
// 保存阅卷轨迹
|
|
|
- if (result.getTrackList() != null) {
|
|
|
+ if (result.getTrackList() != null && !result.isUnselective()) {
|
|
|
trackDao.deleteByLibraryId(library.getId());
|
|
|
List<MarkTrack> tracks = result.getTrackList(library, marker);
|
|
|
for (MarkTrack markTrack : tracks) {
|
|
@@ -607,7 +614,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
}
|
|
|
}
|
|
|
// 保存特殊标记
|
|
|
- if (result.getSpecialTagList() != null) {
|
|
|
+ if (result.getSpecialTagList() != null && !result.isUnselective()) {
|
|
|
specialTagDao.deleteByLibraryId(library.getId());
|
|
|
specialTagDao.save(result.getSpecialTagList(library, marker));
|
|
|
}
|
|
@@ -619,11 +626,22 @@ public class MarkServiceImpl implements MarkService {
|
|
|
.findByStudentIdAndGroupNumberAndStatus(library.getStudentId(), library.getGroupNumber(),
|
|
|
LibraryStatus.MARKED, LibraryStatus.INSPECTED);
|
|
|
for (MarkLibrary other : list) {
|
|
|
+ // 本评卷任务或组长已打分,则跳过该任务
|
|
|
if (other.getId().equals(library.getId()) || other.getHeaderScore() != null) {
|
|
|
- // 本评卷任务或组长已打分,则跳过该任务
|
|
|
continue;
|
|
|
}
|
|
|
- // 分差超过阀值,
|
|
|
+ // 均为未选做,跳过该任务
|
|
|
+ if (other.getMarkerScore() == UN_SELECTIVE_SCORE && result.getMarkerScore() == UN_SELECTIVE_SCORE) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ // 其中一个有分另一个未选做 直接进入仲裁
|
|
|
+ if ((other.getMarkerScore() != UN_SELECTIVE_SCORE && result.getMarkerScore() == UN_SELECTIVE_SCORE) || (
|
|
|
+ other.getMarkerScore() == UN_SELECTIVE_SCORE
|
|
|
+ && result.getMarkerScore() != UN_SELECTIVE_SCORE)) {
|
|
|
+ history = buildArbitrateHistory(library, now);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ // 分差超过阀值
|
|
|
if (Math.abs(other.getMarkerScore() - result.getMarkerScore()) > group.getArbitrateThreshold()) {
|
|
|
// 开启三评
|
|
|
if (group.getThirdPolicy().equals(ThirdPolicy.LOW_DIFF_HIGH_AVG)) {
|
|
@@ -712,19 +730,19 @@ public class MarkServiceImpl implements MarkService {
|
|
|
|
|
|
/**
|
|
|
* 管理员/组长打回某个评卷任务<br>
|
|
|
- * 暂时不用到BACKED状态,直接等同于重置该评卷任务
|
|
|
+ * isRest为true时重置该评卷任务
|
|
|
*
|
|
|
* @param library - 正评任务
|
|
|
*/
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public boolean backLibrary(MarkLibrary library, Integer userId) {
|
|
|
+ public boolean rejectLibrary(MarkLibrary library, Integer userId, boolean isRest) {
|
|
|
MarkGroup group = groupDao.findOne(library.getExamId(), library.getSubjectCode(), library.getGroupNumber());
|
|
|
if (group.getStatus() == MarkStatus.FINISH) {
|
|
|
return false;
|
|
|
}
|
|
|
- if (libraryDao.resetById(library.getId(), library.getMarkerId(), LibraryStatus.REJECTED, LibraryStatus.MARKED,
|
|
|
- LibraryStatus.PROBLEM, LibraryStatus.INSPECTED) > 0) {
|
|
|
+ if (libraryDao.resetById(library.getId(), null, isRest ? LibraryStatus.WAITING : LibraryStatus.REJECTED,
|
|
|
+ LibraryStatus.MARKED, LibraryStatus.PROBLEM, LibraryStatus.INSPECTED) > 0) {
|
|
|
trackDao.deleteByLibraryId(library.getId());
|
|
|
specialTagDao.deleteByLibraryId(library.getId());
|
|
|
resetStudentGroup(library.getStudentId(), library.getExamId(), library.getSubjectCode(),
|
|
@@ -759,7 +777,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
@Transactional
|
|
|
public boolean resetLibrary(TrialLibrary library) {
|
|
|
if (library != null) {
|
|
|
- trialHistoryDao.deleteByLibraryId(library.getId());
|
|
|
+ trialLibraryDao.resetById(library.getId());
|
|
|
trialTrackDao.deleteByLibraryId(library.getId());
|
|
|
trialTagDao.deleteByLibraryId(library.getId());
|
|
|
return true;
|
|
@@ -823,34 +841,65 @@ public class MarkServiceImpl implements MarkService {
|
|
|
|
|
|
private void scoreCalculate(Integer studentId) {
|
|
|
List<ScoreItem> scoreList = new ArrayList<>();
|
|
|
- Map<Integer, List<SubjectiveScore>> map = new HashMap<Integer, List<SubjectiveScore>>();
|
|
|
- double totalScore = 0.0;
|
|
|
+ Map<Integer, List<SubjectiveScore>> mainScoreMap = new HashMap<Integer, List<SubjectiveScore>>();
|
|
|
+ Map<Integer, Double> scoreMap = new HashMap<Integer, Double>();
|
|
|
+
|
|
|
// 循环所有主观得分明细
|
|
|
List<SubjectiveScore> list = scoreDao.findByStudentId(studentId);
|
|
|
+ list.sort(null);
|
|
|
for (SubjectiveScore ss : list) {
|
|
|
- totalScore = BigDecimalUtils.add(totalScore, ss.getScore());
|
|
|
- scoreList.add(new ScoreItem(ss));
|
|
|
- List<SubjectiveScore> mainScoreList = map.get(ss.getMainNumber());
|
|
|
+ List<SubjectiveScore> mainScoreList = mainScoreMap.get(ss.getMainNumber());
|
|
|
if (mainScoreList == null) {
|
|
|
mainScoreList = new ArrayList<SubjectiveScore>();
|
|
|
}
|
|
|
mainScoreList.add(ss);
|
|
|
- map.put(ss.getMainNumber(), mainScoreList);
|
|
|
+ mainScoreMap.put(ss.getMainNumber(), mainScoreList);
|
|
|
+ scoreList.add(new ScoreItem(ss));
|
|
|
}
|
|
|
// 计算大题分
|
|
|
- for (Integer mainNumber : map.keySet()) {
|
|
|
- List<SubjectiveScore> mainScoreList = map.get(mainNumber);
|
|
|
- double mainScore = 0.0;
|
|
|
+ for (Integer mainNumber : mainScoreMap.keySet()) {
|
|
|
+ List<SubjectiveScore> mainScoreList = mainScoreMap.get(mainNumber);
|
|
|
+ BigDecimal mainScore = BigDecimal.ZERO;
|
|
|
for (SubjectiveScore subjectiveScore : mainScoreList) {
|
|
|
- mainScore = BigDecimalUtils.add(mainScore, subjectiveScore.getScore());
|
|
|
+ if (subjectiveScore.getScore() != UN_SELECTIVE_SCORE) {
|
|
|
+ mainScore = mainScore.add(BigDecimal.valueOf(subjectiveScore.getScore()));
|
|
|
+ }
|
|
|
}
|
|
|
for (SubjectiveScore subjectiveScore : mainScoreList) {
|
|
|
- subjectiveScore.setMainScore(mainScore);
|
|
|
+ subjectiveScore.setMainScore(mainScore.doubleValue());
|
|
|
scoreDao.saveAndFlush(subjectiveScore);
|
|
|
}
|
|
|
+ scoreMap.put(mainNumber, mainScore.doubleValue());
|
|
|
+ }
|
|
|
+ // 计算选做题分数
|
|
|
+ ExamStudent student = studentService.findById(studentId);
|
|
|
+ List<SelectiveGroup> selectiveGroups = selectiveGroupService
|
|
|
+ .findByExamIdAndSubjectCode(student.getExamId(), student.getSubjectCode());
|
|
|
+
|
|
|
+ List<Double> selectiveList = new ArrayList<Double>();
|
|
|
+ Integer selectiveCount = 0;
|
|
|
+ for (SelectiveGroup selectiveGroup : selectiveGroups) {
|
|
|
+ double mainScore = scoreMap.get(selectiveGroup.getMainNumber());
|
|
|
+ scoreMap.remove(selectiveGroup.getMainNumber());
|
|
|
+ selectiveList.add(mainScore);
|
|
|
+ if (selectiveCount == 0) {
|
|
|
+ selectiveCount = selectiveGroup.getSelectiveCount();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Collections.sort(selectiveList);
|
|
|
+ Collections.reverse(selectiveList);
|
|
|
+ // 计算总分
|
|
|
+ BigDecimal totalScore = BigDecimal.ZERO;
|
|
|
+ for (Integer mainNumber : scoreMap.keySet()) {
|
|
|
+ totalScore = totalScore.add(BigDecimal.valueOf(scoreMap.get(mainNumber)));
|
|
|
+ }
|
|
|
+ for (int i = 0; i < selectiveList.size(); i++) {
|
|
|
+ if (i < selectiveCount && selectiveList.get(i) != UN_SELECTIVE_SCORE) {
|
|
|
+ totalScore = totalScore.add(BigDecimal.valueOf(selectiveList.get(i)));
|
|
|
+ }
|
|
|
}
|
|
|
// 全部评完,更新考生主观题得分
|
|
|
- studentService.updateSubjectiveStatusAndScore(studentId, SubjectiveStatus.MARKED, totalScore,
|
|
|
+ studentService.updateSubjectiveStatusAndScore(studentId, SubjectiveStatus.MARKED, totalScore.doubleValue(),
|
|
|
ExamStudent.buildScoreList(scoreList));
|
|
|
}
|
|
|
|
|
@@ -864,12 +913,23 @@ public class MarkServiceImpl implements MarkService {
|
|
|
if (list.isEmpty()) {
|
|
|
return false;
|
|
|
}
|
|
|
+ boolean selectiveAll = false;
|
|
|
for (MarkLibrary library : list) {
|
|
|
if (library.getStatus() != LibraryStatus.MARKED && library.getStatus() != LibraryStatus.ARBITRATED
|
|
|
&& library.getStatus() != LibraryStatus.INSPECTED) {
|
|
|
// 有非完成状态的评卷任务,直接返回
|
|
|
return false;
|
|
|
}
|
|
|
+ double markerScore = library.getStatus() == LibraryStatus.ARBITRATED ?
|
|
|
+ library.getHeaderScore() :
|
|
|
+ library.getMarkerScore();
|
|
|
+ if (markerScore == UN_SELECTIVE_SCORE) {
|
|
|
+ selectiveAll = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (selectiveAll) {
|
|
|
+ group.setMarkScore(UN_SELECTIVE_SCORE);
|
|
|
+ return true;
|
|
|
}
|
|
|
// 开启三评
|
|
|
if (ThirdPolicy.LOW_DIFF_HIGH_AVG.equals(group.getThirdPolicy()) && list.size() == 3) {
|
|
@@ -897,7 +957,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
}
|
|
|
for (MarkLibrary library : list) {
|
|
|
count++;
|
|
|
- Double current = (library.getHeaderScore() != null ? library.getHeaderScore() : library.getMarkerScore());
|
|
|
+ Double current = library.getHeaderScore() != null ? library.getHeaderScore() : library.getMarkerScore();
|
|
|
List<ScoreItem> scores = library.getScoreList();
|
|
|
if (count == 1) {
|
|
|
// 首份评卷任务,直接取总分与明细
|
|
@@ -907,7 +967,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
switch (policy) {
|
|
|
case AVG:
|
|
|
// 直接累加
|
|
|
- score += current;
|
|
|
+ score = BigDecimalUtils.add(score, current);
|
|
|
for (int i = 0; i < detail.size(); i++) {
|
|
|
try {
|
|
|
ScoreItem item = detail.get(i);
|
|
@@ -1131,8 +1191,6 @@ public class MarkServiceImpl implements MarkService {
|
|
|
trialTrackDao.deleteByExamIdAndSubjectCodeAndGroupNumber(group.getExamId(), group.getSubjectCode(),
|
|
|
group.getNumber());
|
|
|
trialTagDao.deleteByExamAndSubjectAndGroup(group.getExamId(), group.getSubjectCode(), group.getNumber());
|
|
|
- trialHistoryDao.deleteByExamIdAndSubjectCodeAndGroupNumber(group.getExamId(), group.getSubjectCode(),
|
|
|
- group.getNumber());
|
|
|
}
|
|
|
updateLibraryCount(group);
|
|
|
groupDao.resetCount(group.getExamId(), group.getSubjectCode(), group.getNumber());
|
|
@@ -1178,11 +1236,6 @@ public class MarkServiceImpl implements MarkService {
|
|
|
markerLastUpdateTime.put(marker.getId(), System.currentTimeMillis());
|
|
|
}
|
|
|
|
|
|
- private double sumTotalScore(Integer examId, String subjectCode) {
|
|
|
- Double score = groupDao.sumTotalScore(examId, subjectCode);
|
|
|
- return score != null ? score : 0d;
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public boolean needUpdateQuality(Marker marker, long expireMinutes) {
|
|
|
if (marker == null) {
|
|
@@ -1220,6 +1273,25 @@ public class MarkServiceImpl implements MarkService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 考生分组判断是否评卷完成,以及后续的统一处理动作
|
|
|
+ *
|
|
|
+ * @param library
|
|
|
+ * @param group
|
|
|
+ */
|
|
|
+ private void checkStudentTrial(TrialLibrary library, MarkGroup group) {
|
|
|
+ updateStudentGroupStatus(library.getStudentId(), group.getExamId(), group.getSubjectCode(), group.getNumber(),
|
|
|
+ SubjectiveStatus.MARKED);
|
|
|
+ updateStudentGroupScore(library.getStudentId(), group.getExamId(), group.getSubjectCode(), group.getNumber(),
|
|
|
+ library.getMarkerScore(), library.getScoreList());
|
|
|
+ // 未分组的题目
|
|
|
+ long unGroupQuestionCount = questionService
|
|
|
+ .countByExamIdAndSubjectAndObjectiveAndGroupNumberIsNull(group.getExamId(), group.getSubjectCode(),
|
|
|
+ false);
|
|
|
+ long groupCount = groupDao.countByExamIdAndSubjectCode(group.getExamId(), group.getSubjectCode());
|
|
|
+ checkStudentSubjective(library.getStudentId(), groupCount, unGroupQuestionCount);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 考生分组判断是否评卷完成,以及后续的统一处理动作
|
|
|
*
|
|
@@ -1233,7 +1305,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
updateStudentGroupScore(studentId, group.getExamId(), group.getSubjectCode(), group.getNumber(),
|
|
|
group.getMarkScore(), group.getMarkScoreDetail());
|
|
|
// 未分组的题目
|
|
|
- long unGroupQuestionCount = questionDao
|
|
|
+ long unGroupQuestionCount = questionService
|
|
|
.countByExamIdAndSubjectAndObjectiveAndGroupNumberIsNull(group.getExamId(), group.getSubjectCode(),
|
|
|
false);
|
|
|
long groupCount = groupDao.countByExamIdAndSubjectCode(group.getExamId(), group.getSubjectCode());
|
|
@@ -1289,10 +1361,9 @@ public class MarkServiceImpl implements MarkService {
|
|
|
private void updateStudentGroupScore(Integer studentId, Integer examId, String subjectCode, Integer groupNumber,
|
|
|
double score, List<ScoreItem> scoreList) {
|
|
|
// scoreDao.deleteByStudentIdAndGroupNumber(studentId, groupNumber);
|
|
|
- List<ExamQuestion> questions = questionDao
|
|
|
- .findByExamIdAndSubjectCodeAndObjectiveAndGroupNumber(examId, subjectCode, false, groupNumber);
|
|
|
- for (int i = 0; i < scoreList.size(); i++) {
|
|
|
- ScoreItem item = scoreList.get(i);
|
|
|
+ List<ExamQuestion> questions = questionService
|
|
|
+ .findByExamAndSubjectAndObjectiveAndGroupNumber(examId, subjectCode, false, groupNumber);
|
|
|
+ for (int i = 0; i < questions.size(); i++) {
|
|
|
ExamQuestion question = questions.get(i);
|
|
|
SubjectiveScore ss = new SubjectiveScore();
|
|
|
ss.setStudentId(studentId);
|
|
@@ -1300,10 +1371,16 @@ public class MarkServiceImpl implements MarkService {
|
|
|
ss.setSubjectCode(subjectCode);
|
|
|
ss.setGroupNumber(groupNumber);
|
|
|
ss.setGroupScore(score);
|
|
|
- ss.setMainScore(0.0);
|
|
|
ss.setMainNumber(question.getMainNumber());
|
|
|
ss.setSubNumber(question.getSubNumber());
|
|
|
- ss.setScore(item.getScore());
|
|
|
+ if (score != UN_SELECTIVE_SCORE) {
|
|
|
+ ScoreItem item = scoreList.get(i);
|
|
|
+ ss.setScore(item.getScore());
|
|
|
+ ss.setMainScore(0.0);
|
|
|
+ } else {
|
|
|
+ ss.setScore(score);
|
|
|
+ ss.setMainScore(score);
|
|
|
+ }
|
|
|
scoreDao.saveAndFlush(ss);
|
|
|
}
|
|
|
}
|
|
@@ -1358,14 +1435,14 @@ public class MarkServiceImpl implements MarkService {
|
|
|
}
|
|
|
for (Integer groupNumber : map.keySet()) {
|
|
|
MarkGroup group = groupDao.findOne(student.getExamId(), student.getSubjectCode(), groupNumber);
|
|
|
- if (group.getStatus() == MarkStatus.FINISH) {
|
|
|
+ if (group.getStatus() == MarkStatus.FINISH || group.getStatus() == MarkStatus.TRIAL) {
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
for (Integer groupNumber : map.keySet()) {
|
|
|
List<MarkLibrary> list = libraryDao.findByStudentIdAndGroupNumber(student.getId(), groupNumber);
|
|
|
- List<ExamQuestion> questions = questionDao
|
|
|
- .findByExamIdAndSubjectCodeAndObjectiveAndGroupNumber(student.getExamId(), student.getSubjectCode(),
|
|
|
+ List<ExamQuestion> questions = questionService
|
|
|
+ .findByExamAndSubjectAndObjectiveAndGroupNumber(student.getExamId(), student.getSubjectCode(),
|
|
|
false, groupNumber);
|
|
|
List<MarkStepDTO> qList = map.get(groupNumber);
|
|
|
MarkGroup group = groupDao.findOne(student.getExamId(), student.getSubjectCode(), groupNumber);
|
|
@@ -1381,14 +1458,16 @@ public class MarkServiceImpl implements MarkService {
|
|
|
}
|
|
|
if (library.getStatus().equals(LibraryStatus.ARBITRATED) || qList.size() == questions.size()) {
|
|
|
// 仲裁任务直接重置 或者该分组下所有分数被打回也重置
|
|
|
- libraryDao.resetById(library.getId(), library.getMarkerId(), LibraryStatus.REJECTED,
|
|
|
- LibraryStatus.MARKED, LibraryStatus.PROBLEM, LibraryStatus.INSPECTED);
|
|
|
+ libraryDao.resetById(library.getId(), null, LibraryStatus.REJECTED, LibraryStatus.MARKED,
|
|
|
+ LibraryStatus.PROBLEM, LibraryStatus.INSPECTED, LibraryStatus.ARBITRATED);
|
|
|
trackDao.deleteByLibraryId(library.getId());
|
|
|
specialTagDao.deleteByLibraryId(library.getId());
|
|
|
+ arbitrateDao.deleteByStudentIdAndGroupNumber(student.getId(), groupNumber);
|
|
|
count++;
|
|
|
continue;
|
|
|
}
|
|
|
- if (library.getStatus().equals(LibraryStatus.MARKED)) {
|
|
|
+ if (library.getStatus().equals(LibraryStatus.MARKED) || library.getStatus()
|
|
|
+ .equals(LibraryStatus.INSPECTED)) {
|
|
|
List<ScoreItem> sList = library.getScoreList();
|
|
|
for (MarkStepDTO markStepDTO : qList) {
|
|
|
trackDao.deleteByLibraryIdAndQuestionNumber(library.getId(),
|
|
@@ -1407,6 +1486,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
ScoreItem scoreItem = sList.get(i);
|
|
|
if (scoreItem.getScore() != null) {
|
|
|
markerScoreList.append(scoreItem.getScore());
|
|
|
+ } else {
|
|
|
+ markerScoreList.append("#");
|
|
|
}
|
|
|
if (i < sList.size() - 1) {
|
|
|
markerScoreList.append(",");
|
|
@@ -1414,7 +1495,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
}
|
|
|
if (libraryDao
|
|
|
.updateMarkerResult(library.getId(), LibraryStatus.REJECTED, library.getMarkerId(), null,
|
|
|
- markerScoreList.toString(), null, null, LibraryStatus.MARKED) == 1) {
|
|
|
+ markerScoreList.toString(), null, null, LibraryStatus.MARKED,
|
|
|
+ LibraryStatus.INSPECTED) == 1) {
|
|
|
count++;
|
|
|
}
|
|
|
}
|
|
@@ -1433,18 +1515,27 @@ public class MarkServiceImpl implements MarkService {
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public boolean deleteByQuestion(ExamQuestion question) {
|
|
|
+ SelectiveGroup selectiveGroup = selectiveGroupService
|
|
|
+ .findOne(question.getExamId(), question.getSubjectCode(), question.getMainNumber());
|
|
|
+ if (selectiveGroup != null) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
if (!question.isObjective() && question.getGroupNumber() != null) {
|
|
|
return false;
|
|
|
} else {
|
|
|
int examId = question.getExamId();
|
|
|
String subjectCode = question.getSubjectCode();
|
|
|
boolean objective = question.isObjective();
|
|
|
- questionDao.delete(question);
|
|
|
+ ExamSubject subject = subjectService.find(examId, subjectCode);
|
|
|
+ double totalScore = objective ?
|
|
|
+ BigDecimalUtils.sub(subject.getObjectiveScore(), question.getTotalScore()) :
|
|
|
+ BigDecimalUtils.sub(subject.getSubjectiveScore(), question.getTotalScore());
|
|
|
+ questionService.deleteById(question.getId());
|
|
|
if (objective) {
|
|
|
examService.updateObjectiveStatus(examId, ObjectiveStatus.WAITING);
|
|
|
} else {
|
|
|
// 未分组的题目
|
|
|
- long unGroupQuestionCount = questionDao
|
|
|
+ long unGroupQuestionCount = questionService
|
|
|
.countByExamIdAndSubjectAndObjectiveAndGroupNumberIsNull(examId, subjectCode, false);
|
|
|
// 考生整体状态与总分更新
|
|
|
long groupCount = groupDao.countByExamIdAndSubjectCode(examId, subjectCode);
|
|
@@ -1461,10 +1552,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- subjectService.updateScore(examId, subjectCode, objective,
|
|
|
- questionService.sumTotalScore(examId, subjectCode, objective));
|
|
|
-
|
|
|
+ subjectService.updateScore(examId, subjectCode, objective, totalScore);
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
@@ -1472,13 +1560,16 @@ public class MarkServiceImpl implements MarkService {
|
|
|
@Override
|
|
|
@Transactional
|
|
|
public boolean rejectLibrary(MarkLibrary library, MarkStepDTO[] questionList, Integer userId) {
|
|
|
+ List<ExamQuestion> questions = questionService
|
|
|
+ .findByExamAndSubjectAndObjectiveAndGroupNumber(library.getExamId(), library.getSubjectCode(), false,
|
|
|
+ library.getGroupNumber());
|
|
|
+ if (questionList.length == questions.size()) {
|
|
|
+ return rejectLibrary(library, userId, false);
|
|
|
+ }
|
|
|
MarkGroup group = groupDao.findOne(library.getExamId(), library.getSubjectCode(), library.getGroupNumber());
|
|
|
if (group.getStatus() == MarkStatus.FINISH) {
|
|
|
return false;
|
|
|
}
|
|
|
- List<ExamQuestion> questions = questionDao
|
|
|
- .findByExamIdAndSubjectCodeAndObjectiveAndGroupNumber(library.getExamId(), library.getSubjectCode(),
|
|
|
- false, library.getGroupNumber());
|
|
|
List<ScoreItem> sList = library.getScoreList();
|
|
|
for (MarkStepDTO markStepDTO : questionList) {
|
|
|
trackDao.deleteByLibraryIdAndQuestionNumber(library.getId(),
|
|
@@ -1497,13 +1588,15 @@ public class MarkServiceImpl implements MarkService {
|
|
|
ScoreItem scoreItem = sList.get(i);
|
|
|
if (scoreItem.getScore() != null) {
|
|
|
markerScoreList.append(scoreItem.getScore());
|
|
|
+ } else {
|
|
|
+ markerScoreList.append("#");
|
|
|
}
|
|
|
if (i < sList.size() - 1) {
|
|
|
markerScoreList.append(",");
|
|
|
}
|
|
|
}
|
|
|
if (libraryDao.updateMarkerResult(library.getId(), LibraryStatus.REJECTED, library.getMarkerId(), null,
|
|
|
- markerScoreList.toString(), null, null, LibraryStatus.MARKED) == 1) {
|
|
|
+ markerScoreList.toString(), null, null, LibraryStatus.MARKED, LibraryStatus.INSPECTED) == 1) {
|
|
|
resetStudentGroup(library.getStudentId(), library.getExamId(), library.getSubjectCode(),
|
|
|
library.getGroupNumber());
|
|
|
problemHistoryDao
|