|
@@ -3,7 +3,6 @@ package com.qmth.teachcloud.report.business.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.qmth.teachcloud.common.contant.SpringContextHolder;
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
|
-import com.qmth.teachcloud.common.entity.BasicSemester;
|
|
|
import com.qmth.teachcloud.common.entity.SysOrg;
|
|
|
import com.qmth.teachcloud.common.enums.AssignEnum;
|
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
@@ -12,6 +11,7 @@ import com.qmth.teachcloud.report.business.bean.dto.AnswerDetailBean;
|
|
|
import com.qmth.teachcloud.report.business.bean.dto.query.BasicAnswerDto;
|
|
|
import com.qmth.teachcloud.report.business.bean.dto.query.BasicExamRecordDto;
|
|
|
import com.qmth.teachcloud.report.business.bean.dto.query.ValidAnswerDetailDto;
|
|
|
+import com.qmth.teachcloud.report.business.bean.dto.query.ValidAnswerDetailSumScoreDto;
|
|
|
import com.qmth.teachcloud.report.business.entity.*;
|
|
|
import com.qmth.teachcloud.report.business.enums.*;
|
|
|
import com.qmth.teachcloud.report.business.service.*;
|
|
@@ -21,6 +21,7 @@ import com.qmth.teachcloud.report.business.utils.MathUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.lang.reflect.Field;
|
|
@@ -293,7 +294,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourse.setExamId(examId);
|
|
|
taExamCourse.setExamName(tbExam.getExamName());
|
|
|
taExamCourse.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourse.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourse.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourse.setSchoolId(tbExam.getSchoolId());
|
|
|
taExamCourse.setTeachCollegeId(teachCollegeId);
|
|
|
taExamCourse.setTeachCollegeName(teachCollegeName);
|
|
@@ -454,7 +455,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseCollegeInspect.setExamId(examId);
|
|
|
taExamCourseCollegeInspect.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseCollegeInspect.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseCollegeInspect.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseCollegeInspect.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseCollegeInspect.setCollegeId(collegeId);
|
|
|
taExamCourseCollegeInspect.setMaxScore(BigDecimal.valueOf(maxScore));
|
|
|
taExamCourseCollegeInspect.setMinScore(BigDecimal.valueOf(minScore));
|
|
@@ -535,7 +536,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseClazz.setExamId(examId);
|
|
|
taExamCourseClazz.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseClazz.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseClazz.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseClazz.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseClazz.setClazzId(clazzId);
|
|
|
taExamCourseClazz.setMaxScore(BigDecimal.valueOf(maxScore));
|
|
|
taExamCourseClazz.setMinScore(BigDecimal.valueOf(minScore));
|
|
@@ -674,7 +675,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseRecordDio.setStudentId(taExamCourseRecord.getStudentId());
|
|
|
taExamCourseRecordDio.setStudentCode(taExamCourseRecord.getStudentCode());
|
|
|
taExamCourseRecordDio.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseRecordDio.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseRecordDio.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
String[] dimCodeArr = s.split(SystemConstant.HYPHEN);
|
|
|
if (dimCodeArr.length != 2) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("获得的考查点标识不符合标准,标准为 type-dimensionCode,结果为: " + s);
|
|
@@ -727,7 +728,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseRecordMod.setExamId(taExamCourseRecord.getExamId());
|
|
|
taExamCourseRecordMod.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseRecordMod.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseRecordMod.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseRecordMod.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseRecordMod.setModuleType(s);
|
|
|
taExamCourseRecordMod.setTotalScore(BigDecimal.valueOf(studentScore));
|
|
|
taExamCourseRecordMod.setScoreRate(BigDecimal.valueOf(rate));
|
|
@@ -771,7 +772,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseDio.setExamId(examId);
|
|
|
taExamCourseDio.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseDio.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseDio.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseDio.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseDio.setPaperId(paperId);
|
|
|
taExamCourseDio.setDimensionType(dimensionType);
|
|
|
taExamCourseDio.setDimensionCode(dimensionCode);
|
|
@@ -885,6 +886,25 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
return "'t_a_exam_course_teacher_college_dio'表构建完成 ";
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 极端分组法(区分度针对每小题)
|
|
|
+ * 该方法通过比较高分组与低分组的得分差异计算区分度,具体步骤如下:
|
|
|
+ * 1、将考生总分从高到低排序,取前27%作为高分组(P₁),后27%作为低分组(P₂);
|
|
|
+ * 2、计算高分组和低分组在某一题目上的平均分;
|
|
|
+ * <p>
|
|
|
+ * 应用公式:D=(P₁−P₂)/小题满分值。
|
|
|
+ * <p>
|
|
|
+ * 极端分组法(效度针对全卷)
|
|
|
+ * 该方法通过比较高分组与低分组的得分差异计算区分度,具体步骤如下:
|
|
|
+ * 1、将考生总分从高到低排序,取前1/3作为高分组(P₁),后1/3作为低分组(P₂);
|
|
|
+ * 2、计算高分组和低分组在某一题目上的平均分;
|
|
|
+ * <p>
|
|
|
+ * 应用公式:D=(P₁−P₂)/全卷满分值。
|
|
|
+ *
|
|
|
+ * @param examId 考试id
|
|
|
+ * @param courseCode 课程编号
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
public String buildAnalyzePaperStruct(Long examId, String courseCode) {
|
|
@@ -912,11 +932,14 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
if (tbPaperStructList.size() == 0) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("试卷结构数据异常");
|
|
|
}
|
|
|
+ //新增满分效度
|
|
|
+ this.calculateSumScoreValidity(examId, effectiveCourseCode, paperId, tbPaper.getTotalScore());
|
|
|
for (TBPaperStruct paperStruct : tbPaperStructList) {
|
|
|
String numberType = paperStruct.getNumberType();
|
|
|
String mainNumber = paperStruct.getBigQuestionNumber();
|
|
|
String subNumber = paperStruct.getSmallQuestionNumber();
|
|
|
|
|
|
+ //过滤题目类型-大题-小题的答题明细
|
|
|
List<ValidAnswerDetailDto> oneQuestionAnswerDetailList = answerDetailDtoList
|
|
|
.stream().filter(e -> paperType.equals(e.getPaperType()) &&
|
|
|
numberType.equals(e.getNumberType()) &&
|
|
@@ -925,6 +948,8 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
if (oneQuestionAnswerDetailList.size() == 0) {
|
|
|
System.out.println("异常");
|
|
|
}
|
|
|
+
|
|
|
+ //判断是否有小题满分的
|
|
|
BigDecimal fullScore = paperStruct.getFullScore();
|
|
|
PaperStructJudgeEnum paperStructJudgeEnum;
|
|
|
if (oneQuestionAnswerDetailList.stream().anyMatch(e -> fullScore.compareTo(e.getScore()) != 0)) {
|
|
@@ -933,14 +958,32 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
paperStructJudgeEnum = PaperStructJudgeEnum.ALL_CORRECT;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 数据统计的收集器,主要用于对流中的数值进行汇总统计。它返回一个包含计数、总和、平均值、最大值和最小值的汇总对象
|
|
|
+ * 计数:统计流中元素的数量
|
|
|
+ * 总和:计算所有数值元素的累加和
|
|
|
+ * 平均值:计算数值元素的平均值
|
|
|
+ * 最大值:找出流中的最大数值
|
|
|
+ * 最小值:找出流中的最小数值
|
|
|
+ */
|
|
|
DoubleSummaryStatistics descriptiveStatistics = oneQuestionAnswerDetailList.stream()
|
|
|
.collect(Collectors.summarizingDouble(e -> e.getScore().doubleValue()));
|
|
|
|
|
|
- double scoreAvg = descriptiveStatistics.getAverage();
|
|
|
+ double scoreAvg = descriptiveStatistics.getAverage();//平均分
|
|
|
BigDecimal standardScoreRate = BigDecimal.valueOf(scoreAvg).divide(fullScore, 4, RoundingMode.HALF_UP);
|
|
|
BigDecimal scoreRate = standardScoreRate.setScale(1, RoundingMode.HALF_UP);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 计算小题难易度
|
|
|
+ * A [0,0.3) 难 0.0 0.3
|
|
|
+ * B [0.3,0.7] 中等难度 0.3 0.7
|
|
|
+ * C (0.7,1] 容易 0.7 1.0
|
|
|
+ */
|
|
|
String difficult = this.analyzeDifficult(examId, effectiveCourseCode, scoreRate.doubleValue());
|
|
|
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ */
|
|
|
double validity = this.calculateValidity(oneQuestionAnswerDetailList, fullScore.doubleValue());
|
|
|
|
|
|
TAPaperStruct taPaperStruct = new TAPaperStruct();
|
|
@@ -949,7 +992,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taPaperStruct.setExamId(examId);
|
|
|
taPaperStruct.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taPaperStruct.setCourseCode(effectiveCourseCode);
|
|
|
- taPaperStruct.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taPaperStruct.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taPaperStruct.setPaperId(paperId);
|
|
|
taPaperStruct.setPaperType(paperType);
|
|
|
taPaperStruct.setQuestionName(paperStruct.getQuestionName());
|
|
@@ -976,6 +1019,63 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
return " 't_a_paper_struct'表构建成功 ";
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 计算科目满分效度
|
|
|
+ *
|
|
|
+ * @param examId
|
|
|
+ * @param courseCode
|
|
|
+ * @param paperId
|
|
|
+ * @param fullScore
|
|
|
+ */
|
|
|
+ public void calculateSumScoreValidity(Long examId, String courseCode, Long paperId, BigDecimal fullScore) {
|
|
|
+ List<ValidAnswerDetailSumScoreDto> validAnswerDetailSumScoreDtoList = tbAnswerService.findValid(examId, courseCode, paperId);
|
|
|
+ if (!CollectionUtils.isEmpty(validAnswerDetailSumScoreDtoList)) {
|
|
|
+ int rank = 0;//排名
|
|
|
+ int number = 0;//序号
|
|
|
+ double value = 10000;
|
|
|
+ double courseSumScoreValidity = 0D;//科目满分效度
|
|
|
+ for (ValidAnswerDetailSumScoreDto temp : validAnswerDetailSumScoreDtoList) {
|
|
|
+ double compareValue = temp.getSumScore().doubleValue();
|
|
|
+ number++;
|
|
|
+ if (compareValue < value) {
|
|
|
+ rank = number;
|
|
|
+ value = compareValue;
|
|
|
+ }
|
|
|
+ temp.setRank(rank);
|
|
|
+ }
|
|
|
+ if (validAnswerDetailSumScoreDtoList.size() == 0) {
|
|
|
+ System.out.println("异常");
|
|
|
+ }
|
|
|
+ double endRank = validAnswerDetailSumScoreDtoList.get(validAnswerDetailSumScoreDtoList.size() - 1).getRank();
|
|
|
+ double topRank = ValidityEnum.COURSE_VALIDITY_FOR_RANK.getTopLimitPercent() * endRank;
|
|
|
+ double lowRank = ValidityEnum.COURSE_VALIDITY_FOR_RANK.getLowLimitPercent() * endRank;
|
|
|
+
|
|
|
+ //计算科目效度
|
|
|
+ double topScopeAvgScoreRate = validAnswerDetailSumScoreDtoList.stream()
|
|
|
+ .filter(e -> topRank >= e.getRank())
|
|
|
+ .collect(Collectors.summarizingDouble(e -> e.getSumScore().doubleValue()))
|
|
|
+ .getAverage() / fullScore.doubleValue(); // 优秀部分统计有效区间平均得分率
|
|
|
+
|
|
|
+ double lowScopeAvgScoreRate = validAnswerDetailSumScoreDtoList.stream()
|
|
|
+ .filter(e -> lowRank <= e.getRank())
|
|
|
+ .collect(Collectors.summarizingDouble(e -> e.getSumScore().doubleValue()))
|
|
|
+ .getAverage() / fullScore.doubleValue(); // 较差部分统计有效区间平均得分率
|
|
|
+
|
|
|
+ courseSumScoreValidity = topScopeAvgScoreRate - lowScopeAvgScoreRate;
|
|
|
+
|
|
|
+ //科目效度值大于则更新
|
|
|
+ if (courseSumScoreValidity > 0D) {
|
|
|
+ QueryWrapper<TAExamCourse> taExamCourseQueryWrapper = new QueryWrapper<>();
|
|
|
+ taExamCourseQueryWrapper.lambda().eq(TAExamCourse::getExamId, examId).eq(TAExamCourse::getCourseCode, courseCode);
|
|
|
+ TAExamCourse taExamCourse = taExamCourseService.getOne(taExamCourseQueryWrapper);
|
|
|
+ if (Objects.nonNull(taExamCourse)) {
|
|
|
+ taExamCourse.setCourseValidity(new BigDecimal(courseSumScoreValidity).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ taExamCourseService.updateById(taExamCourse);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
public String buildAnalyzeCollegePaperStruct(Long examId, String courseCode) {
|
|
@@ -1048,7 +1148,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseCollegePaperStruct.setExamId(examId);
|
|
|
taExamCourseCollegePaperStruct.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseCollegePaperStruct.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseCollegePaperStruct.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseCollegePaperStruct.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseCollegePaperStruct.setPaperId(paperId);
|
|
|
taExamCourseCollegePaperStruct.setInspectCollegeId(inspectCollegeId);
|
|
|
taExamCourseCollegePaperStruct.setInspectCollegeName(inspectCollegeName);
|
|
@@ -1150,7 +1250,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseTeacherPaperStruct.setExamId(examId);
|
|
|
taExamCourseTeacherPaperStruct.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseTeacherPaperStruct.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseTeacherPaperStruct.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseTeacherPaperStruct.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseTeacherPaperStruct.setPaperId(paperId);
|
|
|
taExamCourseTeacherPaperStruct.setTeacherId(teacherId);
|
|
|
taExamCourseTeacherPaperStruct.setTeacherName(teacherName);
|
|
@@ -1268,7 +1368,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseTeacherCollegePaperStruct.setExamId(examId);
|
|
|
taExamCourseTeacherCollegePaperStruct.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseTeacherCollegePaperStruct.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseTeacherCollegePaperStruct.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseTeacherCollegePaperStruct.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseTeacherCollegePaperStruct.setPaperId(paperId);
|
|
|
taExamCourseTeacherCollegePaperStruct.setTeacherId(teacherId);
|
|
|
taExamCourseTeacherCollegePaperStruct.setTeacherName(teacherName);
|
|
@@ -1371,7 +1471,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseDifficult.setId(SystemConstant.getDbUuid());
|
|
|
taExamCourseDifficult.setExamId(examId);
|
|
|
taExamCourseDifficult.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseDifficult.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseDifficult.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseDifficult.setPaperId(paperId);
|
|
|
taExamCourseDifficult.setPaperType(tbPaperService.getById(paperId).getPaperType());
|
|
|
taExamCourseDifficult.setCollegeId(collegeId);
|
|
@@ -1464,7 +1564,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseTeacherDifficult.setPaperId(paperId);
|
|
|
taExamCourseTeacherDifficult.setPaperType(tbPaperService.getById(paperId).getPaperType());
|
|
|
taExamCourseTeacherDifficult.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseTeacherDifficult.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseTeacherDifficult.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseTeacherDifficult.setTeacherId(teacherId);
|
|
|
taExamCourseTeacherDifficult.setTeacherName(sysUserService.getById(teacherId).getRealName());
|
|
|
taExamCourseTeacherDifficult.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
@@ -1580,7 +1680,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseTeacherCollegeDifficult.setPaperId(paperId);
|
|
|
taExamCourseTeacherCollegeDifficult.setPaperType(tbPaperService.getById(paperId).getPaperType());
|
|
|
taExamCourseTeacherCollegeDifficult.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseTeacherCollegeDifficult.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseTeacherCollegeDifficult.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseTeacherCollegeDifficult.setTeacherId(teacherId);
|
|
|
taExamCourseTeacherCollegeDifficult.setTeacherName(sysUserService.getById(teacherId).getRealName());
|
|
|
taExamCourseTeacherCollegeDifficult.setInspectCollegeId(collegeId);
|
|
@@ -1608,7 +1708,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@Override
|
|
|
- public String buildAnalyzeExamTotal(Long examId,String courseCode) {
|
|
|
+ public String buildAnalyzeExamTotal(Long examId, String courseCode) {
|
|
|
// 删除原数据
|
|
|
taExamTotalService.remove(new QueryWrapper<TAExamTotal>().lambda()
|
|
|
.eq(TAExamTotal::getExamId, examId));
|
|
@@ -1626,7 +1726,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
if (collegeCount > 0) {
|
|
|
for (Long inspectCollegeId : inspectCollegeInfo) {
|
|
|
SysOrg college = sysOrgService.getById(inspectCollegeId);
|
|
|
- if (Objects.nonNull(college)){
|
|
|
+ if (Objects.nonNull(college)) {
|
|
|
inspectCollegeNames.append(college.getName()).append(SystemConstant.PAUSE_SIGN);
|
|
|
}
|
|
|
}
|
|
@@ -1823,7 +1923,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseCollegeTeacher.setExamId(examId);
|
|
|
taExamCourseCollegeTeacher.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseCollegeTeacher.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseCollegeTeacher.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseCollegeTeacher.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseCollegeTeacher.setTeacherId(teacherId);
|
|
|
taExamCourseCollegeTeacher.setTeacherName(sysUserService.getById(teacherId).getRealName());
|
|
|
taExamCourseCollegeTeacher.setMinScoreAssign(BigDecimal.valueOf(minScoreAssign));
|
|
@@ -1936,7 +2036,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
taExamCourseTeacher.setExamId(examId);
|
|
|
taExamCourseTeacher.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
taExamCourseTeacher.setCourseCode(effectiveCourseCode);
|
|
|
- taExamCourseTeacher.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode,schoolId).getName());
|
|
|
+ taExamCourseTeacher.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode, schoolId).getName());
|
|
|
taExamCourseTeacher.setTeacherId(teacherId);
|
|
|
taExamCourseTeacher.setTeacherName(sysUserService.getById(teacherId).getRealName());
|
|
|
taExamCourseTeacher.setMinScore(BigDecimal.valueOf(minScore));
|
|
@@ -1989,7 +2089,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
analyzeForReportService.buildAnalyzePaperStruct(examId, courseCode);
|
|
|
analyzeForReportService.buildExamPaperDifficult(examId, courseCode);
|
|
|
analyzeForReportService.buildExamPaperTeacherDifficult(examId, courseCode);
|
|
|
- analyzeForReportService.buildAnalyzeExamTotal(examId,courseCode);
|
|
|
+ analyzeForReportService.buildAnalyzeExamTotal(examId, courseCode);
|
|
|
analyzeForReportService.buildAnalyzeExamCourseCollegeTeacher(examId, courseCode);
|
|
|
analyzeForReportService.buildAnalyzeExamCourseTeacher(examId, courseCode);
|
|
|
analyzeForReportService.buildAnalyzeExamCourseTeacherCollegeDio(examId, courseCode);
|
|
@@ -2027,7 +2127,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
throw ExceptionResultEnum.ERROR.exception("【" + status + "】状态的课程无法进行" + "【" + statusDesc + "】");
|
|
|
}
|
|
|
// 发布或取消发布清除缓存
|
|
|
- this.removeRedisCache(tbExamCourse.getSchoolId(),examId,courseCode);
|
|
|
+ this.removeRedisCache(tbExamCourse.getSchoolId(), examId, courseCode);
|
|
|
tbExamCourseService.updateById(tbExamCourse);
|
|
|
}
|
|
|
|
|
@@ -2041,7 +2141,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
// 获取当前课程下所有学生考试成绩记录
|
|
|
List<BasicExamRecordDto> basicExamRecordDtoDatasource = tbExamRecordService.findByExamIdAndCourseCodeS(examId, courseCodeList);
|
|
|
for (String s : courseCodeList) {
|
|
|
- if (tbExamCourseService.verifyExamCourseCantRun(examId, schoolId, s, basicCourseService.findByCourseCode(s,schoolId).getName())) {
|
|
|
+ if (tbExamCourseService.verifyExamCourseCantRun(examId, schoolId, s, basicCourseService.findByCourseCode(s, schoolId).getName())) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("课程编号[" + s + "]的课程分析数据已测试或发布,不能变更基础数据");
|
|
|
}
|
|
|
List<BasicExamRecordDto> basicExamRecordDtoList = basicExamRecordDtoDatasource.stream()
|
|
@@ -2116,14 +2216,14 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
// 考察院长报告总览和详情缓存
|
|
|
List<Long> inspectCollegeIdList = datasource.stream().map(TAExamCourseRecord::getInspectCollegeId).distinct().collect(Collectors.toList());
|
|
|
for (Long inspectCollegeId : inspectCollegeIdList) {
|
|
|
- commonCacheService.removeCollegeDeanCache(schoolId,semesterId,examId,inspectCollegeId);
|
|
|
- commonCacheService.removeCollegeCourseCache(schoolId,semesterId,examId,courseCode,inspectCollegeId);
|
|
|
+ commonCacheService.removeCollegeDeanCache(schoolId, semesterId, examId, inspectCollegeId);
|
|
|
+ commonCacheService.removeCollegeCourseCache(schoolId, semesterId, examId, courseCode, inspectCollegeId);
|
|
|
}
|
|
|
|
|
|
// 开课课程考试分析缓存清除
|
|
|
List<Long> teachCollegeIdList = datasource.stream().map(TAExamCourseRecord::getTeachCollegeId).distinct().collect(Collectors.toList());
|
|
|
for (Long teachCollegeId : teachCollegeIdList) {
|
|
|
- commonCacheService.removeSurveyTeacherViewCache(schoolId,semesterId,examId,courseCode,teachCollegeId);
|
|
|
+ commonCacheService.removeSurveyTeacherViewCache(schoolId, semesterId, examId, courseCode, teachCollegeId);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2507,7 +2607,7 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
* @param scoreRate 题目得分率
|
|
|
* @return 难度
|
|
|
*/
|
|
|
- private String analyzeDifficult(Long examId, String courseCode, double scoreRate) {
|
|
|
+ public String analyzeDifficult(Long examId, String courseCode, double scoreRate) {
|
|
|
List<TBCommonLevelConfig> levelConfigList = tbCommonLevelConfigService.list(new QueryWrapper<TBCommonLevelConfig>().lambda()
|
|
|
.eq(TBCommonLevelConfig::getExamId, examId)
|
|
|
.eq(TBCommonLevelConfig::getCourseCode, courseCode)
|
|
@@ -2550,15 +2650,15 @@ public class AnalyzeForReportServiceImpl implements AnalyzeForReportService {
|
|
|
* @param fullScore 该小题总分
|
|
|
* @return 鉴别度
|
|
|
*/
|
|
|
- private double calculateValidity(List<ValidAnswerDetailDto> oneQuestionAnswerDetailList, double fullScore) {
|
|
|
+ public double calculateValidity(List<ValidAnswerDetailDto> oneQuestionAnswerDetailList, double fullScore) {
|
|
|
List<ValidAnswerDetailDto> sortList = oneQuestionAnswerDetailList.stream().sorted(((o1, o2) -> {
|
|
|
double compare1 = o1.getPercentGrade();
|
|
|
double compare2 = o2.getPercentGrade();
|
|
|
return Double.compare(compare2, compare1);
|
|
|
})).collect(Collectors.toList());
|
|
|
|
|
|
- int rank = 0;
|
|
|
- int number = 0;
|
|
|
+ int rank = 0;//排名
|
|
|
+ int number = 0;//序号
|
|
|
double value = 10000;
|
|
|
for (ValidAnswerDetailDto temp : sortList) {
|
|
|
double compareValue = temp.getPercentGrade();
|