|
|
@@ -13,6 +13,7 @@ import cn.iselab.mooctest.site.web.data.forMongo.MutationForMongoDTO;
|
|
|
import cn.iselab.mooctest.site.web.data.fromDev.StResponse;
|
|
|
import cn.iselab.mooctest.site.web.exception.HttpBadRequestException;
|
|
|
import cn.iselab.mooctest.site.web.exception.IllegalOperationException;
|
|
|
+import cn.iselab.mooctest.site.web.logic.BaseLogic;
|
|
|
import cn.iselab.mooctest.site.web.logic.CalculateSocreLogic;
|
|
|
import cn.iselab.mooctest.site.web.logic.fromDev.APFDLogic;
|
|
|
import cn.iselab.mooctest.site.web.data.forMongo.MutationForMongoDTO;
|
|
|
@@ -31,7 +32,7 @@ import java.util.stream.Collectors;
|
|
|
* @date 2017-09-05.
|
|
|
*/
|
|
|
@Service
|
|
|
-public class APFDLogicImpl implements APFDLogic {
|
|
|
+public class APFDLogicImpl extends BaseLogic implements APFDLogic{
|
|
|
|
|
|
@Autowired
|
|
|
CaseService caseService;
|
|
|
@@ -69,8 +70,10 @@ public class APFDLogicImpl implements APFDLogic {
|
|
|
if(participantId==null) {
|
|
|
List<AssignedTask> assignedTasks = assignedTaskService.getSubmittedRecordsByExamId(examId);
|
|
|
List<Long> submittedWorkerIds = assignedTasks.stream().map(assignedTask -> assignedTask.getParticipantId()).collect(Collectors.toList());
|
|
|
+ LOG.info("---------------------------------start apfd analysis--------------------------------");
|
|
|
List<ApbcDTO> apbcDTOList = submittedWorkerIds.stream().map(submittedWorkerId ->
|
|
|
getAPFDAnalyseByExamIdAndParticipantId(examId,caseId,submittedWorkerId,weight)).collect(Collectors.toList());
|
|
|
+ LOG.info("---------------------------------end apfd analysis--------------------------------");
|
|
|
if (apbcDTOList.size() != 0 && !apbcDTOList.isEmpty()) {
|
|
|
return StResponse.success(apbcDTOList);
|
|
|
} else {
|
|
|
@@ -107,8 +110,10 @@ public class APFDLogicImpl implements APFDLogic {
|
|
|
if(participantId==null) {
|
|
|
List<AssignedTask> assignedTasks = assignedTaskService.getSubmittedRecordsByExamId(examId);
|
|
|
List<Long> submittedWorkerIds = assignedTasks.stream().map(assignedTask -> assignedTask.getParticipantId()).collect(Collectors.toList());
|
|
|
+ LOG.info("---------------------------------start mutation analysis--------------------------------");
|
|
|
List<MutationDTO> mutationDTOS =submittedWorkerIds.stream().map( submittedWorkerId ->
|
|
|
getMutationAnalyseByExamIdAndParticipantId(examId,caseId,submittedWorkerId)).filter(dTO-> dTO!=null).collect(Collectors.toList());
|
|
|
+ LOG.info("---------------------------------end mutation analysis--------------------------------");
|
|
|
if (mutationDTOS.size() != 0 && !mutationDTOS.isEmpty()) {
|
|
|
return StResponse.success(mutationDTOS);
|
|
|
} else {
|
|
|
@@ -134,12 +139,12 @@ public class APFDLogicImpl implements APFDLogic {
|
|
|
double mutationScore=0;
|
|
|
if(mutationDTO.getTotal()!=0)
|
|
|
mutationScore= (double) mutationDTO.getKilled() / mutationDTO.getTotal() * 100;
|
|
|
- List<Grade> grades = analysisService.saveMutationScore(participantId, examId, caseId, mutationScore);
|
|
|
- if (grades != null && !grades.isEmpty()) {
|
|
|
- calculateScoreService.calculatePersonalDevScore(examId, caseId, participantId);
|
|
|
- calculateSocreLogic.calculateExamScoreAuto(examId,participantId);
|
|
|
- }
|
|
|
try {
|
|
|
+ List<Grade> grades = analysisService.saveMutationScore(participantId, examId, caseId, mutationScore);
|
|
|
+ if (grades != null && !grades.isEmpty()) {
|
|
|
+ calculateScoreService.calculatePersonalDevScore(examId, caseId, participantId);
|
|
|
+ calculateSocreLogic.calculateExamScoreAuto(examId,participantId);
|
|
|
+ }
|
|
|
List<MutationForMongoDTO> list = mongoAPIService.getMutationFromMongo(participantId, examId, caseId);
|
|
|
if(list!=null) {
|
|
|
MutationForMongoDTO mutationForMongoDTO = list.get(0);
|