|
@@ -1,13 +1,25 @@
|
|
|
package cn.com.qmth.examcloud.core.oe.admin.service.impl;
|
|
|
|
|
|
-import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
|
+import java.text.DecimalFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
import cn.com.qmth.examcloud.core.basic.api.bean.CourseBean;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.base.utils.QuestionTypeUtil;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.ExamRecordDataRepo;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.ExamRecordQuestionsRepo;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.ExamScoreRepo;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.ExamStudentRepo;
|
|
|
-import cn.com.qmth.examcloud.core.oe.admin.dao.entity.*;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamQuestionEntity;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordDataEntity;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordPaperStructEntity;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamRecordQuestionsEntity;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamScoreEntity;
|
|
|
+import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamStudentEntity;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.enums.ExamRecordStatus;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.ExamRecordPaperStructService;
|
|
|
import cn.com.qmth.examcloud.core.oe.admin.service.PracticeService;
|
|
@@ -19,20 +31,7 @@ import cn.com.qmth.examcloud.core.oe.admin.service.others.ExamCacheTransferHelpe
|
|
|
import cn.com.qmth.examcloud.examwork.api.bean.ExamBean;
|
|
|
import cn.com.qmth.examcloud.question.commons.core.paper.DefaultPaper;
|
|
|
import cn.com.qmth.examcloud.question.commons.core.paper.DefaultQuestionGroup;
|
|
|
-import cn.com.qmth.examcloud.support.enums.DbType;
|
|
|
-import cn.com.qmth.examcloud.support.examing.ExamQuestion;
|
|
|
-import cn.com.qmth.examcloud.support.examing.ExamRecordData;
|
|
|
-import cn.com.qmth.examcloud.support.examing.ExamRecordPaperStruct;
|
|
|
-import cn.com.qmth.examcloud.support.redis.RedisKeyHelper;
|
|
|
import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
|
|
|
-import cn.com.qmth.examcloud.web.redis.RedisClient;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-
|
|
|
-import java.text.DecimalFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -59,9 +58,6 @@ public class PracticeServiceImpl implements PracticeService {
|
|
|
@Autowired
|
|
|
private ExamRecordPaperStructService examRecordPaperStructService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private RedisClient redisClient;
|
|
|
-
|
|
|
@Override
|
|
|
public List<PracticeCourseInfo> queryPracticeCourseList(Long examId, Long studentId) {
|
|
|
if (examId == null || studentId == null) {
|
|
@@ -72,127 +68,13 @@ public class PracticeServiceImpl implements PracticeService {
|
|
|
return null;
|
|
|
}
|
|
|
List<PracticeCourseInfo> practiceCourseInfos = new ArrayList<PracticeCourseInfo>();
|
|
|
- ExamBean examBean = ExamCacheTransferHelper.getCachedExam(examId, studentId);
|
|
|
+ ExamBean examBean = ExamCacheTransferHelper.getCachedExam(examId,studentId);
|
|
|
for (ExamStudentEntity examStudent : examStudentList) {
|
|
|
practiceCourseInfos.add(buildPracticeCourseInfo(examStudent, examBean));
|
|
|
}
|
|
|
return practiceCourseInfos;
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public List<PracticeRecordInfo> queryPracticeRecordList(Long examStudentId) {
|
|
|
- if (examStudentId == null) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- List<ExamRecordDataEntity> examRecordDataList = examRecordDataRepo.findByExamStudentId(examStudentId);
|
|
|
- List<PracticeRecordInfo> practiceRecords = new ArrayList<PracticeRecordInfo>();
|
|
|
- ExamStudentEntity examStudent = examStudentRepo.findByExamStudentId(examStudentId);
|
|
|
- CourseBean courseBean = ExamCacheTransferHelper.getCachedCourse(examStudent.getCourseId());
|
|
|
- for (ExamRecordDataEntity examRecordData : examRecordDataList) {
|
|
|
- if (examRecordData.getExamRecordStatus() != ExamRecordStatus.EXAM_ING) {
|
|
|
- practiceRecords.add(buildPracticeRecord(examRecordData, courseBean));
|
|
|
- }
|
|
|
- }
|
|
|
- return practiceRecords;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public PracticeDetailInfo getPracticeDetailInfo(Long examRecordDataId, DbType dbType) {
|
|
|
- if (examRecordDataId == null) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- //----根据数据类型获取试卷结构
|
|
|
- DefaultPaper defaultPaper = this.getDefaultPaper(examRecordDataId, dbType);
|
|
|
-
|
|
|
- List<DefaultQuestionGroup> questionGroupList = defaultPaper.getQuestionGroupList();
|
|
|
-
|
|
|
- //----根据数据类型获取作答记录
|
|
|
- List<ExamQuestion> examQuestionList = getPartialExamQuestionList(examRecordDataId, dbType);
|
|
|
-
|
|
|
- //遍历大题
|
|
|
- int objectiveNum = 0;//各个大题中的客观题总数
|
|
|
- int objectSuccessNum = 0;//各个大题中的客观题答对的总数量
|
|
|
-
|
|
|
- List<PaperStructInfo> paperStructInfos = new ArrayList<PaperStructInfo>();
|
|
|
-
|
|
|
- for (int i = 0; i < questionGroupList.size(); i++) {
|
|
|
- DefaultQuestionGroup defaultQuestionGroup = questionGroupList.get(i);
|
|
|
- PaperStructInfo paperStructInfo = new PaperStructInfo();
|
|
|
- paperStructInfo.setTitle(defaultQuestionGroup.getGroupName());//大题名称
|
|
|
- paperStructInfo.setIndex(i + 1);//大题号
|
|
|
- //使用大题号过滤
|
|
|
- List<ExamQuestion> examQuestionEntitiesOfMainQuestion = examQuestionList.stream().filter(o1 -> o1.getMainNumber().intValue() == paperStructInfo.getIndex()).collect(Collectors.toList());
|
|
|
- //计算出作答情况
|
|
|
- PracticeRecordInfo practiceRecordInfo = calculationExamQuestionSituationInfo(null, examQuestionEntitiesOfMainQuestion);
|
|
|
-
|
|
|
- objectiveNum += practiceRecordInfo.getObjectiveNum();
|
|
|
- objectSuccessNum += practiceRecordInfo.getSuccQuestionNum();
|
|
|
-
|
|
|
- paperStructInfo.setQuestionCount(practiceRecordInfo.getTotalQuestionCount());
|
|
|
- paperStructInfo.setSuccQuestionNum(practiceRecordInfo.getSuccQuestionNum());
|
|
|
- paperStructInfo.setFailQuestionNum(practiceRecordInfo.getFailQuestionNum());
|
|
|
- paperStructInfo.setNotAnsweredCount(practiceRecordInfo.getNotAnsweredCount());
|
|
|
- paperStructInfos.add(paperStructInfo);
|
|
|
- }
|
|
|
-
|
|
|
- PracticeDetailInfo practiceDetailInfo = new PracticeDetailInfo();
|
|
|
-
|
|
|
- practiceDetailInfo.setPaperStructInfos(paperStructInfos);
|
|
|
-
|
|
|
- //----根据考试记录id获取课程id
|
|
|
- Long courseId = getCourseId(examRecordDataId, dbType);
|
|
|
-
|
|
|
- CourseBean courseBean = ExamCacheTransferHelper.getCachedCourse(courseId);
|
|
|
- practiceDetailInfo.setCourseCode(courseBean.getCode());
|
|
|
- practiceDetailInfo.setCourseName(courseBean.getName());
|
|
|
- practiceDetailInfo.setId(examRecordDataId);
|
|
|
-
|
|
|
- double objectiveAccuracy = 0;//客观题答题正确率
|
|
|
- if (objectiveNum > 0) {
|
|
|
- objectiveAccuracy = Double.valueOf(new DecimalFormat("#.00").format(objectSuccessNum * 100D / objectiveNum));
|
|
|
- }
|
|
|
- practiceDetailInfo.setObjectiveAccuracy(objectiveAccuracy);
|
|
|
-
|
|
|
- return practiceDetailInfo;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 根据数据类型获取课程id
|
|
|
- *
|
|
|
- * @param examRecordDataId
|
|
|
- * @param dbType
|
|
|
- * @return
|
|
|
- */
|
|
|
- private Long getCourseId(Long examRecordDataId, DbType dbType) {
|
|
|
- Long courseId = null;
|
|
|
-
|
|
|
- //如果数据类型为缓存数据,从缓存中获取
|
|
|
- if (DbType.CACHE == dbType) {
|
|
|
- ExamRecordData examRecordData =
|
|
|
- redisClient.get(RedisKeyHelper.getBuilder().examRecordDataKey(examRecordDataId), ExamRecordData.class);
|
|
|
-
|
|
|
- if (null != examRecordData) {
|
|
|
- courseId = examRecordData.getCourseId();
|
|
|
- return courseId;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //缓存中未获取到或指定从数据库中取,则从数据库中获取
|
|
|
- if (DbType.TABLE==dbType || null == courseId) {
|
|
|
- ExamRecordDataEntity examRecordData =
|
|
|
- GlobalHelper.getEntity(examRecordDataRepo, examRecordDataId, ExamRecordDataEntity.class);
|
|
|
-
|
|
|
- if (null == examRecordData) {
|
|
|
- throw new StatusException("100101","找不到考试记录相关数据");
|
|
|
- }
|
|
|
-
|
|
|
- return examRecordData.getId();
|
|
|
- }
|
|
|
-
|
|
|
- throw new StatusException("100003", "暂不支持的数据类型");
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
private PracticeCourseInfo buildPracticeCourseInfo(ExamStudentEntity examStudent, ExamBean examBean) {
|
|
|
PracticeCourseInfo practiceCourseInfo = new PracticeCourseInfo();
|
|
@@ -250,6 +132,23 @@ public class PracticeServiceImpl implements PracticeService {
|
|
|
return practiceCourseInfo;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<PracticeRecordInfo> queryPracticeRecordList(Long examStudentId) {
|
|
|
+ if (examStudentId == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ List<ExamRecordDataEntity> examRecordDataList = examRecordDataRepo.findByExamStudentId(examStudentId);
|
|
|
+ List<PracticeRecordInfo> practiceRecords = new ArrayList<PracticeRecordInfo>();
|
|
|
+ ExamStudentEntity examStudent = examStudentRepo.findByExamStudentId(examStudentId);
|
|
|
+ CourseBean courseBean = ExamCacheTransferHelper.getCachedCourse(examStudent.getCourseId());
|
|
|
+ for (ExamRecordDataEntity examRecordData : examRecordDataList) {
|
|
|
+ if (examRecordData.getExamRecordStatus() != ExamRecordStatus.EXAM_ING) {
|
|
|
+ practiceRecords.add(buildPracticeRecord(examRecordData, courseBean));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return practiceRecords;
|
|
|
+ }
|
|
|
+
|
|
|
private PracticeRecordInfo buildPracticeRecord(ExamRecordDataEntity examRecordData, CourseBean courseBean) {
|
|
|
PracticeRecordInfo practiceRecordInfo = new PracticeRecordInfo();
|
|
|
|
|
@@ -264,7 +163,7 @@ public class PracticeServiceImpl implements PracticeService {
|
|
|
practiceRecordInfo.setObjectiveAccuracy(examScoreEntity.getObjectiveAccuracy());//客观题答对的比率
|
|
|
ExamRecordQuestionsEntity examRecordQuestions = examRecordQuestionsRepo.findByExamRecordDataId(examRecordData.getId());
|
|
|
List<ExamQuestionEntity> examQuestionEntities = examRecordQuestions.getExamQuestionEntities();
|
|
|
- practiceRecordInfo = calculationExamQuestionSituationInfo(practiceRecordInfo, copyFromEntityList(examQuestionEntities));
|
|
|
+ practiceRecordInfo = calculationExamQuestionSituationInfo(practiceRecordInfo, examQuestionEntities);
|
|
|
|
|
|
return practiceRecordInfo;
|
|
|
}
|
|
@@ -273,18 +172,17 @@ public class PracticeServiceImpl implements PracticeService {
|
|
|
* 计算答题情况
|
|
|
*
|
|
|
* @param practiceRecordInfo
|
|
|
- * @param examQuestionList
|
|
|
+ * @param examQuestionEntities
|
|
|
* @return
|
|
|
*/
|
|
|
- private PracticeRecordInfo calculationExamQuestionSituationInfo(PracticeRecordInfo practiceRecordInfo,
|
|
|
- List<ExamQuestion> examQuestionList) {
|
|
|
+ private PracticeRecordInfo calculationExamQuestionSituationInfo(PracticeRecordInfo practiceRecordInfo, List<ExamQuestionEntity> examQuestionEntities) {
|
|
|
if (practiceRecordInfo == null) {
|
|
|
practiceRecordInfo = new PracticeRecordInfo();
|
|
|
}
|
|
|
int succQuestionNum = 0;//正确答题数
|
|
|
int failQuestionNum = 0;//错误答题数
|
|
|
int notAnsweredCount = 0;//未作答题数
|
|
|
- for (ExamQuestion examQuestionEntity : examQuestionList) {
|
|
|
+ for (ExamQuestionEntity examQuestionEntity : examQuestionEntities) {
|
|
|
if (examQuestionEntity.getIsAnswer() == null || !examQuestionEntity.getIsAnswer()) {
|
|
|
notAnsweredCount++;
|
|
|
} else {
|
|
@@ -301,7 +199,7 @@ public class PracticeServiceImpl implements PracticeService {
|
|
|
}
|
|
|
}
|
|
|
int objectiveQuestionsNum = 0;//客观题总数
|
|
|
- for (ExamQuestion examQuestionEntity : examQuestionList) {
|
|
|
+ for (ExamQuestionEntity examQuestionEntity : examQuestionEntities) {
|
|
|
if (QuestionTypeUtil.isObjectiveQuestion(examQuestionEntity.getQuestionType())) {
|
|
|
objectiveQuestionsNum++;
|
|
|
}
|
|
@@ -310,112 +208,59 @@ public class PracticeServiceImpl implements PracticeService {
|
|
|
practiceRecordInfo.setSuccQuestionNum(succQuestionNum);
|
|
|
practiceRecordInfo.setFailQuestionNum(failQuestionNum);
|
|
|
practiceRecordInfo.setNotAnsweredCount(notAnsweredCount);
|
|
|
- practiceRecordInfo.setTotalQuestionCount(examQuestionList.size());
|
|
|
+ practiceRecordInfo.setTotalQuestionCount(examQuestionEntities.size());
|
|
|
return practiceRecordInfo;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 根据数据类型获取试卷
|
|
|
- *
|
|
|
- * @param examRecordDataId
|
|
|
- * @param dbType
|
|
|
- * @return
|
|
|
- */
|
|
|
- private DefaultPaper getDefaultPaper(Long examRecordDataId, DbType dbType) {
|
|
|
- ExamRecordPaperStruct examRecordPaperStruct = null;
|
|
|
-
|
|
|
- //从缓存中获取
|
|
|
- if (DbType.CACHE == dbType) {
|
|
|
- examRecordPaperStruct = redisClient.get(RedisKeyHelper.getBuilder().studentPaperKey(examRecordDataId),
|
|
|
- ExamRecordPaperStruct.class);
|
|
|
-
|
|
|
- if (null != examRecordPaperStruct) {
|
|
|
- return examRecordPaperStruct.getDefaultPaper();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //如果数据类型为table或者缓存中未取到,则从数据库中获取
|
|
|
- if (DbType.TABLE == dbType || null == examRecordPaperStruct) {
|
|
|
- return examRecordPaperStructService.getExamRecordPaperStruct(examRecordDataId).getDefaultPaper();
|
|
|
+ @Override
|
|
|
+ public PracticeDetailInfo getPracticeDetailInfo(Long examRecordDataId) {
|
|
|
+ if (examRecordDataId == null) {
|
|
|
+ return null;
|
|
|
}
|
|
|
+ PracticeDetailInfo practiceDetailInfo = new PracticeDetailInfo();
|
|
|
+ //取出试卷结构
|
|
|
+ ExamRecordPaperStructEntity examRecordPaperStruct = examRecordPaperStructService.getExamRecordPaperStruct(examRecordDataId);
|
|
|
+ DefaultPaper defaultPaper = examRecordPaperStruct.getDefaultPaper();
|
|
|
+ List<PaperStructInfo> paperStructInfos = new ArrayList<PaperStructInfo>();
|
|
|
+ List<DefaultQuestionGroup> questionGroupList = defaultPaper.getQuestionGroupList();
|
|
|
+ //取出作答记录
|
|
|
+ ExamRecordQuestionsEntity examRecordQuestions = examRecordQuestionsRepo.findByExamRecordDataId(examRecordDataId);
|
|
|
+ List<ExamQuestionEntity> examQuestionEntities = examRecordQuestions.getExamQuestionEntities();
|
|
|
+ //遍历大题
|
|
|
+ int objectiveNum = 0;//各个大题中的客观题总数
|
|
|
+ int objectSuccessNum = 0;//各个大题中的客观题答对的总数量
|
|
|
+ for (int i = 0; i < questionGroupList.size(); i++) {
|
|
|
+ DefaultQuestionGroup defaultQuestionGroup = questionGroupList.get(i);
|
|
|
+ PaperStructInfo paperStructInfo = new PaperStructInfo();
|
|
|
+ paperStructInfo.setTitle(defaultQuestionGroup.getGroupName());//大题名称
|
|
|
+ paperStructInfo.setIndex(i + 1);//大题号
|
|
|
+ //使用大题号过滤
|
|
|
+ List<ExamQuestionEntity> examQuestionEntitiesOfMainQuestion = examQuestionEntities.stream().filter(o1 -> o1.getMainNumber().intValue() == paperStructInfo.getIndex()).collect(Collectors.toList());
|
|
|
+ //计算出作答情况
|
|
|
+ PracticeRecordInfo practiceRecordInfo = calculationExamQuestionSituationInfo(null, examQuestionEntitiesOfMainQuestion);
|
|
|
|
|
|
- throw new StatusException("100002", "暂不支持的数据类型");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 根据数据类型获取部分作答数据集合
|
|
|
- *
|
|
|
- * @param examRecordDataId
|
|
|
- * @param dbType
|
|
|
- * @return
|
|
|
- */
|
|
|
- private List<ExamQuestion> getPartialExamQuestionList(Long examRecordDataId, DbType dbType) {
|
|
|
- List<ExamQuestion> examQuestionList = new ArrayList<>();
|
|
|
- Integer questionCount = 0;
|
|
|
-
|
|
|
- //从缓存中获取
|
|
|
- if (DbType.CACHE == dbType) {
|
|
|
- ExamRecordData examRecordData = redisClient.get(RedisKeyHelper.getBuilder().examRecordDataKey(examRecordDataId),
|
|
|
- ExamRecordData.class);
|
|
|
-
|
|
|
- if (null != examRecordData) {
|
|
|
- questionCount = examRecordData.getQuestionCount();
|
|
|
-
|
|
|
- for (int i = 1; i <= questionCount; i++) {
|
|
|
- ExamQuestion examQuestion = redisClient.get(RedisKeyHelper.getBuilder().studentAnswerKey(examRecordDataId, i),
|
|
|
- ExamQuestion.class);
|
|
|
-
|
|
|
- if (null != examQuestion) {
|
|
|
-
|
|
|
- //由于主观题不需要参与计算,所以缓存中超长答案的情况不考虑
|
|
|
- examQuestionList.add(examQuestion);
|
|
|
+ objectiveNum += practiceRecordInfo.getObjectiveNum();
|
|
|
+ objectSuccessNum += practiceRecordInfo.getSuccQuestionNum();
|
|
|
|
|
|
- if (questionCount > 0 && questionCount == examQuestionList.size()) {
|
|
|
- return examQuestionList;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ paperStructInfo.setQuestionCount(practiceRecordInfo.getTotalQuestionCount());
|
|
|
+ paperStructInfo.setSuccQuestionNum(practiceRecordInfo.getSuccQuestionNum());
|
|
|
+ paperStructInfo.setFailQuestionNum(practiceRecordInfo.getFailQuestionNum());
|
|
|
+ paperStructInfo.setNotAnsweredCount(practiceRecordInfo.getNotAnsweredCount());
|
|
|
+ paperStructInfos.add(paperStructInfo);
|
|
|
}
|
|
|
+ practiceDetailInfo.setPaperStructInfos(paperStructInfos);
|
|
|
+ ExamRecordDataEntity examRecordData = GlobalHelper.getEntity(examRecordDataRepo, examRecordDataId, ExamRecordDataEntity.class);
|
|
|
+ CourseBean courseBean = ExamCacheTransferHelper.getCachedCourse(examRecordData.getCourseId());
|
|
|
+ practiceDetailInfo.setCourseCode(courseBean.getCode());
|
|
|
+ practiceDetailInfo.setCourseName(courseBean.getName());
|
|
|
+ practiceDetailInfo.setId(examRecordDataId);
|
|
|
|
|
|
- //从缓存中未取到,或者指定了从数据库中取,则从数据库中获取
|
|
|
- if (DbType.TABLE == dbType ||
|
|
|
- (examQuestionList.isEmpty() ||
|
|
|
- (!examQuestionList.isEmpty() && questionCount.intValue() != examQuestionList.size()))) {
|
|
|
-
|
|
|
- ExamRecordQuestionsEntity examRecordQuestions = examRecordQuestionsRepo.findByExamRecordDataId(examRecordDataId);
|
|
|
- List<ExamQuestionEntity> examQuestionEntityList = examRecordQuestions.getExamQuestionEntities();
|
|
|
-
|
|
|
- return copyFromEntityList(examQuestionEntityList);
|
|
|
+ double objectiveAccuracy = 0;//客观题答题正确率
|
|
|
+ if (objectiveNum > 0) {
|
|
|
+ objectiveAccuracy = Double.valueOf(new DecimalFormat("#.00").format(objectSuccessNum * 100D / objectiveNum));
|
|
|
}
|
|
|
-
|
|
|
- throw new StatusException("100001", "暂不支持的数据类型");
|
|
|
+ practiceDetailInfo.setObjectiveAccuracy(objectiveAccuracy);
|
|
|
+ return practiceDetailInfo;
|
|
|
}
|
|
|
|
|
|
- private List<ExamQuestion> copyFromEntityList(List<ExamQuestionEntity> examQuestionEntityList) {
|
|
|
- List<ExamQuestion> examQuestionList = new ArrayList<>();
|
|
|
-
|
|
|
- for (ExamQuestionEntity entity : examQuestionEntityList) {
|
|
|
- ExamQuestion examQuestion = new ExamQuestion();
|
|
|
- examQuestion.setExamRecordDataId(entity.getExamRecordDataId());
|
|
|
- examQuestion.setMainNumber(entity.getMainNumber());
|
|
|
- examQuestion.setQuestionId(entity.getQuestionId());
|
|
|
- examQuestion.setOrder(entity.getOrder());
|
|
|
- examQuestion.setStudentAnswer(entity.getStudentAnswer());
|
|
|
- examQuestion.setStudentScore(entity.getStudentScore());
|
|
|
- examQuestion.setQuestionScore(entity.getQuestionScore());
|
|
|
- examQuestion.setQuestionType(entity.getQuestionType());
|
|
|
- examQuestion.setIsAnswer(entity.getIsAnswer());
|
|
|
- examQuestion.setIsSign(entity.getIsSign());
|
|
|
- examQuestion.setCorrectAnswer(entity.getCorrectAnswer());
|
|
|
- examQuestion.setOptionPermutation(entity.getOptionPermutation());
|
|
|
- examQuestion.setAudioPlayTimes(entity.getAudioPlayTimes());
|
|
|
- examQuestion.setAnswerType(entity.getAnswerType());
|
|
|
-
|
|
|
- examQuestionList.add(examQuestion);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- return examQuestionList;
|
|
|
- }
|
|
|
}
|