【修改】 监控管理管理员强制使学生结束考试
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user