From c93b6be468cdcc6f9071dde6d1a80c6373ac60ab Mon Sep 17 00:00:00 2001 From: "YOHO\\20373" <2037305722@qq.com> Date: Thu, 8 May 2025 12:07:09 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E5=88=A4?= =?UTF-8?q?=E5=88=86=E5=B1=82=E7=BA=A7=E3=80=81=E7=9B=91=E6=8E=A7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E8=BF=9B=E5=85=A5=E8=80=83=E8=AF=95redis=E3=80=81?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E8=AF=95=E5=8D=B7=E5=A2=9E=E5=8A=A0=E8=AF=95?= =?UTF-8?q?=E5=8D=B7id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- answerLogFile.txt | 23 -- answerLogMysql.txt | 308 ------------------ .../admin/paper/vo/ExamPaperVo.java | 5 +- .../service/monitor/MonitorServiceImpl.java | 34 +- .../paper/EducationPaperQuServiceImpl.java | 1 + .../paper/EducationPaperServiceImpl.java | 2 +- .../paper/EducationPaperTaskServiceImpl.java | 78 +++-- .../question/ExamQuestionServiceImpl.java | 25 +- .../service/browser/BrowserServericeImpl.java | 4 +- .../service/file/FileServericeImpl.java | 5 +- .../service/mysql/testServiceImpl.java | 4 +- .../auto_tools/AutoToolsServiceImpl.java | 96 +++--- 12 files changed, 142 insertions(+), 443 deletions(-) delete mode 100644 answerLogFile.txt delete mode 100644 answerLogMysql.txt diff --git a/answerLogFile.txt b/answerLogFile.txt deleted file mode 100644 index 996554f5..00000000 --- a/answerLogFile.txt +++ /dev/null @@ -1,23 +0,0 @@ -=== 学生提交内容(stu 目录) === - -> 文件夹 -AHEWL -> 文件夹 -AHEWL\KMENS -> 文件夹 -AHEWL\MENS.EXE -> 大小: 17B, 隐藏: false, 可读: true, 可写: true -BNPA -> 文件夹 -BNPA\RONGHE.COM -> 大小: 17B, 隐藏: false, 可读: true, 可写: true -EDZK -> 文件夹 -EDZK\RONGHE.COM -> 大小: 17B, 隐藏: false, 可读: true, 可写: true -HGACYL -> 文件夹 -HGACYL\PLAY.MEM -> 大小: 17B, 隐藏: false, 可读: true, 可写: true -TING -> 文件夹 -TING\XYU -> 文件夹 -WUE -> 文件夹 -WUE\PB6.txt -> 大小: 17B, 隐藏: false, 可读: true, 可写: false -XEPO -> 文件夹 -=== 学生提交内容得分点 === -HGACYL\RLQM.MEM -> 考察删除 -> 得分权值:1-> 是否得分:true -TING\XYU\AUTOE.BAT -> 考察删除 -> 得分权值:1-> 是否得分:true -AHEWL\KMENS -> 考察名称 -> 得分权值:1-> 是否得分:true -EDZK\RONGHE.COM -> 考察名称 -> 得分权值:1-> 是否得分:true -HGACYL\PLAY.MEM -> 考察名称 -> 得分权值:1-> 是否得分:true -WUE\PB6.txt -> 考察名称 -> 得分权值:1-> 是否得分:true diff --git a/answerLogMysql.txt b/answerLogMysql.txt deleted file mode 100644 index e1998dc6..00000000 --- a/answerLogMysql.txt +++ /dev/null @@ -1,308 +0,0 @@ -==================插入语句================== -表名:t_team -✅新增语句得分: 4 -==================更新语句================== -✅修改语句得分: 3 -==================视图语句================== -执行视图 v_education_aad91eecf6954d24a249f86bd2271b17 的查询结果: -列名: -themeName -description -teamName -earnedScore -未来实验室 -关闭核反应堆 -穿梭队 -325 -未来实验室 -破解AI主机的密码 -穿梭队 -225 -未来实验室 -修复电力系统 -穿梭队 -165 -古墓谜影 -打开青铜棺椁的暗锁 -探险队 -325 -古墓谜影 -破解八卦阵机关 -探险队 -210 -古墓谜影 -寻找古墓入口的玉佩 -探险队 -110 -民国悬案 -解开保险箱的摩斯密码 -侦探队 -310 -民国悬案 -调查凶案现场的日记本 -侦探队 -225 -执行视图 v_education_2_742b43462b1e45d797daa825ed1bb490 的查询结果: -列名: -themeName -description -teamName -earnedScore -未来实验室 -关闭核反应堆 -穿梭队 -325 -未来实验室 -破解AI主机的密码 -穿梭队 -225 -未来实验室 -修复电力系统 -穿梭队 -165 -古墓谜影 -打开青铜棺椁的暗锁 -探险队 -325 -古墓谜影 -破解八卦阵机关 -探险队 -210 -古墓谜影 -寻找古墓入口的玉佩 -探险队 -110 -民国悬案 -解开保险箱的摩斯密码 -侦探队 -310 -民国悬案 -调查凶案现场的日记本 -侦探队 -225 - -是否结果等价: true -✅等价视图语句得分为: 6 -==================删除语句================== -提取出的表名: t_room -提取出的条件: roomId = 5 -验证 SQL: SELECT COUNT(*) FROM t_room WHERE roomId = 5 -验证通过:符合 DELETE 条件的记录已删除。 -✅删除正确最终得分: 3 -==================查找语句================== -执行考生答案的查询结果: -列名: -超时任务描述 -实际得分 -基础分 -破解AI主机的密码 -225 -250 -关闭核反应堆 -325 -350 -指认真凶 -0 -400 -执行正确答案的查询结果: -列名: -实际得分 -超时任务描述 -基础分 -225 -破解AI主机的密码 -250 -325 -关闭核反应堆 -350 -0 -指认真凶 -400 - -是否结果等价: true -✅当前查询SQL得分为:3 -执行考生答案的查询结果: -列名: -任务描述 -队伍名称 -指认真凶 -侦探队 -执行正确答案的查询结果: -列名: -任务描述 -队伍名称 -指认真凶 -侦探队 - -是否结果等价: true -✅当前查询SQL得分为:3 -==================触发器语句================== -考生答案与标准答案语句内容一致(忽略格式) -✅触发器得分点8 -==================储存过程================== -测试语句:CALL pro_getMaxScore('古墓'); -测试语句:CALL pro_getMaxScore('古墓'); -执行 SQL 语句时发生错误: PROCEDURE pro_getMaxScore already exists -==== 标准答案 ==== -{队伍名称=探险队, 房间名称=古墓谜影, 总用时=51, 总得分=645} -{队伍名称=探险队, 房间名称=古墓谜影, 总用时=51, 总得分=645} -==== 考生答案 ==== -{队伍名称=探险队, 房间名称=古墓谜影, 总用时=51, 总得分=645} -{队伍名称=探险队, 房间名称=古墓谜影, 总用时=51, 总得分=645} -两个结果集内容一致(不考虑顺序)! -考生答案与标准答案语句结果为:true -✅存储过程得分9 -==================插入语句================== -表名:t_team -✅新增语句得分: 4 -==================更新语句================== -✅修改语句得分: 3 -==================视图语句================== -执行视图 v_education_61a0be43eafd4ddeb267eab989db482d 的查询结果: -列名: -themeName -description -teamName -earnedScore -未来实验室 -关闭核反应堆 -穿梭队 -325 -未来实验室 -破解AI主机的密码 -穿梭队 -225 -未来实验室 -修复电力系统 -穿梭队 -165 -古墓谜影 -打开青铜棺椁的暗锁 -探险队 -325 -古墓谜影 -破解八卦阵机关 -探险队 -210 -古墓谜影 -寻找古墓入口的玉佩 -探险队 -110 -民国悬案 -解开保险箱的摩斯密码 -侦探队 -310 -民国悬案 -调查凶案现场的日记本 -侦探队 -225 -执行视图 v_education_2_13a7c1a8c1d540a4ab247934fbd5b46d 的查询结果: -列名: -themeName -description -teamName -earnedScore -未来实验室 -关闭核反应堆 -穿梭队 -325 -未来实验室 -破解AI主机的密码 -穿梭队 -225 -未来实验室 -修复电力系统 -穿梭队 -165 -古墓谜影 -打开青铜棺椁的暗锁 -探险队 -325 -古墓谜影 -破解八卦阵机关 -探险队 -210 -古墓谜影 -寻找古墓入口的玉佩 -探险队 -110 -民国悬案 -解开保险箱的摩斯密码 -侦探队 -310 -民国悬案 -调查凶案现场的日记本 -侦探队 -225 - -是否结果等价: true -✅等价视图语句得分为: 6 -==================删除语句================== -提取出的表名: t_room -提取出的条件: roomId = 5 -验证 SQL: SELECT COUNT(*) FROM t_room WHERE roomId = 5 -验证通过:符合 DELETE 条件的记录已删除。 -✅删除正确最终得分: 3 -==================查找语句================== -执行考生答案的查询结果: -列名: -超时任务描述 -实际得分 -基础分 -破解AI主机的密码 -225 -250 -关闭核反应堆 -325 -350 -指认真凶 -0 -400 -执行正确答案的查询结果: -列名: -实际得分 -超时任务描述 -基础分 -225 -破解AI主机的密码 -250 -325 -关闭核反应堆 -350 -0 -指认真凶 -400 - -是否结果等价: true -✅当前查询SQL得分为:3 -执行考生答案的查询结果: -列名: -任务描述 -队伍名称 -指认真凶 -侦探队 -执行正确答案的查询结果: -列名: -任务描述 -队伍名称 -指认真凶 -侦探队 - -是否结果等价: true -✅当前查询SQL得分为:3 -==================触发器语句================== -考生答案与标准答案语句内容一致(忽略格式) -✅触发器得分点8 -==================储存过程================== -测试语句:CALL pro_getMaxScore('古墓'); -测试语句:CALL pro_getMaxScore('古墓'); -执行 SQL 语句时发生错误: PROCEDURE pro_getMaxScore already exists -==== 标准答案 ==== -{队伍名称=探险队, 房间名称=古墓谜影, 总用时=51, 总得分=645} -{队伍名称=探险队, 房间名称=古墓谜影, 总用时=51, 总得分=645} -==== 考生答案 ==== -{队伍名称=探险队, 房间名称=古墓谜影, 总用时=51, 总得分=645} -{队伍名称=探险队, 房间名称=古墓谜影, 总用时=51, 总得分=645} -两个结果集内容一致(不考虑顺序)! -考生答案与标准答案语句结果为:true -✅存储过程得分9 diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/vo/ExamPaperVo.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/vo/ExamPaperVo.java index 9a137675..e68f9b08 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/vo/ExamPaperVo.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/controller/admin/paper/vo/ExamPaperVo.java @@ -1,14 +1,15 @@ package pc.exam.pp.module.exam.controller.admin.paper.vo; +import lombok.Data; import pc.exam.pp.module.exam.dal.dataobject.EducationPaperScheme; import pc.exam.pp.module.exam.dal.dataobject.ExamQuestion; import java.util.List; - +@Data public class ExamPaperVo { List questionList; List educationPaperSchemeList; - + String paperId; public ExamPaperVo() { } diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorServiceImpl.java index 90d02306..08d20d93 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorServiceImpl.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/monitor/MonitorServiceImpl.java @@ -289,23 +289,26 @@ public class MonitorServiceImpl implements MonitorService { if (info==null){ + MonitorDO monitorDO1=new MonitorDO(); PersonRepDto personRepDto = educationPaperPersonMapper.selectUserById(stuId); String name= educationPaperTaskMapper.selectEducationPaperTaskNameByid(taskId); EducationPaperTask educationPaperTask = educationPaperTaskMapper.selectEducationPaperTaskByTaskId(taskId); - info.setScore("0"); - info.setTaskId(taskId); - info.setTaskType(educationPaperTask.getTaskType()); - info.setExamStatus(status); - info.setPaperNum(""); - info.setStuId(stuId); - info.setUsername(personRepDto.getUsername()); - info.setNickname(personRepDto.getNickname()); + monitorDO1.setScore("0"); + monitorDO1.setTaskId(taskId); + monitorDO1.setTaskType(educationPaperTask.getTaskType()); + monitorDO1.setExamStatus(status); + monitorDO1.setPaperNum(""); + monitorDO1.setStuId(stuId); + monitorDO1.setUsername(personRepDto.getUsername()); + monitorDO1.setNickname(personRepDto.getNickname()); + stringRedisTemplate.opsForValue().set(key, JsonUtils.toJsonString(monitorDO1)); }else { info.setExamStatus(status); + stringRedisTemplate.opsForValue().set(key, JsonUtils.toJsonString(info)); } - stringRedisTemplate.opsForValue().set(key, JsonUtils.toJsonString(info)); + } @@ -318,10 +321,19 @@ public class MonitorServiceImpl implements MonitorService { String taskId = monitorDO.getTaskId(); String stuId = monitorDO.getStuId(); String key = "userCache:" + taskId+":" +stuId; - monitorDO.setExamStatus(status); + + if ("0".equals(monitorDO.getTaskType())){ + monitorDO.setExamStatus("0"); + stringRedisTemplate.opsForValue().set(key, JsonUtils.toJsonString(monitorDO)); + + }else { + monitorDO.setExamStatus(status); + redisTemplate.delete(key); + } + monitorMapper.updateById(monitorDO); - redisTemplate.delete(key); + } } diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperQuServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperQuServiceImpl.java index bdefe62c..12df0e9b 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperQuServiceImpl.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperQuServiceImpl.java @@ -124,6 +124,7 @@ public class EducationPaperQuServiceImpl implements IEducationPaperQuService List educationPaperSchemeList= educationPaperSchemeMapper.selectEducationPaperTaskByTaskId(taskid); ExamPaperVo examPaperVo=new ExamPaperVo(); + examPaperVo.setPaperId(paperId); examPaperVo.setExamQuestionList(examQuestionList); examPaperVo.setEducationPaperSchemeList(educationPaperSchemeList); return examPaperVo; diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperServiceImpl.java index 73c1df05..b5b8d314 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperServiceImpl.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperServiceImpl.java @@ -394,7 +394,7 @@ public class EducationPaperServiceImpl implements IEducationPaperService ExamPaperVo examPaperVo=new ExamPaperVo(); examPaperVo.setExamQuestionList(examQuestionList); examPaperVo.setEducationPaperSchemeList(educationPaperSchemeList); - + examPaperVo.setPaperId(uuid); return examPaperVo; diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperTaskServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperTaskServiceImpl.java index e9a1a940..7fcdc5bd 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperTaskServiceImpl.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/paper/EducationPaperTaskServiceImpl.java @@ -232,12 +232,12 @@ public class EducationPaperTaskServiceImpl implements IEducationPaperTaskService //题型 String spName = param.getSpName(); Long requiredTenantId = TenantContextHolder.getRequiredTenantId(); - System.out.println(requiredTenantId+"requiredTenantIdrequiredTenantId"); - System.out.println(taskSpecialty+"taskSpecialty"); - System.out.println(pointNames+"pointNames"); - System.out.println(keywords+"keywords"); - System.out.println(quLevel+"quLevel"); - System.out.println(spName+"spName"); +// System.out.println(requiredTenantId+"requiredTenantIdrequiredTenantId"); +// System.out.println(taskSpecialty+"taskSpecialty"); +// System.out.println(pointNames+"pointNames"); +// System.out.println(keywords+"keywords"); +// System.out.println(quLevel+"quLevel"); +// System.out.println(spName+"spName"); return educationPaperTaskMapper.getQuCount(taskSpecialty, spName, quLevel, pointNames, keywords,requiredTenantId); } @@ -320,11 +320,15 @@ public class EducationPaperTaskServiceImpl implements IEducationPaperTaskService if (options.contains("4") && !(options.contains("2"))) { //复制考场设置 List educationPaperSessions = educationPaperSessionMapper.selectEducationPaperSessionByTaskId(taskId); - educationPaperSessions.forEach(session -> session.setSessionId(IdUtils.simpleUUID())); - educationPaperSessions.forEach(session -> session.setPaperId(null)); - educationPaperSessions.forEach(session -> session.setTaskId(newtaskId)); - //批量插入 - educationPaperSessionMapper.insertEducationPaperSessionList(educationPaperSessions); + + if (educationPaperSessions!=null&&educationPaperSessions.size()>0){ + educationPaperSessions.forEach(session -> session.setSessionId(IdUtils.simpleUUID())); + educationPaperSessions.forEach(session -> session.setPaperId(null)); + educationPaperSessions.forEach(session -> session.setTaskId(newtaskId)); + //批量插入 + educationPaperSessionMapper.insertEducationPaperSessionList(educationPaperSessions); + } + } if (options.contains("4") && options.contains("2")) { @@ -335,37 +339,39 @@ public class EducationPaperTaskServiceImpl implements IEducationPaperTaskService // 2. 复制所有试卷,建立新旧ID映射 Map paperIdMapping = new HashMap<>(); - for (EducationPaper paper : educationPapers) { - String newPaperId = IdUtils.simpleUUID(); - paperIdMapping.put(paper.getPaperId(), newPaperId); + if (educationPapers!=null&&educationPapers.size()>0){ + for (EducationPaper paper : educationPapers) { + String newPaperId = IdUtils.simpleUUID(); + paperIdMapping.put(paper.getPaperId(), newPaperId); - // 复制试卷试题 - List questions = educationPaperQuMapper.selectPaperQuListByPaperId(paper.getPaperId()); - questions.forEach(qu -> qu.setPaperId(newPaperId)); - educationPaperQuMapper.insertEducationPaperQuList(questions); + // 复制试卷试题 + List questions = educationPaperQuMapper.selectPaperQuListByPaperId(paper.getPaperId()); + questions.forEach(qu -> qu.setPaperId(newPaperId)); + educationPaperQuMapper.insertEducationPaperQuList(questions); - paper.setPaperId(newPaperId); - paper.setTaskId(newtaskId); - educationPaperMapper.insertEducationPaper(paper); + paper.setPaperId(newPaperId); + paper.setTaskId(newtaskId); + educationPaperMapper.insertEducationPaper(paper); - } - - // 3. 处理考场分配 - for (EducationPaperSession session : educationPaperSessions) { - session.setSessionId(IdUtils.simpleUUID()); - session.setTaskId(newtaskId); - if (session.getPaperId() != null) { - String newPaperIds = Arrays.stream(session.getPaperId().split(",")) - .map(paperIdMapping::get) - .collect(Collectors.joining(",")); - session.setPaperId(newPaperIds); } } + if (educationPaperSessions!=null&&educationPaperSessions.size()>0){ + // 3. 处理考场分配 + for (EducationPaperSession session : educationPaperSessions) { + session.setSessionId(IdUtils.simpleUUID()); + session.setTaskId(newtaskId); + if (session.getPaperId() != null) { + String newPaperIds = Arrays.stream(session.getPaperId().split(",")) + .map(paperIdMapping::get) + .collect(Collectors.joining(",")); + session.setPaperId(newPaperIds); + } + } - // 4. 批量插入考场 - educationPaperSessionMapper.insertEducationPaperSessionList(educationPaperSessions); - + // 4. 批量插入考场 + educationPaperSessionMapper.insertEducationPaperSessionList(educationPaperSessions); + } } if (options.contains("5")) { @@ -402,7 +408,7 @@ public class EducationPaperTaskServiceImpl implements IEducationPaperTaskService ExamPaperVo examPaperVo=new ExamPaperVo(); examPaperVo.setExamQuestionList(examQuestionList); examPaperVo.setEducationPaperSchemeList(educationPaperSchemeList); - + examPaperVo.setPaperId(paperId); return examPaperVo; } } diff --git a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/question/ExamQuestionServiceImpl.java b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/question/ExamQuestionServiceImpl.java index 4b2d9d7f..0cd8dda0 100644 --- a/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/question/ExamQuestionServiceImpl.java +++ b/exam-module-exam/exam-module-exam-biz/src/main/java/pc/exam/pp/module/exam/service/question/ExamQuestionServiceImpl.java @@ -56,18 +56,21 @@ public class ExamQuestionServiceImpl implements IExamQuestionService List examQuestionKeywords = examQuestionKeywordMapper.selectExamQuestionKeywordByQuId(quId); ExamQuestion examQuestion = examQuestionMapper.selectExamQuestionByQuId(quId); - if (examQuestionAnswers!=null&&examQuestionAnswers.size()>0){ - examQuestion.setAnswerList(examQuestionAnswers); - } - if (sysFileUploads!=null&&sysFileUploads.size()>0){ - examQuestion.setFileUploads(sysFileUploads); - } - if (examQuestionScore!=null){ - examQuestion.setQuestionScores(examQuestionScore); - } - if (examQuestionKeywords!=null&&examQuestionKeywords.size()>0){ - examQuestion.setQuestionKeywords(examQuestionKeywords); + if (examQuestion!=null){ + if (examQuestionAnswers!=null&&examQuestionAnswers.size()>0){ + examQuestion.setAnswerList(examQuestionAnswers); + } + if (sysFileUploads!=null&&sysFileUploads.size()>0){ + examQuestion.setFileUploads(sysFileUploads); + } + if (examQuestionScore!=null){ + examQuestion.setQuestionScores(examQuestionScore); + } + if (examQuestionKeywords!=null&&examQuestionKeywords.size()>0){ + examQuestion.setQuestionKeywords(examQuestionKeywords); + } } + return examQuestion; } diff --git a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/service/browser/BrowserServericeImpl.java b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/service/browser/BrowserServericeImpl.java index 36798301..72fced7e 100644 --- a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/service/browser/BrowserServericeImpl.java +++ b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/service/browser/BrowserServericeImpl.java @@ -109,10 +109,10 @@ public class BrowserServericeImpl implements IBrowserServerice { if (isCorrect) { totalScore += currentScore; - appendToFile(answerLogPath,"考点"+answer.getContentIn() + " -> 得分权值:" + answer.getScoreRate()+"-> 是否得分:"+isCorrect); + appendToFile(answerLogPath,"考点"+answer.getContentIn() + " -> 得分权值:" + answer.getScoreRate()+"-> 是否得分:"+isCorrect+"✅"); }else { - appendToFile(answerLogPath,"考点"+answer.getContentIn() + " -> 得分权值:" + answer.getScoreRate()+"-> 是否得分:"+isCorrect); + appendToFile(answerLogPath,"考点"+answer.getContentIn() + " -> 得分权值:" + answer.getScoreRate()+"-> 是否得分:"+isCorrect+"❌"); } } diff --git a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/service/file/FileServericeImpl.java b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/service/file/FileServericeImpl.java index bb3da760..1cb23808 100644 --- a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/service/file/FileServericeImpl.java +++ b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/service/file/FileServericeImpl.java @@ -38,6 +38,7 @@ public class FileServericeImpl implements IFileServerice { // 设置日志文件路径为file所在目录下的answerLogFile.txt answerLogPath = file.getParent() + File.separator + "log.txt"; + System.out.println(answerLogPath); // 获取 stu 文件夹的内容 Map stuFiles = GetDifferencesBetweenFolders.listFilesAndFoldersWithAttributes(stuPath.toPath()); @@ -90,9 +91,9 @@ public class FileServericeImpl implements IFileServerice { // 如果正确,则累加总分 if (isCorrect) { totalScore += currentScore; - appendToFile(answerLogPath,answer.getContent() + " -> " + answer.getContentIn() + " -> 得分权值:" + answer.getScoreRate()+"-> 是否得分:"+isCorrect); + appendToFile(answerLogPath,answer.getContent() + " -> " + answer.getContentIn() + " -> 得分权值:" + answer.getScoreRate()+"-> 是否得分:"+isCorrect+"✅"); }else { - appendToFile(answerLogPath,answer.getContent() + " -> " + answer.getContentIn() + " -> 得分权值:" + answer.getScoreRate()+"-> 是否得分:"+isCorrect); + appendToFile(answerLogPath,answer.getContent() + " -> " + answer.getContentIn() + " -> 得分权值:" + answer.getScoreRate()+"-> 是否得分:"+isCorrect+"❌"); } } diff --git a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/service/mysql/testServiceImpl.java b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/service/mysql/testServiceImpl.java index 94a2fbdd..f7c19550 100644 --- a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/service/mysql/testServiceImpl.java +++ b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/controller/service/mysql/testServiceImpl.java @@ -13,9 +13,9 @@ public class testServiceImpl implements testservice { public boolean test() { - String s = endStuMonitorUtils.endStuMonitor("160", "78f7496a68ae48e0bfb0c288549485d8"); + String s = endStuMonitorUtils.endStuMonitor("160", "2bf4510550e34d85a852394cea61b455"); - endStuMonitorUtils.endStuMonitor("160","78f7496a68ae48e0bfb0c288549485d8",20.0); + endStuMonitorUtils.endStuMonitor("160","2bf4510550e34d85a852394cea61b455",20.0); return true; } diff --git a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/service/auto_tools/AutoToolsServiceImpl.java b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/service/auto_tools/AutoToolsServiceImpl.java index 7d57b978..737f9456 100644 --- a/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/service/auto_tools/AutoToolsServiceImpl.java +++ b/exam-module-judgement/exam-module-judgement-biz/src/main/java/pc/exam/pp/module/judgement/service/auto_tools/AutoToolsServiceImpl.java @@ -204,7 +204,7 @@ public class AutoToolsServiceImpl implements AutoToolsService{ String stu_files = null; // 5.1、 只查询文件夹 (学号-试卷ID-试题ID-具体内容) if (files == null) return CommonResult.error(100032, "1、试题文件上传,目录不正确!"); - if (files.length > 1) return CommonResult.error(100033, "2、试题文件上传,目录不正确!"); + // if (files.length > 1) return CommonResult.error(100033, "2、试题文件上传,目录不正确!"); if (!files[0].isDirectory()) return CommonResult.error(100034, "3、试题文件上传,目录不正确!"); // 判断学号是否正确 if (!files[0].getName().equals(stuId.toString())) return CommonResult.error(100035, "文件与学号匹配异常"); @@ -227,53 +227,59 @@ public class AutoToolsServiceImpl implements AutoToolsService{ File cs_files = new File(file.getPath()); // 所有试题文件夹 File[] cs_file_list = cs_files.listFiles(); - for (File one_file : cs_file_list) { - // 6、根据试题ID查询试题详情 - String qu_id = one_file.getName(); - ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(qu_id); - if (examQuestion != null) { - // 7、进行对应得判分 - // --- 7.1、查询试题文件 - File qu_file = new File(one_file.getPath()); - File[] qu_file_list = qu_file.listFiles(); - if (qu_file_list == null) continue; - // --- 7.2、通过文件名称进行判分 - for (File file_one : qu_file_list) { - // 判断名称 类似于 C语言程序设计。 课程+题型 - if (file_one.getName().split("\\.")[0].equals(examQuestion.getCourseName()+examQuestion.getSubjectName())) { - double c_score = judgementService.ProgrammingC(15.0, one_file.getPath(), file_one.getName(), examQuestion); - score += c_score; - break; - } - // wps 类型存在多级文文件夹,需要个性化设置 - if (file_one.getName().split("\\.")[0].equals("文档")) { - double wps_word_score = judgementWpsWordService.judgementWpsWord(15.0, one_file.getPath(), file_one.getPath(), examQuestion); - score += wps_word_score; - break; - } - // D:\1d70c404e6d42d144d0028496e893565dd2dec447f7e9b1db66466f00472424d\160\cb3cc9089b104a1e9e92deb330d0cfe8\d9f988d5ae6d435ba12d4d979d044219\stu - //windows文件处理 - if (file_one.getName().equals("stu")) { - File win_file = new File(file_one.getPath()); - double win_file_score = fileServerice.run_file_point(20.0,win_file, examQuestion); - score += win_file_score; - } - System.out.println(file_one); - //浏览器操作 - // if ("浏览器网络题".equals(examQuestion.getCourseName()+examQuestion.getSubjectName())){ - if (file_one.getName().equals("edge")) { - File edge_file = new File(file_one.getPath()); - double browse_score= browserServerice.Judgement(20.0,edge_file,examQuestion); - score += browse_score; - } - } - ExamQuestion mysql=new ExamQuestion(); - double judgement = mysqlServerice.Judgement(20, mysql); - score+=judgement; - } + if (cs_file_list!=null){ + for (File one_file : cs_file_list) { + // 6、根据试题ID查询试题详情 +// String qu_id = file.getName(); + String qu_id = file.getName(); + ExamQuestion examQuestion = examQuestionService.selectExamQuestionByQuId(qu_id); + if (examQuestion != null) { + // 7、进行对应得判分 + // --- 7.1、查询试题文件 + File qu_file = new File(one_file.getPath()); + File[] qu_file_list = qu_file.listFiles(); + if (qu_file_list == null) continue; + // --- 7.2、通过文件名称进行判分 +// for (File file_one : qu_file_list) { + // 判断名称 类似于 C语言程序设计。 课程+题型 + if (one_file.getName().split("\\.")[0].equals(examQuestion.getCourseName()+examQuestion.getSubjectName())) { + double c_score = judgementService.ProgrammingC(15.0, one_file.getPath(), one_file.getName(), examQuestion); + score += c_score; + break; + } + // wps 类型存在多级文文件夹,需要个性化设置 + if (one_file.getName().split("\\.")[0].equals("文档")) { + double wps_word_score = judgementWpsWordService.judgementWpsWord(15.0, one_file.getPath(), one_file.getPath(), examQuestion); + score += wps_word_score; + break; + } + // D:\1d70c404e6d42d144d0028496e893565dd2dec447f7e9b1db66466f00472424d\160\cb3cc9089b104a1e9e92deb330d0cfe8\d9f988d5ae6d435ba12d4d979d044219\stu + //windows文件处理 + if (one_file.getName().equals("stu")) { + File win_file = new File(one_file.getPath()); + double win_file_score = fileServerice.run_file_point(20.0,win_file, examQuestion); + score += win_file_score; + } + System.out.println(one_file); + //浏览器操作 + // if ("浏览器网络题".equals(examQuestion.getCourseName()+examQuestion.getSubjectName())){ + if (one_file.getName().equals("edge")) { + System.out.println(one_file); + File edge_file = new File(one_file.getPath()); + double browse_score= browserServerice.Judgement(20.0,edge_file,examQuestion); + score += browse_score; + } +// } + } + + } } + } + ExamQuestion mysql=new ExamQuestion(); + double judgement = mysqlServerice.Judgement(20, mysql); + score+=judgement; // 8、将解压之后得问及那继续重新压缩并上传到服务器,并删除文件和文件夹 String zipPath = FolderZipper.zipFolder(files[0].getPath()); // 9、上传文件