【修改】 监控管理管理员强制使学生结束考试

This commit is contained in:
DESKTOP-9ERGOBP\任维炳
2025-10-23 17:36:18 +08:00
parent 02bc650c1b
commit 3c77645ca6

View File

@@ -279,6 +279,7 @@ public class AutoToolsController {
String interactiveTime = info.getInteractiveTime();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime targetTime = LocalDateTime.parse(interactiveTime, formatter);
// 获取当前时间
LocalDateTime currentTime = LocalDateTime.now();
Duration duration = Duration.between(currentTime, targetTime);
// 两者相差的时间
@@ -414,9 +415,13 @@ public class AutoToolsController {
* @return true
*/
@GetMapping("/stopExamForAdmin")
public CommonResult<Boolean> stopExamForAdmin(@RequestParam("userId") String userId) {
public CommonResult<Boolean> stopExamForAdmin(@RequestParam("userId") String userId,
@RequestParam("taskId") String taskId,
@RequestParam("paperNum") String paperNmu) {
String paperId = educationPaperService.selectPaperByPaperNum(paperNmu);
userId += "_" + taskId + "_" + paperId;
// 删除对应的线程池
taskManager.stopTaskByUserId(userId);
taskManager.stopTask(userId);
return CommonResult.success(true);
}