|
@@ -7,6 +7,7 @@ import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
import com.qmth.teachcloud.common.service.BasicCourseService;
|
|
import com.qmth.teachcloud.common.service.BasicCourseService;
|
|
import com.qmth.teachcloud.common.service.SysOrgService;
|
|
import com.qmth.teachcloud.common.service.SysOrgService;
|
|
import com.qmth.teachcloud.common.service.SysUserService;
|
|
import com.qmth.teachcloud.common.service.SysUserService;
|
|
|
|
+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.BasicAnswerDto;
|
|
import com.qmth.teachcloud.report.business.bean.dto.query.ValidAnswerDetailDto;
|
|
import com.qmth.teachcloud.report.business.bean.dto.query.ValidAnswerDetailDto;
|
|
import com.qmth.teachcloud.report.business.entity.*;
|
|
import com.qmth.teachcloud.report.business.entity.*;
|
|
@@ -87,6 +88,8 @@ public class AnalyzeForStudentServiceImpl implements AnalyzeForStudentService {
|
|
private TAExamCourseTeacherService taExamCourseTeacherService;
|
|
private TAExamCourseTeacherService taExamCourseTeacherService;
|
|
@Resource
|
|
@Resource
|
|
private SysUserService sysUserService;
|
|
private SysUserService sysUserService;
|
|
|
|
+ @Resource
|
|
|
|
+ private TAExamCourseDifficultService taExamCourseDifficultService;
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -624,6 +627,8 @@ public class AnalyzeForStudentServiceImpl implements AnalyzeForStudentService {
|
|
taExamCourseRecordDio.setExamRecordId(taExamCourseRecord.getExamRecordId());
|
|
taExamCourseRecordDio.setExamRecordId(taExamCourseRecord.getExamRecordId());
|
|
taExamCourseRecordDio.setPaperId(taExamCourseRecord.getPaperId());
|
|
taExamCourseRecordDio.setPaperId(taExamCourseRecord.getPaperId());
|
|
taExamCourseRecordDio.setExamId(taExamCourseRecord.getExamId());
|
|
taExamCourseRecordDio.setExamId(taExamCourseRecord.getExamId());
|
|
|
|
+ taExamCourseRecordDio.setStudentId(taExamCourseRecord.getStudentId());
|
|
|
|
+ taExamCourseRecordDio.setStudentCode(taExamCourseRecord.getStudentCode());
|
|
taExamCourseRecordDio.setCourseCode(effectiveCourseCode);
|
|
taExamCourseRecordDio.setCourseCode(effectiveCourseCode);
|
|
taExamCourseRecordDio.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode).getName());
|
|
taExamCourseRecordDio.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode).getName());
|
|
String[] dimCodeArr = s.split("-");
|
|
String[] dimCodeArr = s.split("-");
|
|
@@ -684,6 +689,8 @@ public class AnalyzeForStudentServiceImpl implements AnalyzeForStudentService {
|
|
taExamCourseRecordMod.setProficiency(this.handleModuleProficiency(examId,effectiveCourseCode,s,rate));
|
|
taExamCourseRecordMod.setProficiency(this.handleModuleProficiency(examId,effectiveCourseCode,s,rate));
|
|
taExamCourseRecordMod.setInspectCollegeId(inspectCollegeId);
|
|
taExamCourseRecordMod.setInspectCollegeId(inspectCollegeId);
|
|
taExamCourseRecordMod.setInspectCollegeName(inspectCollegeName);
|
|
taExamCourseRecordMod.setInspectCollegeName(inspectCollegeName);
|
|
|
|
+ taExamCourseRecordMod.setStudentId(taExamCourseRecord.getStudentId());
|
|
|
|
+ taExamCourseRecordMod.setStudentCode(taExamCourseRecord.getStudentCode());
|
|
taExamCourseRecordModList.add(taExamCourseRecordMod);
|
|
taExamCourseRecordModList.add(taExamCourseRecordMod);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -854,6 +861,19 @@ public class AnalyzeForStudentServiceImpl implements AnalyzeForStudentService {
|
|
taPaperStruct.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
taPaperStruct.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
taPaperStruct.setCourseCode(courseCode);
|
|
taPaperStruct.setCourseCode(courseCode);
|
|
taPaperStruct.setCourseName(basicCourseService.findByCourseCode(courseCode).getName());
|
|
taPaperStruct.setCourseName(basicCourseService.findByCourseCode(courseCode).getName());
|
|
|
|
+ taPaperStruct.setPaperId(paperId);
|
|
|
|
+ taPaperStruct.setQuestionName(paperStruct.getQuestionName());
|
|
|
|
+ taPaperStruct.setNumberType(paperStruct.getNumberType());
|
|
|
|
+ taPaperStruct.setBigQuestionNumber(paperStruct.getBigQuestionNumber());
|
|
|
|
+ taPaperStruct.setSmallQuestionNumber(paperStruct.getSmallQuestionNumber());
|
|
|
|
+ taPaperStruct.setQuestionType(paperStruct.getQuestionType());
|
|
|
|
+ taPaperStruct.setFullScore(paperStruct.getFullScore());
|
|
|
|
+ taPaperStruct.setScoreRules(paperStruct.getScoreRules());
|
|
|
|
+ taPaperStruct.setRulesDesc(paperStruct.getRulesDesc());
|
|
|
|
+ taPaperStruct.setKnowledgeDimension(paperStruct.getKnowledgeDimension());
|
|
|
|
+ taPaperStruct.setAbilityDimension(paperStruct.getAbilityDimension());
|
|
|
|
+ taPaperStruct.setLiteracyDimension(paperStruct.getLiteracyDimension());
|
|
|
|
+
|
|
taPaperStruct.setScoreRate(scoreRate);
|
|
taPaperStruct.setScoreRate(scoreRate);
|
|
taPaperStruct.setDifficult(difficult);
|
|
taPaperStruct.setDifficult(difficult);
|
|
taPaperStruct.setValidity(BigDecimal.valueOf(validity));
|
|
taPaperStruct.setValidity(BigDecimal.valueOf(validity));
|
|
@@ -866,6 +886,91 @@ public class AnalyzeForStudentServiceImpl implements AnalyzeForStudentService {
|
|
return " 't_a_paper_struct'表构建成功 ";
|
|
return " 't_a_paper_struct'表构建成功 ";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ @Override
|
|
|
|
+ public String buildExamPaperDifficult(Long examId, String courseCode) {
|
|
|
|
+ // 可分析有效课程信息
|
|
|
|
+ List<String> effectiveCourseCodeList = tbExamCourseService.findEffectiveByExamId(examId,courseCode);
|
|
|
|
+
|
|
|
|
+ for (String effectiveCourseCode : effectiveCourseCodeList) {
|
|
|
|
+ taExamCourseDifficultService.remove(new QueryWrapper<TAExamCourseDifficult>().lambda()
|
|
|
|
+ .eq(TAExamCourseDifficult::getExamId,examId)
|
|
|
|
+ .eq(TAExamCourseDifficult::getCourseCode,courseCode));
|
|
|
|
+
|
|
|
|
+ List<TAExamCourseDifficult> taExamCourseDifficultList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ List<TBCommonLevelConfig> configLevelDatasource = tbCommonLevelConfigService.list(new QueryWrapper<TBCommonLevelConfig>().lambda()
|
|
|
|
+ .eq(TBCommonLevelConfig::getExamId,examId).eq(TBCommonLevelConfig::getCourseCode,effectiveCourseCode));// 该科目试题难度情况数据源
|
|
|
|
+
|
|
|
|
+ List<TAPaperStruct> questionDatasource = taPaperStructService.list(new QueryWrapper<TAPaperStruct>().lambda()
|
|
|
|
+ .eq(TAPaperStruct::getExamId,examId).eq(TAPaperStruct::getCourseCode,effectiveCourseCode));// 该科目试题情况数据源
|
|
|
|
+
|
|
|
|
+ LinkedList<AnswerDetailBean> answerDetailDatasource = tbAnswerService.findValidAnswerDetailWithPap(examId,courseCode);
|
|
|
|
+ Set<Long> paperTypeList = questionDatasource.stream().map(TAPaperStruct::getPaperId).collect(Collectors.toSet());
|
|
|
|
+
|
|
|
|
+ for (Long paperId : paperTypeList) {
|
|
|
|
+ for (TBCommonLevelConfig levelTemp : configLevelDatasource) {
|
|
|
|
+ String interpret = levelTemp.getInterpret();
|
|
|
|
+ String scope = levelTemp.getScope();
|
|
|
|
+
|
|
|
|
+ List<TAPaperStruct> questionList = questionDatasource.stream()
|
|
|
|
+ .filter(e -> paperId.equals(e.getPaperId()) && interpret.equals(e.getDifficult()))
|
|
|
|
+ .collect(Collectors.toList()); // 题目信息
|
|
|
|
+
|
|
|
|
+ List<AnswerDetailBean> answerDetailForSch = answerDetailDatasource.stream()
|
|
|
|
+ .filter(e -> paperId.equals(e.getPaperId()) && interpret.equals(e.getDifficult()))
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ double schAvgScoreRate = answerDetailForSch.stream()
|
|
|
|
+ .collect(Collectors.summarizingDouble(AnswerDetailBean::getScoreRate))
|
|
|
|
+ .getAverage();
|
|
|
|
+
|
|
|
|
+ // 学院id集合
|
|
|
|
+ List<Long> collegeIdList = taExamCourseRecordService.list(new QueryWrapper<TAExamCourseRecord>().lambda()
|
|
|
|
+ .eq(TAExamCourseRecord::getExamId,examId)
|
|
|
|
+ .eq(TAExamCourseRecord::getCourseCode,courseCode)
|
|
|
|
+ .eq(TAExamCourseRecord::getPaperId,paperId)
|
|
|
|
+ .eq(TAExamCourseRecord::getAbsent,false)
|
|
|
|
+ .eq(TAExamCourseRecord::getStudentCurrent,true))
|
|
|
|
+ .stream()
|
|
|
|
+ .map(TAExamCourseRecord::getInspectCollegeId).distinct()
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ for (Long collegeId : collegeIdList) {
|
|
|
|
+ List<AnswerDetailBean> answerDetailForCol = answerDetailForSch.stream()
|
|
|
|
+ .filter(e -> collegeId.equals(e.getCollegeId())).collect(Collectors.toList());
|
|
|
|
+
|
|
|
|
+ double colAvgScoreRate = answerDetailForCol.stream()
|
|
|
|
+ .collect(Collectors.summarizingDouble(AnswerDetailBean::getScoreRate))
|
|
|
|
+ .getAverage();
|
|
|
|
+
|
|
|
|
+ // 得分率保留2位小数处理
|
|
|
|
+ Integer count = questionList.size();
|
|
|
|
+
|
|
|
|
+ TAExamCourseDifficult taExamCourseDifficult = new TAExamCourseDifficult();
|
|
|
|
+ taExamCourseDifficult.setId(SystemConstant.getDbUuid());
|
|
|
|
+ taExamCourseDifficult.setExamId(examId);
|
|
|
|
+ taExamCourseDifficult.setCourseCode(effectiveCourseCode);
|
|
|
|
+ taExamCourseDifficult.setCourseName(basicCourseService.findByCourseCode(effectiveCourseCode).getName());
|
|
|
|
+ taExamCourseDifficult.setCollegeId(collegeId);
|
|
|
|
+ taExamCourseDifficult.setSchoolId(tbExamService.getById(examId).getSchoolId());
|
|
|
|
+ taExamCourseDifficult.setInterpret(interpret);
|
|
|
|
+ taExamCourseDifficult.setCount(count);
|
|
|
|
+ taExamCourseDifficult.setScope(scope);
|
|
|
|
+ taExamCourseDifficult.setSchAvgScoreRate(BigDecimal.valueOf(schAvgScoreRate));
|
|
|
|
+ taExamCourseDifficult.setColAvgScoreRate(BigDecimal.valueOf(colAvgScoreRate));
|
|
|
|
+
|
|
|
|
+ taExamCourseDifficultList.add(taExamCourseDifficult);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ taExamCourseDifficultService.saveBatch(taExamCourseDifficultList);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return "'t_a_exam_course_difficult' 表构建完成";
|
|
|
|
+ }
|
|
|
|
+
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Override
|
|
@Override
|
|
public String buildAnalyzeExamTotal(Long examId) {
|
|
public String buildAnalyzeExamTotal(Long examId) {
|