|
@@ -19,6 +19,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
import javax.validation.constraints.NotNull;
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
|
import com.qmth.teachcloud.mark.dto.mark.manage.TaskQuestion;
|
|
import com.qmth.teachcloud.mark.dto.mark.manage.TaskQuestion;
|
|
|
|
+import javafx.beans.property.StringProperty;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.io.FilenameUtils;
|
|
import org.apache.commons.io.FilenameUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -1541,7 +1542,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
}
|
|
}
|
|
|
|
|
|
// 客观题成绩分析
|
|
// 客观题成绩分析
|
|
- fillObjective(ret, studentList, query.getExamId(), query.getPaperNumber());
|
|
|
|
|
|
+ fillObjective(ret, studentList, markPaper);
|
|
|
|
|
|
// 主观题成绩分析
|
|
// 主观题成绩分析
|
|
List<Long> studentIds = studentList.stream().map(ArchiveStudentVo::getStudentId).collect(Collectors.toList());
|
|
List<Long> studentIds = studentList.stream().map(ArchiveStudentVo::getStudentId).collect(Collectors.toList());
|
|
@@ -1716,9 +1717,25 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
return this.update(updateWrapper);
|
|
return this.update(updateWrapper);
|
|
}
|
|
}
|
|
|
|
|
|
- private void fillObjective(ScoreReportVo ret, List<ArchiveStudentVo> studentList, Long examId, String
|
|
|
|
- paperNumber) {
|
|
|
|
- List<MarkQuestion> qs = markQuestionService.listByExamIdAndPaperNumberAndObjective(examId, paperNumber, true);
|
|
|
|
|
|
+ private void fillObjective(ScoreReportVo ret, List<ArchiveStudentVo> studentList, MarkPaper markPaper) {
|
|
|
|
+ Long examId = markPaper.getExamId();
|
|
|
|
+ String paperNumber = markPaper.getPaperNumber();
|
|
|
|
+ List<MarkQuestion> qs;
|
|
|
|
+ if (markPaper.getArchive()) {
|
|
|
|
+ List<StudentObjectiveAnswerDto> objectiveAnswerDtos = markArchiveStudentService.listStudentObjectiveAnswerDtoByExamIdAndPaperNumber(examId, paperNumber);
|
|
|
|
+ qs = objectiveAnswerDtos.stream().map(m -> {
|
|
|
|
+ MarkQuestion markQuestion = new MarkQuestion();
|
|
|
|
+ markQuestion.setMainNumber(m.getMainNumber());
|
|
|
|
+ markQuestion.setSubNumber(m.getSubNumber());
|
|
|
|
+ markQuestion.setTotalScore(m.getTotalScore());
|
|
|
|
+ markQuestion.setMainTitle(StringUtils.isBlank(m.getTitle()) ? m.getQuestionType() == 1 ? "单选题" : m.getQuestionType() == 2 ? "多选题" : m.getQuestionType() == 3 ? "判断题" : "" : "");
|
|
|
|
+ return markQuestion;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+ qs.sort(Comparator.comparing(MarkQuestion::getMainNumber).thenComparing(MarkQuestion::getSubNumber));
|
|
|
|
+ } else {
|
|
|
|
+ qs = markQuestionService.listByExamIdAndPaperNumberAndObjective(examId, paperNumber, true);
|
|
|
|
+ }
|
|
|
|
+
|
|
Map<String, List<ArchiveStudentVo>> collect = studentList.stream().filter(m -> StringUtils.isNotBlank(m.getPaperType())).collect(Collectors.groupingBy(ArchiveStudentVo::getPaperType));
|
|
Map<String, List<ArchiveStudentVo>> collect = studentList.stream().filter(m -> StringUtils.isNotBlank(m.getPaperType())).collect(Collectors.groupingBy(ArchiveStudentVo::getPaperType));
|
|
|
|
|
|
List<QuestionObjectiveVo> questionObjectiveVoList = new ArrayList<>();
|
|
List<QuestionObjectiveVo> questionObjectiveVoList = new ArrayList<>();
|
|
@@ -1803,7 +1820,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
if (CollectionUtils.isNotEmpty(studentIdList)) {
|
|
if (CollectionUtils.isNotEmpty(studentIdList)) {
|
|
markArchiveStudents = markArchiveStudentService.listByStudentIds(studentIdList);
|
|
markArchiveStudents = markArchiveStudentService.listByStudentIds(studentIdList);
|
|
}
|
|
}
|
|
- if(CollectionUtils.isNotEmpty(markArchiveStudents)) {
|
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(markArchiveStudents)) {
|
|
for (MarkArchiveStudent markArchiveStudent : markArchiveStudents) {
|
|
for (MarkArchiveStudent markArchiveStudent : markArchiveStudents) {
|
|
List<TaskQuestion> taskQuestionList = JSON.parseArray(markArchiveStudent.getSubjectiveQuestions(), TaskQuestion.class);
|
|
List<TaskQuestion> taskQuestionList = JSON.parseArray(markArchiveStudent.getSubjectiveQuestions(), TaskQuestion.class);
|
|
Map<Integer, Double> listMap = taskQuestionList.stream().collect(Collectors.groupingBy(m -> m.getMainNumber(), Collectors.summingDouble(n -> n.getMarkerScore())));
|
|
Map<Integer, Double> listMap = taskQuestionList.stream().collect(Collectors.groupingBy(m -> m.getMainNumber(), Collectors.summingDouble(n -> n.getMarkerScore())));
|
|
@@ -1812,8 +1829,8 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
}
|
|
}
|
|
}
|
|
}
|
|
MarkArchiveStudent markArchiveStudent = markArchiveStudents.get(0);
|
|
MarkArchiveStudent markArchiveStudent = markArchiveStudents.get(0);
|
|
- if(markArchiveStudent!= null) {
|
|
|
|
- if(StringUtils.isNotBlank(markArchiveStudent.getObjectiveQuestions())) {
|
|
|
|
|
|
+ if (markArchiveStudent != null) {
|
|
|
|
+ if (StringUtils.isNotBlank(markArchiveStudent.getObjectiveQuestions())) {
|
|
List<StudentObjectiveAnswerDto> taskQuestions = JSON.parseArray(markArchiveStudent.getObjectiveQuestions(), StudentObjectiveAnswerDto.class);
|
|
List<StudentObjectiveAnswerDto> taskQuestions = JSON.parseArray(markArchiveStudent.getObjectiveQuestions(), StudentObjectiveAnswerDto.class);
|
|
for (StudentObjectiveAnswerDto taskQuestion : taskQuestions) {
|
|
for (StudentObjectiveAnswerDto taskQuestion : taskQuestions) {
|
|
MarkQuestion markQuestion = new MarkQuestion();
|
|
MarkQuestion markQuestion = new MarkQuestion();
|
|
@@ -1825,7 +1842,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
questionDatasource.add(markQuestion);
|
|
questionDatasource.add(markQuestion);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(StringUtils.isNotBlank(markArchiveStudent.getSubjectiveQuestions())) {
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(markArchiveStudent.getSubjectiveQuestions())) {
|
|
List<TaskQuestion> taskQuestions = JSON.parseArray(markArchiveStudent.getSubjectiveQuestions(), TaskQuestion.class);
|
|
List<TaskQuestion> taskQuestions = JSON.parseArray(markArchiveStudent.getSubjectiveQuestions(), TaskQuestion.class);
|
|
for (TaskQuestion taskQuestion : taskQuestions) {
|
|
for (TaskQuestion taskQuestion : taskQuestions) {
|
|
MarkQuestion markQuestion = new MarkQuestion();
|
|
MarkQuestion markQuestion = new MarkQuestion();
|