|
|
@@ -268,7 +268,7 @@ public class AIEvaluationService {
|
|
|
sentenceEvaluation.setStudentId(studentId);
|
|
|
sentenceEvaluation.setContent(content);
|
|
|
sentenceEvaluation.setNo(i+1);
|
|
|
- sentenceEvaluation.setSentence(res[i] + "\n");
|
|
|
+ sentenceEvaluation.setSentence(res[i] + ".");
|
|
|
sentenceEvaluation.setVersion(engagement.getVersion());
|
|
|
sentenceEvaluationMapper.insert(sentenceEvaluation);
|
|
|
|
|
|
@@ -286,15 +286,15 @@ public class AIEvaluationService {
|
|
|
* @return
|
|
|
*/
|
|
|
public String getRewrite(Long assignmentId, Long studentId, int version){
|
|
|
- QueryWrapper<SentenceEvaluation> queryWrapper = new QueryWrapper<>();
|
|
|
+ QueryWrapper<OverallEvaluation> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("assignment_id", assignmentId);
|
|
|
queryWrapper.eq("student_id", studentId);
|
|
|
queryWrapper.eq("version", version);
|
|
|
- SentenceEvaluation sentenceEvaluation = sentenceEvaluationMapper.selectOne(queryWrapper);
|
|
|
- if(sentenceEvaluation == null){
|
|
|
+ OverallEvaluation overallEvaluation = overallEvaluationMapper.selectOne(queryWrapper);
|
|
|
+ if(overallEvaluation == null){
|
|
|
throw MyException.create(HttpStatus.BAD_REQUEST, "AI批改不存在");
|
|
|
}
|
|
|
- return sentenceEvaluation.getContent();
|
|
|
+ return overallEvaluation.getEvaluation();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -311,6 +311,9 @@ public class AIEvaluationService {
|
|
|
queryWrapper.eq("version", version);
|
|
|
List<SentenceEvaluation> sentenceEvaluations = sentenceEvaluationMapper.selectList(queryWrapper);
|
|
|
|
|
|
+ if(sentenceEvaluations.isEmpty()){
|
|
|
+ throw MyException.create(HttpStatus.BAD_REQUEST, "AI批改不存在");
|
|
|
+ }
|
|
|
// 按no属性进行排序
|
|
|
return sentenceEvaluations.stream().sorted(Comparator.comparing(SentenceEvaluation::getNo)).toList();
|
|
|
}
|