|
@@ -1,6 +1,7 @@
|
|
|
package cn.iselab.mooctest.site.web.logic.fromDev.impl;
|
|
package cn.iselab.mooctest.site.web.logic.fromDev.impl;
|
|
|
|
|
|
|
|
import cn.iselab.mooctest.site.models.AssignedTask;
|
|
import cn.iselab.mooctest.site.models.AssignedTask;
|
|
|
|
|
+import cn.iselab.mooctest.site.models.Exam2Case;
|
|
|
import cn.iselab.mooctest.site.models.Grade;
|
|
import cn.iselab.mooctest.site.models.Grade;
|
|
|
import cn.iselab.mooctest.site.models.Weight;
|
|
import cn.iselab.mooctest.site.models.Weight;
|
|
|
import cn.iselab.mooctest.site.rpc.dev.data.ApbcDTO;
|
|
import cn.iselab.mooctest.site.rpc.dev.data.ApbcDTO;
|
|
@@ -106,10 +107,7 @@ public class APFDLogicImpl implements APFDLogic {
|
|
|
List<AssignedTask> assignedTasks = assignedTaskService.getSubmittedRecordsByExamId(examId);
|
|
List<AssignedTask> assignedTasks = assignedTaskService.getSubmittedRecordsByExamId(examId);
|
|
|
List<Long> submittedWorkerIds = assignedTasks.stream().map(assignedTask -> assignedTask.getParticipantId()).collect(Collectors.toList());
|
|
List<Long> submittedWorkerIds = assignedTasks.stream().map(assignedTask -> assignedTask.getParticipantId()).collect(Collectors.toList());
|
|
|
List<MutationDTO> mutationDTOS =submittedWorkerIds.stream().map( submittedWorkerId ->
|
|
List<MutationDTO> mutationDTOS =submittedWorkerIds.stream().map( submittedWorkerId ->
|
|
|
- getMutationAnalyseByExamIdAndParticipantId(examId,caseId,submittedWorkerId)).collect(Collectors.toList());
|
|
|
|
|
- for(Long submittedWorkerId:submittedWorkerIds){
|
|
|
|
|
- mutationDTOS.add(getMutationAnalyseByExamIdAndParticipantId(examId,caseId,submittedWorkerId));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ getMutationAnalyseByExamIdAndParticipantId(examId,caseId,submittedWorkerId)).filter(dTO-> dTO!=null).collect(Collectors.toList());
|
|
|
if (mutationDTOS.size() != 0 && !mutationDTOS.isEmpty()) {
|
|
if (mutationDTOS.size() != 0 && !mutationDTOS.isEmpty()) {
|
|
|
return StResponse.success(mutationDTOS);
|
|
return StResponse.success(mutationDTOS);
|
|
|
} else {
|
|
} else {
|
|
@@ -122,11 +120,18 @@ public class APFDLogicImpl implements APFDLogic {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public MutationDTO getMutationAnalyseByExamIdAndParticipantId(Long examId, Long caseId, Long participantId){
|
|
public MutationDTO getMutationAnalyseByExamIdAndParticipantId(Long examId, Long caseId, Long participantId){
|
|
|
- MutationDTO mutationDTO = analysisService.mutationAnalyze(examId, participantId, caseId);
|
|
|
|
|
|
|
+ MutationDTO mutationDTO;
|
|
|
|
|
+ try {
|
|
|
|
|
+ mutationDTO = analysisService.mutationAnalyze(examId, participantId, caseId);
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
if (mutationDTO == null) {
|
|
if (mutationDTO == null) {
|
|
|
throw new HttpBadRequestException("Fail to get 变异分析 of No." + caseId);
|
|
throw new HttpBadRequestException("Fail to get 变异分析 of No." + caseId);
|
|
|
} else {
|
|
} else {
|
|
|
- double mutationScore = (double) mutationDTO.getKilled() / mutationDTO.getTotal() * 100;
|
|
|
|
|
|
|
+ double mutationScore=0;
|
|
|
|
|
+ if(mutationDTO.getTotal()!=0)
|
|
|
|
|
+ mutationScore= (double) mutationDTO.getKilled() / mutationDTO.getTotal() * 100;
|
|
|
List<Grade> grades = analysisService.saveMutationScore(participantId, examId, caseId, mutationScore);
|
|
List<Grade> grades = analysisService.saveMutationScore(participantId, examId, caseId, mutationScore);
|
|
|
if (grades != null && !grades.isEmpty()) {
|
|
if (grades != null && !grades.isEmpty()) {
|
|
|
calculateScoreService.calculatePersonalDevScore(examId, caseId, participantId);
|
|
calculateScoreService.calculatePersonalDevScore(examId, caseId, participantId);
|