|
|
|
@ -19,6 +19,7 @@ import com.ibeetl.jlw.dao.HandsOnDao;
|
|
|
|
|
import com.ibeetl.jlw.dao.StudentHandsOnTaskTheoryDao;
|
|
|
|
|
import com.ibeetl.jlw.entity.*;
|
|
|
|
|
import com.ibeetl.jlw.entity.dto.FillAndAnalysisScoreDTO;
|
|
|
|
|
import com.ibeetl.jlw.entity.vo.ResourcesQuestionVO;
|
|
|
|
|
import com.ibeetl.jlw.entity.vo.TeacherOpenCourseMergeResourcesQuestionVO;
|
|
|
|
|
import com.ibeetl.jlw.enums.HandsOnTaskEnum;
|
|
|
|
|
import com.ibeetl.jlw.service.handson.HandsOnTaskQueue;
|
|
|
|
@ -966,43 +967,37 @@ public class StudentHandsOnTaskTheoryService extends CoreBaseService<StudentHand
|
|
|
|
|
|
|
|
|
|
List<StudentHandsOnTaskTheory> taskTheoryList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
//1 教师开课 2 系统授权
|
|
|
|
|
if (ObjectUtil.equals(courseType, 2)) {
|
|
|
|
|
HandsOnSimulationTasksQuery simulationTasksQuery = new HandsOnSimulationTasksQuery();
|
|
|
|
|
simulationTasksQuery.setTaskId(taskId);
|
|
|
|
|
List<HandsOnSimulationTasks> handsOnSimulationTasksList = handsOnSimulationTasksService.getValuesByQueryNotPermission(simulationTasksQuery);
|
|
|
|
|
if (CollectionUtils.isEmpty(handsOnSimulationTasksList)) {
|
|
|
|
|
TeacherOpenCourseHandsOnSimulationTasksQuery tasksQuery = new TeacherOpenCourseHandsOnSimulationTasksQuery();
|
|
|
|
|
tasksQuery.setTaskId(taskId);
|
|
|
|
|
List<TeacherOpenCourseHandsOnSimulationTasks> tasksList = teacherOpenCourseHandsOnSimulationTasksService.getValuesByQueryNotWithPermission(tasksQuery);
|
|
|
|
|
if (CollectionUtils.isEmpty(tasksList)) {
|
|
|
|
|
return JsonResult.fail();
|
|
|
|
|
}
|
|
|
|
|
HandsOnSimulationTasks handsOnSimulationTasks = handsOnSimulationTasksList.get(0);
|
|
|
|
|
|
|
|
|
|
handsOnId = handsOnSimulationTasks.getHandsOnId();
|
|
|
|
|
|
|
|
|
|
String taskList = handsOnSimulationTasks.getTaskList();
|
|
|
|
|
ResourcesQuestionQuery questionQuery = new ResourcesQuestionQuery();
|
|
|
|
|
questionQuery.setResourcesQuestionIds(taskList);
|
|
|
|
|
List<ResourcesQuestion> resourcesQuestionList = resourcesQuestionService.getValuesByQueryNotWithPermission(questionQuery);
|
|
|
|
|
TeacherOpenCourseHandsOnSimulationTasks tasks = tasksList.get(0);
|
|
|
|
|
handsOnId = tasks.getHandsOnId();
|
|
|
|
|
String taskList = tasks.getTaskList();
|
|
|
|
|
TeacherOpenCourseMergeResourcesQuestionQuery questionQuery = new TeacherOpenCourseMergeResourcesQuestionQuery();
|
|
|
|
|
questionQuery.setTeacherOpenCourseMergeResourcesQuestionIdPlural(taskList);
|
|
|
|
|
List<TeacherOpenCourseMergeResourcesQuestion> resourcesQuestions = teacherOpenCourseMergeResourcesQuestionService.getValuesByQueryNotWithPermission(questionQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (TeacherOpenCourseMergeResourcesQuestionVO resourcesQuestion : teacherOpenCourseMergeResourcesQuestionQueries) {
|
|
|
|
|
//根据实操id 获取课程id
|
|
|
|
|
List<HandsOn> handsOns = ObjectUtil.isEmpty(handsOnSimulationTasks.getHandsOnId()) ? new ArrayList<>() : handsOnDao.getByIds(handsOnSimulationTasks.getHandsOnId().toString());
|
|
|
|
|
StudentHandsOnTaskTheory taskTheory = new StudentHandsOnTaskTheory();
|
|
|
|
|
taskTheory.setCourseType(courseType);
|
|
|
|
|
taskTheory.setTeacherOpenCourseId(CollectionUtils.isEmpty(handsOns) ? null : handsOns.get(0).getCourseInfoId());
|
|
|
|
|
taskTheory.setHandsOnId(handsOnSimulationTasks.getHandsOnId());
|
|
|
|
|
taskTheory.setHandsOnTaskId(handsOnSimulationTasks.getTaskId());
|
|
|
|
|
taskTheory.setTeacherOpenCourseId(tasks.getTeacherOpenCourseId());
|
|
|
|
|
taskTheory.setHandsOnId(tasks.getHandsOnId());
|
|
|
|
|
taskTheory.setHandsOnTaskId(tasks.getTaskId());
|
|
|
|
|
taskTheory.setStem(resourcesQuestion.getQuestionStem());
|
|
|
|
|
Integer questionType = resourcesQuestion.getQuestionType();
|
|
|
|
|
taskTheory.setQuestionType(questionType);
|
|
|
|
|
String myOptions = ObjectUtil.defaultIfBlank(resourcesQuestion.getMyOptions(), "");
|
|
|
|
|
taskTheory.setMyOptions(myOptions);
|
|
|
|
|
ResourcesQuestion resourcesQuestionItem = resourcesQuestionList.stream().filter(v -> v.getResourcesQuestionId().equals(resourcesQuestion.getTeacherOpenCourseMergeResourcesQuestionId())).findFirst().orElse(new ResourcesQuestion());
|
|
|
|
|
String questionAnswer = ObjectUtil.defaultIfBlank(resourcesQuestionItem.getQuestionAnswer(), "");
|
|
|
|
|
TeacherOpenCourseMergeResourcesQuestion teacherOpenCourseMergeResourcesQuestion = resourcesQuestions.stream().filter(v -> v.getTeacherOpenCourseMergeResourcesQuestionId().equals(resourcesQuestion.getTeacherOpenCourseMergeResourcesQuestionId())).findFirst().orElse(new TeacherOpenCourseMergeResourcesQuestion());
|
|
|
|
|
String questionAnswer = ObjectUtil.defaultIfBlank(teacherOpenCourseMergeResourcesQuestion.getQuestionAnswer(), "");
|
|
|
|
|
taskTheory.setRightKey(questionAnswer);
|
|
|
|
|
if (questionType.equals(1)) {
|
|
|
|
|
if (questionAnswer.contains(myOptions)) {
|
|
|
|
|
taskTheory.setTheoryScore(handsOnSimulationTasks.getSingleScore());
|
|
|
|
|
taskTheory.setTheoryScore(tasks.getSingleScore());
|
|
|
|
|
} else {
|
|
|
|
|
taskTheory.setTheoryScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
@ -1011,25 +1006,25 @@ public class StudentHandsOnTaskTheoryService extends CoreBaseService<StudentHand
|
|
|
|
|
String[] split1 = Arrays.stream(myOptions.split(",")).sorted().toArray(String[]::new);
|
|
|
|
|
;
|
|
|
|
|
if (ArrayUtil.equals(split, split1)) {
|
|
|
|
|
taskTheory.setTheoryScore(handsOnSimulationTasks.getMultipleScore());
|
|
|
|
|
taskTheory.setTheoryScore(tasks.getMultipleScore());
|
|
|
|
|
} else {
|
|
|
|
|
taskTheory.setTheoryScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
|
} else if (questionType.equals(3)) {
|
|
|
|
|
if (questionAnswer.contains(myOptions)) {
|
|
|
|
|
taskTheory.setTheoryScore(handsOnSimulationTasks.getJudgeScore());
|
|
|
|
|
taskTheory.setTheoryScore(tasks.getJudgeScore());
|
|
|
|
|
} else {
|
|
|
|
|
taskTheory.setTheoryScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
|
} else if (questionType.equals(4)) {
|
|
|
|
|
if (questionAnswer.equals(myOptions)) {
|
|
|
|
|
taskTheory.setTheoryScore(handsOnSimulationTasks.getFillScore());
|
|
|
|
|
taskTheory.setTheoryScore(tasks.getFillScore());
|
|
|
|
|
} else {
|
|
|
|
|
taskTheory.setTheoryScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
|
} else if (questionType.equals(5)) {
|
|
|
|
|
if (questionAnswer.equals(myOptions)) {
|
|
|
|
|
taskTheory.setTheoryScore(handsOnSimulationTasks.getAnalysisScore());
|
|
|
|
|
taskTheory.setTheoryScore(tasks.getAnalysisScore());
|
|
|
|
|
} else {
|
|
|
|
|
taskTheory.setTheoryScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
@ -1042,39 +1037,119 @@ public class StudentHandsOnTaskTheoryService extends CoreBaseService<StudentHand
|
|
|
|
|
taskTheoryList.add(taskTheory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
TeacherOpenCourseHandsOnSimulationTasksQuery tasksQuery = new TeacherOpenCourseHandsOnSimulationTasksQuery();
|
|
|
|
|
tasksQuery.setTaskId(taskId);
|
|
|
|
|
List<TeacherOpenCourseHandsOnSimulationTasks> tasksList = teacherOpenCourseHandsOnSimulationTasksService.getValuesByQueryNotWithPermission(tasksQuery);
|
|
|
|
|
if (CollectionUtils.isEmpty(tasksList)) {
|
|
|
|
|
//更新成绩
|
|
|
|
|
if (CollUtil.isNotEmpty(taskTheoryList)) {
|
|
|
|
|
BigDecimal totalScore = new BigDecimal(0);
|
|
|
|
|
for (StudentHandsOnTaskTheory studentHandsOnTaskTheory : taskTheoryList) {
|
|
|
|
|
BigDecimal theoryScore = studentHandsOnTaskTheory.getTheoryScore();
|
|
|
|
|
totalScore = totalScore.add(ObjectUtil.defaultIfNull(theoryScore, BigDecimal.ZERO));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HandsOnAchievement build = HandsOnAchievement.builder()
|
|
|
|
|
.handOnId(handsOnId)
|
|
|
|
|
.studentId(student.getStudentId())
|
|
|
|
|
.classId(student.getClassId())
|
|
|
|
|
.theoryScore(totalScore.toPlainString())
|
|
|
|
|
.courseType(courseType)
|
|
|
|
|
.isCourseCentre(2)
|
|
|
|
|
.orgId(student.getOrgId())
|
|
|
|
|
.userId(student.getUserId()).build();
|
|
|
|
|
handsOnAchievementService.setHandsOnAchievement(build, HandsOnTaskEnum.TASK_THEORY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.insertBatch(taskTheoryList);
|
|
|
|
|
questions.remove(s);
|
|
|
|
|
return JsonResult.success("提交成功");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 课程中心添加(授权课程) 添加任务 理论测评
|
|
|
|
|
*
|
|
|
|
|
* @param
|
|
|
|
|
* @param coreUser
|
|
|
|
|
* @param i 1强制提交 2临时提交
|
|
|
|
|
* @param courseType 1 教师开课 2 系统授权
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public JsonResult<String> addSystemTheoreticalEvaluation(List<ResourcesQuestionVO> resourcesQuestionQueries, CoreUser coreUser, int i, int courseType) {
|
|
|
|
|
//查询登录用的学生id
|
|
|
|
|
if (!coreUser.isStudent()) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtils.isEmpty(resourcesQuestionQueries)) {
|
|
|
|
|
return JsonResult.fail();
|
|
|
|
|
}
|
|
|
|
|
TeacherOpenCourseHandsOnSimulationTasks tasks = tasksList.get(0);
|
|
|
|
|
handsOnId = tasks.getHandsOnId();
|
|
|
|
|
String taskList = tasks.getTaskList();
|
|
|
|
|
TeacherOpenCourseMergeResourcesQuestionQuery questionQuery = new TeacherOpenCourseMergeResourcesQuestionQuery();
|
|
|
|
|
questionQuery.setTeacherOpenCourseMergeResourcesQuestionIdPlural(taskList);
|
|
|
|
|
List<TeacherOpenCourseMergeResourcesQuestion> resourcesQuestions = teacherOpenCourseMergeResourcesQuestionService.getValuesByQueryNotWithPermission(questionQuery);
|
|
|
|
|
Long taskId = Long.parseLong(resourcesQuestionQueries.get(0).getTaskId() + "");
|
|
|
|
|
Student student = studentService.getByUserId(coreUser.getId());
|
|
|
|
|
String s = student.getStudentId() + "&" + taskId;
|
|
|
|
|
//如果==2 说明是临时保存
|
|
|
|
|
if (i == 2) {
|
|
|
|
|
Map<String, Object> map = questions.get(s);
|
|
|
|
|
Record record = MapUtil.get(map, "record", Record.class);
|
|
|
|
|
Map<String, Object> map1 = new HashMap<>();
|
|
|
|
|
map1.put("resourcesQuestions", resourcesQuestionQueries);
|
|
|
|
|
if (record == null) {
|
|
|
|
|
record = new Record();
|
|
|
|
|
record.setStudentId(student.getStudentId());
|
|
|
|
|
record.setTaskId(taskId);
|
|
|
|
|
Date date = new Date();
|
|
|
|
|
record.setStartTime(date);
|
|
|
|
|
record.setEndTime(DateUtil.offsetHour(date, 3));
|
|
|
|
|
}
|
|
|
|
|
map1.put("record", record);
|
|
|
|
|
questions.put(s, map1);
|
|
|
|
|
return JsonResult.success("临时保存成功");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<StudentHandsOnTaskTheory> theoryList = this.sqlManager.lambdaQuery(StudentHandsOnTaskTheory.class).andEq(StudentHandsOnTaskTheory::getHandsOnTaskId, taskId)
|
|
|
|
|
.andEq(StudentHandsOnTaskTheory::getCourseType, courseType)
|
|
|
|
|
.andEq(StudentHandsOnTaskTheory::getIsCourseCentre,2)
|
|
|
|
|
.andEq(StudentHandsOnTaskTheory::getStudentId, student.getStudentId()).select();
|
|
|
|
|
if (CollectionUtils.isNotEmpty(theoryList)) {
|
|
|
|
|
return JsonResult.fail("已提交,重复提交");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Long handsOnId = null;
|
|
|
|
|
|
|
|
|
|
for (TeacherOpenCourseMergeResourcesQuestionVO resourcesQuestion : teacherOpenCourseMergeResourcesQuestionQueries) {
|
|
|
|
|
List<StudentHandsOnTaskTheory> taskTheoryList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
HandsOnSimulationTasksQuery simulationTasksQuery = new HandsOnSimulationTasksQuery();
|
|
|
|
|
simulationTasksQuery.setTaskId(taskId);
|
|
|
|
|
List<HandsOnSimulationTasks> handsOnSimulationTasksList = handsOnSimulationTasksService.getValuesByQueryNotPermission(simulationTasksQuery);
|
|
|
|
|
if (CollectionUtils.isEmpty(handsOnSimulationTasksList)) {
|
|
|
|
|
return JsonResult.fail();
|
|
|
|
|
}
|
|
|
|
|
HandsOnSimulationTasks handsOnSimulationTasks = handsOnSimulationTasksList.get(0);
|
|
|
|
|
|
|
|
|
|
handsOnId = handsOnSimulationTasks.getHandsOnId();
|
|
|
|
|
|
|
|
|
|
String taskList = handsOnSimulationTasks.getTaskList();
|
|
|
|
|
ResourcesQuestionQuery questionQuery = new ResourcesQuestionQuery();
|
|
|
|
|
questionQuery.setResourcesQuestionIds(taskList);
|
|
|
|
|
List<ResourcesQuestion> resourcesQuestionList = resourcesQuestionService.getValuesByQueryNotWithPermission(questionQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (ResourcesQuestionVO resourcesQuestion : resourcesQuestionQueries) {
|
|
|
|
|
//根据实操id 获取课程id
|
|
|
|
|
List<HandsOn> handsOns = ObjectUtil.isEmpty(handsOnSimulationTasks.getHandsOnId()) ? new ArrayList<>() : handsOnDao.getByIds(handsOnSimulationTasks.getHandsOnId().toString());
|
|
|
|
|
StudentHandsOnTaskTheory taskTheory = new StudentHandsOnTaskTheory();
|
|
|
|
|
taskTheory.setCourseType(courseType);
|
|
|
|
|
taskTheory.setTeacherOpenCourseId(tasks.getTeacherOpenCourseId());
|
|
|
|
|
taskTheory.setHandsOnId(tasks.getHandsOnId());
|
|
|
|
|
taskTheory.setHandsOnTaskId(tasks.getTaskId());
|
|
|
|
|
taskTheory.setTeacherOpenCourseId(CollectionUtils.isEmpty(handsOns) ? null : handsOns.get(0).getCourseInfoId());
|
|
|
|
|
taskTheory.setHandsOnId(handsOnSimulationTasks.getHandsOnId());
|
|
|
|
|
taskTheory.setHandsOnTaskId(handsOnSimulationTasks.getTaskId());
|
|
|
|
|
taskTheory.setStem(resourcesQuestion.getQuestionStem());
|
|
|
|
|
Integer questionType = resourcesQuestion.getQuestionType();
|
|
|
|
|
taskTheory.setQuestionType(questionType);
|
|
|
|
|
String myOptions = ObjectUtil.defaultIfBlank(resourcesQuestion.getMyOptions(), "");
|
|
|
|
|
taskTheory.setMyOptions(myOptions);
|
|
|
|
|
TeacherOpenCourseMergeResourcesQuestion teacherOpenCourseMergeResourcesQuestion = resourcesQuestions.stream().filter(v -> v.getTeacherOpenCourseMergeResourcesQuestionId().equals(resourcesQuestion.getTeacherOpenCourseMergeResourcesQuestionId())).findFirst().orElse(new TeacherOpenCourseMergeResourcesQuestion());
|
|
|
|
|
String questionAnswer = ObjectUtil.defaultIfBlank(teacherOpenCourseMergeResourcesQuestion.getQuestionAnswer(), "");
|
|
|
|
|
ResourcesQuestion resourcesQuestionItem = resourcesQuestionList.stream().filter(v -> v.getResourcesQuestionId().equals(resourcesQuestion.getResourcesQuestionId())).findFirst().orElse(new ResourcesQuestion());
|
|
|
|
|
String questionAnswer = ObjectUtil.defaultIfBlank(resourcesQuestionItem.getQuestionAnswer(), "");
|
|
|
|
|
taskTheory.setRightKey(questionAnswer);
|
|
|
|
|
if (questionType.equals(1)) {
|
|
|
|
|
if (questionAnswer.contains(myOptions)) {
|
|
|
|
|
taskTheory.setTheoryScore(tasks.getSingleScore());
|
|
|
|
|
taskTheory.setTheoryScore(handsOnSimulationTasks.getSingleScore());
|
|
|
|
|
} else {
|
|
|
|
|
taskTheory.setTheoryScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
@ -1083,25 +1158,25 @@ public class StudentHandsOnTaskTheoryService extends CoreBaseService<StudentHand
|
|
|
|
|
String[] split1 = Arrays.stream(myOptions.split(",")).sorted().toArray(String[]::new);
|
|
|
|
|
;
|
|
|
|
|
if (ArrayUtil.equals(split, split1)) {
|
|
|
|
|
taskTheory.setTheoryScore(tasks.getMultipleScore());
|
|
|
|
|
taskTheory.setTheoryScore(handsOnSimulationTasks.getMultipleScore());
|
|
|
|
|
} else {
|
|
|
|
|
taskTheory.setTheoryScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
|
} else if (questionType.equals(3)) {
|
|
|
|
|
if (questionAnswer.contains(myOptions)) {
|
|
|
|
|
taskTheory.setTheoryScore(tasks.getJudgeScore());
|
|
|
|
|
taskTheory.setTheoryScore(handsOnSimulationTasks.getJudgeScore());
|
|
|
|
|
} else {
|
|
|
|
|
taskTheory.setTheoryScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
|
} else if (questionType.equals(4)) {
|
|
|
|
|
if (questionAnswer.equals(myOptions)) {
|
|
|
|
|
taskTheory.setTheoryScore(tasks.getFillScore());
|
|
|
|
|
taskTheory.setTheoryScore(handsOnSimulationTasks.getFillScore());
|
|
|
|
|
} else {
|
|
|
|
|
taskTheory.setTheoryScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
|
} else if (questionType.equals(5)) {
|
|
|
|
|
if (questionAnswer.equals(myOptions)) {
|
|
|
|
|
taskTheory.setTheoryScore(tasks.getAnalysisScore());
|
|
|
|
|
taskTheory.setTheoryScore(handsOnSimulationTasks.getAnalysisScore());
|
|
|
|
|
} else {
|
|
|
|
|
taskTheory.setTheoryScore(BigDecimal.ZERO);
|
|
|
|
|
}
|
|
|
|
@ -1110,12 +1185,10 @@ public class StudentHandsOnTaskTheoryService extends CoreBaseService<StudentHand
|
|
|
|
|
taskTheory.setCreateTime(new Date());
|
|
|
|
|
taskTheory.setStudentId(student.getStudentId());
|
|
|
|
|
taskTheory.setUserId(coreUser.getId());
|
|
|
|
|
taskTheory.setOrgId(resourcesQuestion.getTeacherOpenCourseMergeResourcesQuestionId());
|
|
|
|
|
taskTheory.setOrgId(resourcesQuestion.getOrgId());
|
|
|
|
|
taskTheoryList.add(taskTheory);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//更新成绩
|
|
|
|
|
if (CollUtil.isNotEmpty(taskTheoryList)) {
|
|
|
|
|