|
@@ -15,6 +15,7 @@ import com.qmth.teachcloud.common.util.Result;
|
|
|
import com.qmth.teachcloud.common.util.ResultUtil;
|
|
|
import com.qmth.teachcloud.common.util.ServletUtil;
|
|
|
import com.qmth.teachcloud.mark.entity.*;
|
|
|
+import com.qmth.teachcloud.mark.enums.AiQuestionParamModeStatus;
|
|
|
import com.qmth.teachcloud.mark.enums.MarkTaskStatus;
|
|
|
import com.qmth.teachcloud.mark.service.*;
|
|
|
import io.swagger.annotations.*;
|
|
@@ -163,7 +164,7 @@ public class MarkAiQuestionParamController {
|
|
|
levelList.sort(Comparator.comparing(MarkAiQuestionLevel::getMinScore));
|
|
|
Double minRangeScore = 0D;
|
|
|
for (MarkAiQuestionLevel aiQuestionLevel : levelList) {
|
|
|
- if(minRangeScore.doubleValue() - aiQuestionLevel.getMinScore().doubleValue() != 0){
|
|
|
+ if (minRangeScore.doubleValue() - aiQuestionLevel.getMinScore().doubleValue() != 0) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("区间分数必须从0开始,且区间分数段连续");
|
|
|
} else {
|
|
|
minRangeScore = aiQuestionLevel.getMaxScore();
|
|
@@ -219,8 +220,14 @@ public class MarkAiQuestionParamController {
|
|
|
markAiQuestionParamService.saveOrUpdate(markAiQuestionParam);
|
|
|
markQuestionService.updateAiMark(markAiQuestionParam.getExamId(), markAiQuestionParam.getPaperNumber(), markAiQuestionParam.getQuestionId());
|
|
|
|
|
|
- if (markAiQuestionParamService.existMarkAiQuestionPointOrLevel(markAiQuestionParam.getExamId(), markAiQuestionParam.getPaperNumber(), markAiQuestionParam.getQuestionId())
|
|
|
- && markTaskService.countByExamIdAndPaperNumberAndQuestionIdAndTaskNumberAndAiMarkedAndStatusNotIn(markAiQuestionParam.getExamId(), markAiQuestionParam.getPaperNumber(), markAiQuestionParam.getQuestionId(), 1, false, null) > 0) {
|
|
|
+ boolean existMarkAiQuestionPointOrLevel = markAiQuestionParamService.existMarkAiQuestionPointOrLevel(markAiQuestionParam.getExamId(), markAiQuestionParam.getPaperNumber(), markAiQuestionParam.getQuestionId());
|
|
|
+ int aiMarkedCount = markTaskService.countByExamIdAndPaperNumberAndQuestionIdAndTaskNumberAndAiMarkedAndStatusNotIn(markAiQuestionParam.getExamId(), markAiQuestionParam.getPaperNumber(), markAiQuestionParam.getQuestionId(), 1, true, Arrays.asList(MarkTaskStatus.MARKED));
|
|
|
+ if (!existMarkAiQuestionPointOrLevel && aiMarkedCount > 0) {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("已开始AI评卷,不能删除" + (AiQuestionParamModeStatus.POINT.equals(markAiQuestionParam.getMode()) ? "标答" : AiQuestionParamModeStatus.LEVEL.equals(markAiQuestionParam.getMode()) ? "档次" : ""));
|
|
|
+ }
|
|
|
+
|
|
|
+ int count = markTaskService.countByExamIdAndPaperNumberAndQuestionIdAndTaskNumberAndAiMarkedAndStatusNotIn(markAiQuestionParam.getExamId(), markAiQuestionParam.getPaperNumber(), markAiQuestionParam.getQuestionId(), 1, false, null);
|
|
|
+ if ((!existMarkAiQuestionPointOrLevel && aiMarkedCount == 0) || (existMarkAiQuestionPointOrLevel && count > 0)) {
|
|
|
markService.deleteMarkTask(markQuestion, true, true);
|
|
|
markService.checkStudentSubjectiveScore(markAiQuestionParam.getExamId(), markPaper.getCoursePaperId());
|
|
|
}
|