【修改】考试任务下的学生考完试,看不见刚考的任务

This commit is contained in:
YOHO\20373
2025-05-27 20:11:09 +08:00
parent 940a71ae47
commit 01b53927aa
5 changed files with 31 additions and 5 deletions

View File

@@ -153,6 +153,16 @@ public class ExamQuestionController
return success(examQuestionService.updateExamQuestion(examQuestion));
}
/**
* 修改试题(hyc) 无租户id
*/
@PutMapping("/NoAudit")
@TenantIgnore
public CommonResult editNoAudit(@RequestBody ExamQuestion examQuestion)
{
return success(examQuestionService.updateExamQuestion(examQuestion));
}
/**
* 删除试题(hyc)
*/

View File

@@ -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 java.util.Arrays;
import java.util.List;
import java.util.Optional;
/**
@@ -54,4 +55,6 @@ return selectPage(reqVO, new LambdaQueryWrapperX<MonitorDO>()
String selectByStuIdAndTaskIdNew(Long stuId, String taskId);
List<String> selectByStuIdAndTaskId(Long stuId);
}

View File

@@ -474,7 +474,7 @@ public class EducationPaperServiceImpl implements IEducationPaperService
@Override
public void downloadWord(String[] paperIds, HttpServletResponse response) throws Exception {
String zipFileName = "试卷.zip";
String zipFileName = "试卷.zip";
// 设置响应头
response.setContentType("application/zip");

View File

@@ -472,10 +472,9 @@ public class EducationPaperTaskServiceImpl implements IEducationPaperTaskService
String taskType = educationPaperTask.getTaskType();
PageResult<EducationPaperTask> educationPaperTasks = educationPaperTaskMapper.selectEducationPaperTaskList(educationPaperTask);
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
Long stuId= SecurityFrameworkUtils.getLoginUserId();
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){
list = list.stream()
.filter(task -> taskIds.contains(task.getTaskId()))
@@ -485,7 +484,7 @@ public class EducationPaperTaskServiceImpl implements IEducationPaperTaskService
String taskId = paperTask.getTaskId();
EducationPaperParam educationPaperParam = educationPaperParamMapper.selectEducationPaperParamByTaskId(taskId);
//最高成绩
Long stuId= SecurityFrameworkUtils.getLoginUserId();
if ("0".equals(educationPaperParam.getSaveGrades())){
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);
return educationPaperTasks;
}else {

View File

@@ -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
LIMIT 1
</select>
<select id="selectByStuIdAndTaskId" resultType="java.lang.String">
select task_id from exam_monitor where stu_id = #{stuId} and exam_status !='2'
</select>
</mapper>