|
@@ -380,8 +380,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
public boolean applyLibrary(TrialLibrary library, Marker marker) {
|
|
|
TaskLock taskLock = TaskLockUtil.getTrialTask(getGroupKey(marker));
|
|
|
if (TrialMode.EXCLUSIVE.equals(systemCache.getTrialMode())) {
|
|
|
- return taskLock.add(library.getStudentId(),marker.getId() , marker.getId());
|
|
|
- }else {
|
|
|
+ return taskLock.add(library.getStudentId(), marker.getId(), marker.getId());
|
|
|
+ } else {
|
|
|
return taskLock.add(library.getStudentId(), 1, marker.getId());
|
|
|
}
|
|
|
}
|
|
@@ -415,7 +415,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
TaskLock taskLock = TaskLockUtil.getTrialTask(getGroupKey(marker));
|
|
|
if (TrialMode.EXCLUSIVE.equals(systemCache.getTrialMode())) {
|
|
|
return library.getMarkerId().equals(marker.getId());
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return taskLock.exist(library.getStudentId(), 1, marker.getId());
|
|
|
}
|
|
|
}
|
|
@@ -458,19 +458,18 @@ public class MarkServiceImpl implements MarkService {
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public boolean resetLibrary(TrialLibrary library) {
|
|
|
- if(library==null){
|
|
|
+ if (library == null) {
|
|
|
return false;
|
|
|
}
|
|
|
trialTagDao.deleteByLibraryId(library.getId());
|
|
|
trialTrackDao.deleteByLibraryId(library.getId());
|
|
|
if (TrialMode.EXCLUSIVE.equals(systemCache.getTrialMode())) {
|
|
|
trialLibraryDao.resetByIdButMarkerId(library.getId());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
trialLibraryDao.resetById(library.getId());
|
|
|
updateStudentGroupStatus(library.getStudentId(), library.getExamId(), library.getSubjectCode(),
|
|
|
library.getGroupNumber(), SubjectiveStatus.UNMARK);
|
|
|
- studentService.updateSubjectiveStatusAndScore(library.getStudentId(), SubjectiveStatus.UNMARK, 0,
|
|
|
- null);
|
|
|
+ studentService.updateSubjectiveStatusAndScore(library.getStudentId(), SubjectiveStatus.UNMARK, 0, null);
|
|
|
selectiveStudentDao.deleteByStudentId(library.getStudentId());
|
|
|
inspectedService.clearByStudent(library.getStudentId());
|
|
|
}
|
|
@@ -491,12 +490,10 @@ public class MarkServiceImpl implements MarkService {
|
|
|
public void resetLibrary(MarkLibrary library) {
|
|
|
trackDao.deleteByLibraryId(library.getId());
|
|
|
specialTagDao.deleteByLibraryId(library.getId());
|
|
|
- libraryDao.resetById(library.getId(), null, null, null, null, LibraryStatus.WAITING,
|
|
|
- library.getStatus());
|
|
|
+ libraryDao.resetById(library.getId(), null, null, null, null, LibraryStatus.WAITING, library.getStatus());
|
|
|
updateStudentGroupStatus(library.getStudentId(), library.getExamId(), library.getSubjectCode(),
|
|
|
library.getGroupNumber(), SubjectiveStatus.UNMARK);
|
|
|
- studentService.updateSubjectiveStatusAndScore(library.getStudentId(), SubjectiveStatus.UNMARK, 0,
|
|
|
- null);
|
|
|
+ studentService.updateSubjectiveStatusAndScore(library.getStudentId(), SubjectiveStatus.UNMARK, 0, null);
|
|
|
selectiveStudentDao.deleteByStudentId(library.getStudentId());
|
|
|
inspectedService.clearByStudent(library.getStudentId());
|
|
|
}
|
|
@@ -582,7 +579,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
trackDao.deleteByLibraryId(library.getId());
|
|
|
specialTagDao.deleteByLibraryId(library.getId());
|
|
|
return SubmitResult.success(library);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return SubmitResult.faile();
|
|
|
}
|
|
|
}
|
|
@@ -818,7 +815,16 @@ public class MarkServiceImpl implements MarkService {
|
|
|
List<ScoreItem> scoreItemList2 = list.get(2).getMarkerScoreItem();
|
|
|
for (int j = 0; j < questionList.size(); j++) {
|
|
|
Double arbitrateThreshold = questionList.get(j).getArbitrateThreshold();
|
|
|
- if (Math.abs(scoreItemList.get(j).getScore() - scoreItemList1.get(j).getScore()) > arbitrateThreshold
|
|
|
+ if (scoreItemList.get(j).getScore() == UN_SELECTIVE_SCORE
|
|
|
+ && scoreItemList1.get(j).getScore() == UN_SELECTIVE_SCORE
|
|
|
+ && scoreItemList2.get(j).getScore() == UN_SELECTIVE_SCORE) {
|
|
|
+ continue;
|
|
|
+ } else if (scoreItemList.get(j).getScore() == UN_SELECTIVE_SCORE
|
|
|
+ || scoreItemList1.get(j).getScore() == UN_SELECTIVE_SCORE
|
|
|
+ || scoreItemList2.get(j).getScore() == UN_SELECTIVE_SCORE) {
|
|
|
+ arbitrateIndex.add(j + 1);
|
|
|
+ } else if (Math
|
|
|
+ .abs(scoreItemList.get(j).getScore() - scoreItemList1.get(j).getScore()) > arbitrateThreshold
|
|
|
&& Math.abs(scoreItemList1.get(j).getScore()
|
|
|
- scoreItemList2.get(j).getScore()) > arbitrateThreshold
|
|
|
&& Math.abs(scoreItemList2.get(j).getScore()
|
|
@@ -1112,11 +1118,13 @@ public class MarkServiceImpl implements MarkService {
|
|
|
Collections.sort(partScoreList);
|
|
|
if (policy == null || ScorePolicy.MAX.equals(policy)) {
|
|
|
Collections.reverse(partScoreList);
|
|
|
- } if (ScorePolicy.MIN_WITHOUT_ZERO.equals(policy)) {
|
|
|
- while(partScoreList.size()>selectiveCount && partScoreList.get(0)==0){
|
|
|
+ }
|
|
|
+ if (ScorePolicy.MIN_WITHOUT_ZERO.equals(policy)) {
|
|
|
+ while (partScoreList.size() > selectiveCount && partScoreList.get(0) == 0) {
|
|
|
partScoreList.remove(0);
|
|
|
}
|
|
|
-// partScoreList = partScoreList.stream().filter(s -> s.doubleValue() > 0).collect(Collectors.toList());
|
|
|
+ // partScoreList = partScoreList.stream().filter(s -> s.doubleValue() >
|
|
|
+ // 0).collect(Collectors.toList());
|
|
|
}
|
|
|
// 计算一个选做题分组得分
|
|
|
for (int i = 0; i < partScoreList.size(); i++) {
|
|
@@ -1160,20 +1168,13 @@ public class MarkServiceImpl implements MarkService {
|
|
|
}
|
|
|
}
|
|
|
// 更新考生多选做少选做
|
|
|
- SelectiveStudent selectiveStudent = selectiveStudentDao.findOne(studentId);
|
|
|
- if(selectiveStudent == null){
|
|
|
- selectiveStudent = new SelectiveStudent();
|
|
|
- selectiveStudent.setExamId(examId);
|
|
|
- selectiveStudent.setSubjectCode(subjectCode);
|
|
|
- selectiveStudent.setStudentId(studentId);
|
|
|
- selectiveStudent.setLessSelective(lessSelective);
|
|
|
- selectiveStudent.setMutiSelective(mutiSelective);
|
|
|
- selectiveStudent.setNotSelective(notSelective);
|
|
|
- }else{
|
|
|
- selectiveStudent.setLessSelective(selectiveStudent.getLessSelective()?selectiveStudent.getLessSelective():lessSelective);
|
|
|
- selectiveStudent.setMutiSelective(selectiveStudent.getMutiSelective()?selectiveStudent.getMutiSelective():mutiSelective);
|
|
|
- selectiveStudent.setNotSelective(selectiveStudent.getNotSelective()?selectiveStudent.getNotSelective():notSelective);
|
|
|
- }
|
|
|
+ SelectiveStudent selectiveStudent = new SelectiveStudent();
|
|
|
+ selectiveStudent.setExamId(examId);
|
|
|
+ selectiveStudent.setSubjectCode(subjectCode);
|
|
|
+ selectiveStudent.setStudentId(studentId);
|
|
|
+ selectiveStudent.setLessSelective(lessSelective);
|
|
|
+ selectiveStudent.setMutiSelective(mutiSelective);
|
|
|
+ selectiveStudent.setNotSelective(notSelective);
|
|
|
selectiveStudentDao.saveAndFlush(selectiveStudent);
|
|
|
// 计算非选做题总分
|
|
|
for (Integer mainNumber : scoreMap.keySet()) {
|
|
@@ -1451,9 +1452,9 @@ public class MarkServiceImpl implements MarkService {
|
|
|
group.getNumber());
|
|
|
trialTagDao.deleteByExamAndSubjectAndGroup(group.getExamId(), group.getSubjectCode(), group.getNumber());
|
|
|
if (TrialMode.EXCLUSIVE.equals(systemCache.getTrialMode())) {
|
|
|
- trialLibraryDao.resetByExamIdAndSubjectCodeAndGroupNumberButMarkerId(group.getExamId(), group.getSubjectCode(),
|
|
|
- group.getNumber());
|
|
|
- }else{
|
|
|
+ trialLibraryDao.resetByExamIdAndSubjectCodeAndGroupNumberButMarkerId(group.getExamId(),
|
|
|
+ group.getSubjectCode(), group.getNumber());
|
|
|
+ } else {
|
|
|
trialLibraryDao.resetByExamIdAndSubjectCodeAndGroupNumber(group.getExamId(), group.getSubjectCode(),
|
|
|
group.getNumber());
|
|
|
}
|
|
@@ -1480,8 +1481,9 @@ public class MarkServiceImpl implements MarkService {
|
|
|
updateQualityNoArbitrate(marker, list);
|
|
|
markerLastUpdateTime.put(marker.getId(), System.currentTimeMillis());
|
|
|
}
|
|
|
- private void updateQualityWithArbitrate(Marker marker,List<MarkLibrary> list) {
|
|
|
- int finishCount = 0;
|
|
|
+
|
|
|
+ private void updateQualityWithArbitrate(Marker marker, List<MarkLibrary> list) {
|
|
|
+ int finishCount = 0;
|
|
|
int validCount = 0;
|
|
|
double sumScore = 0;
|
|
|
double sumScore2 = 0;
|
|
@@ -1511,9 +1513,9 @@ public class MarkServiceImpl implements MarkService {
|
|
|
}
|
|
|
markerDao.updateQualityById(marker.getId(), finishCount, validCount, avgSpent / 1000, avgScore, stdevScore);
|
|
|
}
|
|
|
-
|
|
|
- private void updateQualityNoArbitrate(Marker marker,List<MarkLibrary> list) {
|
|
|
- int finishCount = 0;
|
|
|
+
|
|
|
+ private void updateQualityNoArbitrate(Marker marker, List<MarkLibrary> list) {
|
|
|
+ int finishCount = 0;
|
|
|
int validCount = 0;
|
|
|
double sumScore = 0;
|
|
|
double sumScore2 = 0;
|
|
@@ -1522,9 +1524,10 @@ public class MarkServiceImpl implements MarkService {
|
|
|
double sumSpent = 0;
|
|
|
double avgSpent = 0;
|
|
|
for (MarkLibrary library : list) {
|
|
|
- if (library.getStatus() == LibraryStatus.ARBITRATED || library.getStatus() == LibraryStatus.WAIT_ARBITRATE) {
|
|
|
- continue;
|
|
|
- }
|
|
|
+ if (library.getStatus() == LibraryStatus.ARBITRATED
|
|
|
+ || library.getStatus() == LibraryStatus.WAIT_ARBITRATE) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
finishCount++;
|
|
|
if (library.getStatus() == LibraryStatus.MARKED || library.getStatus() == LibraryStatus.INSPECTED) {
|
|
|
validCount++;
|
|
@@ -1544,7 +1547,8 @@ public class MarkServiceImpl implements MarkService {
|
|
|
stdevScore = Math.sqrt(sumScore2 / finishCount - Math.pow(sumScore / finishCount, 2));
|
|
|
}
|
|
|
}
|
|
|
- markerDao.updateQualityNoArbitrateById(marker.getId(), finishCount, validCount, avgSpent / 1000, avgScore, stdevScore);
|
|
|
+ markerDao.updateQualityNoArbitrateById(marker.getId(), finishCount, validCount, avgSpent / 1000, avgScore,
|
|
|
+ stdevScore);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -1907,7 +1911,7 @@ public class MarkServiceImpl implements MarkService {
|
|
|
long groupCount = groupDao.countByExamIdAndSubjectCode(examId, subjectCode);
|
|
|
if (groupCount == 0 || unGroupQuestionCount > 0) {
|
|
|
studentService.updateSubjectiveStatusAndScore(examId, subjectCode, SubjectiveStatus.UNMARK, 0, null);
|
|
|
- selectiveStudentDao.deleteByExamIdAndSubjectCode(examId,subjectCode);
|
|
|
+ selectiveStudentDao.deleteByExamIdAndSubjectCode(examId, subjectCode);
|
|
|
inspectHistoryService.deleteByExamIdAndSubjectCode(examId, subjectCode);
|
|
|
} else {
|
|
|
List<Integer> studentList = studentService.findIdByExamIdAndSubjectCodeAndSubjectiveStatus(examId,
|