【修改】考试任务下的学生考完试,看不见刚考的任务
This commit is contained in:
@@ -153,6 +153,16 @@ public class ExamQuestionController
|
|||||||
return success(examQuestionService.updateExamQuestion(examQuestion));
|
return success(examQuestionService.updateExamQuestion(examQuestion));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改试题(hyc) 无租户id
|
||||||
|
*/
|
||||||
|
@PutMapping("/NoAudit")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult editNoAudit(@RequestBody ExamQuestion examQuestion)
|
||||||
|
{
|
||||||
|
return success(examQuestionService.updateExamQuestion(examQuestion));
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 删除试题(hyc)
|
* 删除试题(hyc)
|
||||||
*/
|
*/
|
||||||
|
@@ -11,6 +11,7 @@ import pc.exam.pp.module.exam.controller.admin.paper.vo.DeleteRequestVo;
|
|||||||
import pc.exam.pp.module.exam.dal.dataobject.monitor.MonitorDO;
|
import pc.exam.pp.module.exam.dal.dataobject.monitor.MonitorDO;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,4 +55,6 @@ return selectPage(reqVO, new LambdaQueryWrapperX<MonitorDO>()
|
|||||||
|
|
||||||
String selectByStuIdAndTaskIdNew(Long stuId, String taskId);
|
String selectByStuIdAndTaskIdNew(Long stuId, String taskId);
|
||||||
|
|
||||||
|
List<String> selectByStuIdAndTaskId(Long stuId);
|
||||||
|
|
||||||
}
|
}
|
@@ -472,10 +472,9 @@ public class EducationPaperTaskServiceImpl implements IEducationPaperTaskService
|
|||||||
String taskType = educationPaperTask.getTaskType();
|
String taskType = educationPaperTask.getTaskType();
|
||||||
|
|
||||||
PageResult<EducationPaperTask> educationPaperTasks = educationPaperTaskMapper.selectEducationPaperTaskList(educationPaperTask);
|
PageResult<EducationPaperTask> educationPaperTasks = educationPaperTaskMapper.selectEducationPaperTaskList(educationPaperTask);
|
||||||
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
Long stuId= SecurityFrameworkUtils.getLoginUserId();
|
||||||
|
|
||||||
List<EducationPaperTask> list = educationPaperTasks.getList();
|
List<EducationPaperTask> list = educationPaperTasks.getList();
|
||||||
List<String > taskIds= educationPaperPersonMapper.selectTaskIdByStuid(loginUserId);
|
List<String > taskIds= educationPaperPersonMapper.selectTaskIdByStuid(stuId);
|
||||||
if (list!=null&&list.size()>0&&taskIds!=null&&taskIds.size()>0){
|
if (list!=null&&list.size()>0&&taskIds!=null&&taskIds.size()>0){
|
||||||
list = list.stream()
|
list = list.stream()
|
||||||
.filter(task -> taskIds.contains(task.getTaskId()))
|
.filter(task -> taskIds.contains(task.getTaskId()))
|
||||||
@@ -485,7 +484,7 @@ public class EducationPaperTaskServiceImpl implements IEducationPaperTaskService
|
|||||||
String taskId = paperTask.getTaskId();
|
String taskId = paperTask.getTaskId();
|
||||||
EducationPaperParam educationPaperParam = educationPaperParamMapper.selectEducationPaperParamByTaskId(taskId);
|
EducationPaperParam educationPaperParam = educationPaperParamMapper.selectEducationPaperParamByTaskId(taskId);
|
||||||
//最高成绩
|
//最高成绩
|
||||||
Long stuId= SecurityFrameworkUtils.getLoginUserId();
|
|
||||||
if ("0".equals(educationPaperParam.getSaveGrades())){
|
if ("0".equals(educationPaperParam.getSaveGrades())){
|
||||||
|
|
||||||
String score= monitorMapper.selectByStuIdAndTaskIdTop(stuId,taskId);
|
String score= monitorMapper.selectByStuIdAndTaskIdTop(stuId,taskId);
|
||||||
@@ -506,6 +505,17 @@ public class EducationPaperTaskServiceImpl implements IEducationPaperTaskService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//查找 考试状态还没结束的 任务id ,取 交集
|
||||||
|
List<String > taskNoEndIds= monitorMapper.selectByStuIdAndTaskId(stuId);
|
||||||
|
|
||||||
|
if(taskType.equals("1")){
|
||||||
|
if (list!=null&&list.size()>0&&taskNoEndIds!=null&&taskNoEndIds.size()>0){
|
||||||
|
list = list.stream()
|
||||||
|
.filter(task -> taskNoEndIds.contains(task.getTaskId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
educationPaperTasks.setList(list);
|
educationPaperTasks.setList(list);
|
||||||
return educationPaperTasks;
|
return educationPaperTasks;
|
||||||
}else {
|
}else {
|
||||||
|
@@ -12,4 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
select score from exam_monitor where stu_id =#{stuId} and task_id=#{taskId} ORDER BY create_time DESC
|
select score from exam_monitor where stu_id =#{stuId} and task_id=#{taskId} ORDER BY create_time DESC
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectByStuIdAndTaskId" resultType="java.lang.String">
|
||||||
|
select task_id from exam_monitor where stu_id = #{stuId} and exam_status !='2'
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Reference in New Issue
Block a user