diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/test/student/StudentExamPaperController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/test/student/StudentExamPaperController.java index e75e605..87037b3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/test/student/StudentExamPaperController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/test/student/StudentExamPaperController.java @@ -84,6 +84,7 @@ public class StudentExamPaperController { continue; } ExamPaperDO1 examPaperDO1 = new ExamPaperDO1(); + examPaperDO1.setGrade(examPaper.getGrade()); examPaperDO1.setId(examPaper.getId()); examPaperDO1.setName(examPaper.getName()); examPaperDO1.setTime(examPaper.getTime()); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/test/student/StudentHomePageController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/test/student/StudentHomePageController.java index f18877b..973e263 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/test/student/StudentHomePageController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/test/student/StudentHomePageController.java @@ -67,9 +67,7 @@ public class StudentHomePageController { @ApiOperation("更新消息记录状态") @PutMapping("updateMessage") public R updateMessage(@RequestBody Map params) { - System.out.println("============="+params); Long id = params.get("id"); - System.out.println("================="+id); return R.ok(iMessageService.updateMessage(id)); } diff --git a/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/ExamPaperDO1.java b/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/ExamPaperDO1.java index 09101a6..400ade0 100644 --- a/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/ExamPaperDO1.java +++ b/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/ExamPaperDO1.java @@ -6,6 +6,7 @@ import lombok.Data; public class ExamPaperDO1 { private Long id; private Long glId; + private String grade; private String name; private String subject; private Integer totalquestion; diff --git a/ruoyi-test/src/main/java/com/ruoyi/test/seriver/Impl/AnswerSheetDOServiceImpl.java b/ruoyi-test/src/main/java/com/ruoyi/test/seriver/Impl/AnswerSheetDOServiceImpl.java index c1fbe18..6cd11aa 100644 --- a/ruoyi-test/src/main/java/com/ruoyi/test/seriver/Impl/AnswerSheetDOServiceImpl.java +++ b/ruoyi-test/src/main/java/com/ruoyi/test/seriver/Impl/AnswerSheetDOServiceImpl.java @@ -45,6 +45,7 @@ public class AnswerSheetDOServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(ExamCreate::getPid,pid); diff --git a/vue2/vue/src/views/Student/Exam.vue b/vue2/vue/src/views/Student/Exam.vue index 294aa81..1255154 100644 --- a/vue2/vue/src/views/Student/Exam.vue +++ b/vue2/vue/src/views/Student/Exam.vue @@ -59,7 +59,7 @@ @@ -82,7 +82,7 @@ export default { components: {Aside, Header}, data() { return { - paperTypes: ["固定试卷","班级试卷"], // 试卷类型 + paperTypes: ["班级试卷","固定试卷"], // 试卷类型 subjects: ["语文", "数学"], // 学科 selectedType: "班级试卷", // 默认选中的试卷类型 selectedSubject: "语文", // 默认选中的学科 @@ -132,8 +132,8 @@ export default { this.logoTextShow = true } }, - startExam(id,name,subject,time) { - this.$router.push({ name: "ExamPaper", query: { userId: this.userId ,id:id ,name: name, subject: subject ,time:time} }); + startExam(id,name,subject,time,grade) { + this.$router.push({ name: "ExamPaper", query: { userId: this.userId ,id:id ,name: name, subject: subject ,time:time, grade:grade} }); }, handleTypeChange(type) { this.selectedType = type; // 修改选中的试卷类型 @@ -190,7 +190,6 @@ export default { }, } ); - console.log("responser",response.data); if (response.data.code === 200) { const data = response.data.data; @@ -200,6 +199,7 @@ export default { const hasTaken = await this.checkExamStatus(record.id); return { id: record.id, + grade: record.grade, name: record.name, subject: record.subject, questionCount: record.totalquestion, @@ -209,9 +209,7 @@ export default { }; }) ); - console.log("updatedRecords",updatedRecords); this.papers = updatedRecords; - console.log("更新后的试卷数据:", updatedRecords); } else { alert("数据加载失败:" + response.data.msg); // this.$router.push('/login'); // 引导用户重新登录 @@ -275,7 +273,6 @@ button.active { flex-wrap: wrap; gap: 20px; padding: 20px; - justify-content: space-between; /* Ensures spacing between cards */ } .card { diff --git a/vue2/vue/src/views/Student/ExamPaper.vue b/vue2/vue/src/views/Student/ExamPaper.vue index 6950c34..7318b66 100644 --- a/vue2/vue/src/views/Student/ExamPaper.vue +++ b/vue2/vue/src/views/Student/ExamPaper.vue @@ -142,14 +142,18 @@ export default { headers: { Authorization: `Bearer ${token}` }, }); + console.log("11"+res.data); + if (res.data && res.data.data && res.data.data.grade) { const grade = res.data.data.grade; const examRes = await axios.get(`http://localhost:8080/student/homepage/task_paper`, { - params: { name: this.name, subject: this.subject, grade }, + params: { name: this.name, subject: this.subject, grade: this.grade }, headers: { Authorization: `Bearer ${token}` }, }); + console.log("22"+examRes.data); + if (examRes.data.code === 200) { const { name, list } = examRes.data.data; this.examTitle = name; @@ -176,7 +180,7 @@ export default { }); } else { alert("加载试题失败:" + examRes.data.msg); - this.$router.push('/login'); // 引导用户重新登录 + // this.$router.push('/login'); // 引导用户重新登录 } } else { alert("返回数据缺少年级信息!"); @@ -302,6 +306,9 @@ export default { this.name = this.$route.query.name; this.examId = this.$route.query.id; this.time = this.$route.query.time; + this.grade = this.$route.query.grade; + + console.log(this.grade); if (!this.subject || !this.name) { alert("未获取到试卷,请重新选择!"); diff --git a/vue2/vue/src/views/Teacher/Correct.vue b/vue2/vue/src/views/Teacher/Correct.vue index 6af137e..68e6c0d 100644 --- a/vue2/vue/src/views/Teacher/Correct.vue +++ b/vue2/vue/src/views/Teacher/Correct.vue @@ -1,12 +1,12 @@