|
|
|
@ -12,7 +12,6 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @Author xcj
|
|
|
|
@ -72,11 +71,13 @@ public class StuIndexServiceImpl implements StuIndexService {
|
|
|
|
|
stuTheoryIndexInfoDto.setTaskNum(examSize);
|
|
|
|
|
|
|
|
|
|
ReceiveDto receiveDto = teaExamManageMapper.getLastExamScore(userId);//拿到最近考试的得分和 老师设置的题目总分
|
|
|
|
|
BigDecimal totalScore = receiveDto.getTotalScore();
|
|
|
|
|
BigDecimal stuScore = receiveDto.getStuScore();
|
|
|
|
|
if (totalScore.intValue()!=0&&stuScore.intValue()!=0){
|
|
|
|
|
BigDecimal bigDecimal = totalScore.divide(stuScore,2,RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); //学生得分 / 总分 * 100
|
|
|
|
|
stuTheoryIndexInfoDto.setLastTaskAccuracy(bigDecimal); //最近一次考核正确率
|
|
|
|
|
if (receiveDto != null) {
|
|
|
|
|
BigDecimal totalScore = receiveDto.getTotalScore();
|
|
|
|
|
BigDecimal stuScore = receiveDto.getStuScore();
|
|
|
|
|
if (totalScore.intValue() != 0 && stuScore.intValue() != 0) {
|
|
|
|
|
BigDecimal bigDecimal = totalScore.divide(stuScore, 2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)); //学生得分 / 总分 * 100
|
|
|
|
|
stuTheoryIndexInfoDto.setLastTaskAccuracy(bigDecimal); //最近一次考核正确率
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|