|
|
|
@ -3,6 +3,7 @@ package com.ibeetl.jlw.service;
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import cn.hutool.core.lang.TypeReference;
|
|
|
|
|
import cn.hutool.core.map.MapUtil;
|
|
|
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
|
|
|
import cn.jlw.util.ToolUtils;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
@ -16,6 +17,7 @@ import com.ibeetl.jlw.dao.StudentHandsOnTaskTheoryDao;
|
|
|
|
|
import com.ibeetl.jlw.dao.TeacherOpenCourseHandsOnSimulationTasksDao;
|
|
|
|
|
import com.ibeetl.jlw.dao.TeacherOpenCourseMergeResourcesQuestionDao;
|
|
|
|
|
import com.ibeetl.jlw.entity.*;
|
|
|
|
|
import com.ibeetl.jlw.entity.dto.FillAndAnalysisScoreDTO;
|
|
|
|
|
import com.ibeetl.jlw.entity.vo.TeacherOpenCourseMergeResourcesQuestionVO;
|
|
|
|
|
import com.ibeetl.jlw.service.handson.HandsOnTaskQueue;
|
|
|
|
|
import com.ibeetl.jlw.service.handson.Record;
|
|
|
|
@ -41,6 +43,7 @@ import java.io.*;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import static com.ibeetl.admin.core.util.ExcelUtil.getCellFormatValue;
|
|
|
|
|
|
|
|
|
@ -500,23 +503,43 @@ public class StudentHandsOnTaskTheoryService extends CoreBaseService<StudentHand
|
|
|
|
|
taskTheory.setStem(resourcesQuestion.getQuestionStem());
|
|
|
|
|
Integer questionType = resourcesQuestion.getQuestionType();
|
|
|
|
|
taskTheory.setQuestionType(questionType);
|
|
|
|
|
taskTheory.setMyOptions(resourcesQuestion.getMyOptions());
|
|
|
|
|
String myOptions = resourcesQuestion.getMyOptions();
|
|
|
|
|
taskTheory.setMyOptions(myOptions);
|
|
|
|
|
TeacherOpenCourseMergeResourcesQuestion teacherOpenCourseMergeResourcesQuestion = resourcesQuestions.stream().filter(v -> v.getTeacherOpenCourseMergeResourcesQuestionId().equals(resourcesQuestion.getTeacherOpenCourseMergeResourcesQuestionId())).findFirst().orElse(new TeacherOpenCourseMergeResourcesQuestion());
|
|
|
|
|
taskTheory.setRightKey(teacherOpenCourseMergeResourcesQuestion.getQuestionAnswer());
|
|
|
|
|
if (teacherOpenCourseMergeResourcesQuestion.getQuestionAnswer().equals(resourcesQuestion.getMyOptions())) {
|
|
|
|
|
if (questionType.equals(1)) {
|
|
|
|
|
String questionAnswer = teacherOpenCourseMergeResourcesQuestion.getQuestionAnswer();
|
|
|
|
|
taskTheory.setRightKey(questionAnswer);
|
|
|
|
|
if (questionType.equals(1)) {
|
|
|
|
|
if (questionAnswer.contains(myOptions)) {
|
|
|
|
|
taskTheory.setTheoryScore(tasks.getSingleScore());
|
|
|
|
|
}else if (questionType.equals(2)){
|
|
|
|
|
}else {
|
|
|
|
|
taskTheory.setTheoryScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
|
}else if (questionType.equals(2)){
|
|
|
|
|
String[] split = questionAnswer.split(",");
|
|
|
|
|
String[] split1 = myOptions.split(",");
|
|
|
|
|
if (ArrayUtil.equals(split, split1)) {
|
|
|
|
|
taskTheory.setTheoryScore(tasks.getMultipleScore());
|
|
|
|
|
}else if (questionType.equals(3)){
|
|
|
|
|
}else {
|
|
|
|
|
taskTheory.setTheoryScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
|
}else if (questionType.equals(3)){
|
|
|
|
|
if (questionAnswer.contains(myOptions)) {
|
|
|
|
|
taskTheory.setTheoryScore(tasks.getJudgeScore());
|
|
|
|
|
}else if (questionType.equals(4)){
|
|
|
|
|
}else {
|
|
|
|
|
taskTheory.setTheoryScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
|
}else if (questionType.equals(4)){
|
|
|
|
|
if (questionAnswer.equals(myOptions)) {
|
|
|
|
|
taskTheory.setTheoryScore(tasks.getFillScore());
|
|
|
|
|
}else if (questionType.equals(5)){
|
|
|
|
|
}else {
|
|
|
|
|
taskTheory.setTheoryScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
|
}else if (questionType.equals(5)){
|
|
|
|
|
if (questionAnswer.equals(myOptions)) {
|
|
|
|
|
taskTheory.setTheoryScore(tasks.getAnalysisScore());
|
|
|
|
|
}else {
|
|
|
|
|
taskTheory.setTheoryScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
taskTheory.setTheoryScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
|
taskTheory.setCreateTime(new Date());
|
|
|
|
|
taskTheory.setStudentId(student.getStudentId());
|
|
|
|
@ -556,5 +579,29 @@ public class StudentHandsOnTaskTheoryService extends CoreBaseService<StudentHand
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 评分
|
|
|
|
|
* @param list
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public JsonResult<?> fillAndAnalysisScore(List<FillAndAnalysisScoreDTO> list) {
|
|
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
|
|
return JsonResult.fail();
|
|
|
|
|
}
|
|
|
|
|
List<Long> collect = list.stream().map(FillAndAnalysisScoreDTO::getStudentHandsOnTaskTheoryId).collect(Collectors.toList());
|
|
|
|
|
List<StudentHandsOnTaskTheory> handsOnTaskTheoryList = studentHandsOnTaskTheoryDao.createLambdaQuery().andIn(StudentHandsOnTaskTheory::getStudentHandsOnTaskTheoryId, collect).select();
|
|
|
|
|
if (CollectionUtils.isEmpty(handsOnTaskTheoryList)) {
|
|
|
|
|
return JsonResult.fail();
|
|
|
|
|
}
|
|
|
|
|
List<StudentHandsOnTaskTheory> collect1 = handsOnTaskTheoryList.stream().filter(v -> v.getQuestionType().equals(4) || v.getQuestionType().equals(5)).collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isEmpty(collect1)) {
|
|
|
|
|
return JsonResult.fail();
|
|
|
|
|
}
|
|
|
|
|
for (StudentHandsOnTaskTheory studentHandsOnTaskTheory : collect1) {
|
|
|
|
|
list.stream().filter(v -> v.getStudentHandsOnTaskTheoryId().equals(studentHandsOnTaskTheory.getStudentHandsOnTaskTheoryId())).findFirst().ifPresent(fillAndAnalysisScoreDTO ->
|
|
|
|
|
studentHandsOnTaskTheory.setTheoryScore(fillAndAnalysisScoreDTO.getScore()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|