|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.ibeetl.jlw.web;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import cn.jlw.Interceptor.GetFile;
|
|
|
|
|
import cn.jlw.Interceptor.RFile;
|
|
|
|
@ -41,6 +42,9 @@ import java.io.File;
|
|
|
|
|
import java.io.FileInputStream;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.io.InputStream;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.text.DecimalFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
@ -445,14 +449,14 @@ public class StudentHandsOnTaskTheoryController {
|
|
|
|
|
|
|
|
|
|
for (StudentHandsOnTaskTheory studentHandsOnTaskTheory : list) {
|
|
|
|
|
Integer questionType = studentHandsOnTaskTheory.getQuestionType();
|
|
|
|
|
studentHandsOnTaskTheory.set("questionTypeText",map.get(questionType));
|
|
|
|
|
studentHandsOnTaskTheory.set("questionTypeText", map.get(questionType));
|
|
|
|
|
String stem = studentHandsOnTaskTheory.getStem();
|
|
|
|
|
if (StringUtils.isNotBlank(stem)){
|
|
|
|
|
stem = stem.replace("<p>","")
|
|
|
|
|
.replace("</p>","")
|
|
|
|
|
.replace("<br>","")
|
|
|
|
|
.replace("<br/>","")
|
|
|
|
|
.replace("[---]","____");
|
|
|
|
|
if (StringUtils.isNotBlank(stem)) {
|
|
|
|
|
stem = stem.replace("<p>", "")
|
|
|
|
|
.replace("</p>", "")
|
|
|
|
|
.replace("<br>", "")
|
|
|
|
|
.replace("<br/>", "")
|
|
|
|
|
.replace("[---]", "____");
|
|
|
|
|
studentHandsOnTaskTheory.setStem(stem);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -501,7 +505,6 @@ public class StudentHandsOnTaskTheoryController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 提交
|
|
|
|
|
*
|
|
|
|
@ -538,6 +541,38 @@ public class StudentHandsOnTaskTheoryController {
|
|
|
|
|
return studentHandsOnTaskTheoryService.getHandsOnTaskkTheoryByTaskId(taskId, coreUser, 2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 理论测评查询学生做题详情-总分数,答对,答错,正确率
|
|
|
|
|
*
|
|
|
|
|
* @param taskId 实操任务id
|
|
|
|
|
* @param coreUser
|
|
|
|
|
* @return 学生选项 myOptions
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping(API + "/getHandsOnTaskkTheoryDetailByTaskIdTotal")
|
|
|
|
|
public JsonResult getHandsOnTaskkTheoryDetailByTaskIdTotal(Long taskId, @SCoreUser CoreUser coreUser) {
|
|
|
|
|
JsonResult<List<TeacherOpenCourseMergeResourcesQuestion>> handsOnTaskkTheoryByTaskId = studentHandsOnTaskTheoryService.getHandsOnTaskkTheoryByTaskId(taskId, coreUser, 2);
|
|
|
|
|
List<TeacherOpenCourseMergeResourcesQuestion> resourcesQuestions = handsOnTaskkTheoryByTaskId.getData();
|
|
|
|
|
BigDecimal totalScore = BigDecimal.ZERO;
|
|
|
|
|
int totalRight = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (TeacherOpenCourseMergeResourcesQuestion resourcesQuestion : resourcesQuestions) {
|
|
|
|
|
if (ObjectUtil.isNotEmpty(resourcesQuestion.getStudentScore()) && !ObjectUtil.equals(resourcesQuestion.getStudentScore(), BigDecimal.ZERO)) {
|
|
|
|
|
totalScore = totalScore.add(resourcesQuestion.getStudentScore());
|
|
|
|
|
totalRight += 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int size = resourcesQuestions.size();
|
|
|
|
|
DecimalFormat dt = new DecimalFormat("0.##");
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
map.put("totalTopic", size);
|
|
|
|
|
map.put("totalRight", totalRight);
|
|
|
|
|
map.put("totalWrong", size == 0 ? 0 : resourcesQuestions.size() - totalRight);
|
|
|
|
|
map.put("totalScore", totalScore);
|
|
|
|
|
map.put("accuracy", size == 0 ? 0 : dt.format(BigDecimal.valueOf(totalRight).divide(new BigDecimal(size), 2, RoundingMode.UP).multiply(BigDecimal.valueOf(100))));
|
|
|
|
|
return JsonResult.success(map);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 临时提交
|
|
|
|
|