|
@@ -11,6 +11,10 @@ import java.util.Map;
|
|
|
import java.util.Map.Entry;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.ExamRecordDataRepo;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordDataEntity;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordQuestionsService;
|
|
|
+import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -46,19 +50,26 @@ public class ExamRecordForMarkingServiceImpl implements ExamRecordForMarkingServ
|
|
|
@Autowired
|
|
|
private ExamCloudService examCloudService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ExamRecordDataRepo examRecordDataRepo;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ExamRecordQuestionsService examRecordQuestionsService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private JdbcTemplate jdbcTemplate;
|
|
|
@Value("${$upyun.site.1.bucketName}")
|
|
|
private String bucketName;
|
|
|
-
|
|
|
+
|
|
|
@Value("${$upyun.site.1.userName}")
|
|
|
private String userName;
|
|
|
-
|
|
|
+
|
|
|
@Value("${$upyun.site.1.password}")
|
|
|
private String password;
|
|
|
|
|
|
@Value("${$upyun.site.1.domain}")
|
|
|
private String upyunFileUrl;
|
|
|
+
|
|
|
@Override
|
|
|
public List<ExamRecordForMarkingEntity> queryValidExamRecordInfoByStuIds(
|
|
|
Long examId, Long courseId, List<Long> examStudentIds, String batchNum) {
|
|
@@ -160,6 +171,7 @@ public class ExamRecordForMarkingServiceImpl implements ExamRecordForMarkingServ
|
|
|
|
|
|
/**
|
|
|
* 客观分最高
|
|
|
+ *
|
|
|
* @param examRecordForMarkingAllList
|
|
|
* @return
|
|
|
*/
|
|
@@ -251,16 +263,16 @@ public class ExamRecordForMarkingServiceImpl implements ExamRecordForMarkingServ
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void saveOffLineExamRecordForMarking(ExamRecordDataBean examRecordData,String offlineFileName,String fileUrl) {
|
|
|
+ public void saveOffLineExamRecordForMarking(ExamRecordDataBean examRecordData, String offlineFileName, String fileUrl) {
|
|
|
ExamRecordForMarkingEntity examRecordForMarking = examRecordForMarkingRepo.findByExamRecordDataId(examRecordData.getId());
|
|
|
- if(examRecordForMarking == null){
|
|
|
+ if (examRecordForMarking == null) {
|
|
|
examRecordForMarking = new ExamRecordForMarkingEntity();
|
|
|
examRecordForMarking.setCreationTime(new Date());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
//将原文件删掉
|
|
|
- UpYun upyun = new UpYun(bucketName,userName,password);
|
|
|
+ UpYun upyun = new UpYun(bucketName, userName, password);
|
|
|
String offlineFileUrl = examRecordForMarking.getOfflineFileUrl();
|
|
|
- offlineFileUrl = offlineFileUrl.replace(upyunFileUrl,"");
|
|
|
+ offlineFileUrl = offlineFileUrl.replace(upyunFileUrl, "");
|
|
|
upyun.deleteFile(offlineFileUrl);
|
|
|
}
|
|
|
|
|
@@ -277,4 +289,46 @@ public class ExamRecordForMarkingServiceImpl implements ExamRecordForMarkingServ
|
|
|
examRecordForMarking.setUpdateTime(new Date());
|
|
|
examRecordForMarkingRepo.save(examRecordForMarking);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 在线考试-保存阅卷相关数据-对内
|
|
|
+ *
|
|
|
+ * @param examRecordDataId
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void saveExamRecordForMarking(Long examRecordDataId) {
|
|
|
+ ExamRecordDataEntity examRecordData =
|
|
|
+ GlobalHelper.getEntity(examRecordDataRepo, examRecordDataId, ExamRecordDataEntity.class);
|
|
|
+ //全客观题卷
|
|
|
+ if (examRecordData.getIsAllObjectivePaper()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //违纪
|
|
|
+ if (examRecordData.getIsIllegality()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //有警告未审核
|
|
|
+ if (examRecordData.getIsWarn() && !examRecordData.getIsAudit()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //已经存在
|
|
|
+ ExamRecordForMarkingEntity examRecordForMarkingExists = examRecordForMarkingRepo.findByExamRecordDataId(examRecordData.getId());
|
|
|
+ if (examRecordForMarkingExists != null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ ExamRecordForMarkingEntity examRecordForMarking = new ExamRecordForMarkingEntity();
|
|
|
+ examRecordForMarking.setExamId(examRecordData.getExamId());
|
|
|
+ examRecordForMarking.setExamRecordDataId(examRecordData.getId());
|
|
|
+ examRecordForMarking.setExamStudentId(examRecordData.getExamStudentId());
|
|
|
+ examRecordForMarking.setBasePaperId(examRecordData.getBasePaperId());
|
|
|
+ examRecordForMarking.setPaperType(examRecordData.getPaperType());
|
|
|
+ examRecordForMarking.setCourseId(examRecordData.getCourseId());
|
|
|
+ examRecordForMarking.setObjectiveScore(examRecordData.getObjectiveScore());
|
|
|
+
|
|
|
+ int subjectiveAnswerLength = examRecordQuestionsService.calculationSubjectiveAnswerLength(examRecordData.getId());
|
|
|
+ examRecordForMarking.setSubjectiveAnswerLength(subjectiveAnswerLength);
|
|
|
+
|
|
|
+ examRecordForMarkingRepo.save(examRecordForMarking);
|
|
|
+ }
|
|
|
}
|