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 26efb0d..1a261b9 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 @@ -38,6 +38,15 @@ public class StudentExamPaperController { @Autowired private IExamCreateService iExamCreateService; + @ApiOperation("班级查询") + @GetMapping("selectByUserId") + public R selectByUserId(){ + SysUser sysUser = SecurityUtils.getLoginUser().getUser(); + Long id = sysUser.getUserId(); + Long userid = iUserService.selectByzhid(id); + return R.ok(iStudentClassService.selectById(userid)); + } + @ApiOperation("试卷查询") @GetMapping("examPaperByTypeAndSubject") public R> examPaperByTypeAndSubject(int pagenum,int pagesize,String type,String subject){ diff --git a/vue2/vue/src/router/index.js b/vue2/vue/src/router/index.js index a783ae6..80174e0 100644 --- a/vue2/vue/src/router/index.js +++ b/vue2/vue/src/router/index.js @@ -8,11 +8,17 @@ import store from '../store'; // 引入 Vuex store Vue.use(VueRouter); const routes = [ - { - path:'/student/exam', - component: () => import(/* webpackChunkName: "about" */ '../views/Student/Exam.vue'), - meta: {requiresAuth: true} - }, + { + path: '/student/examPaper', + name: 'ExamPaper', + component: () => import(/* webpackChunkName: "about" */ '../views/Student/ExamPaper.vue'), + meta: { requiresAuth: true } + }, + { + path:'/student/exam', + component: () => import(/* webpackChunkName: "about" */ '../views/Student/Exam.vue'), + meta: {requiresAuth: true} + }, { path: '/', name: 'home', diff --git a/vue2/vue/src/views/Student/Exam.vue b/vue2/vue/src/views/Student/Exam.vue index dd66312..532ec4c 100644 --- a/vue2/vue/src/views/Student/Exam.vue +++ b/vue2/vue/src/views/Student/Exam.vue @@ -49,7 +49,7 @@

考试时长:{{ paper.time }}

开始时间:{{ paper.startTime || "未设置" }}

结束时间:{{ paper.endTime || "未设置" }}

- + @@ -104,6 +104,9 @@ export default { }, }, methods: { + startExam(name,subject) { + this.$router.push({ name: "ExamPaper", query: { name: name, subject: subject } }); + }, handleTypeChange(type) { this.selectedType = type; // 修改选中的试卷类型 }, diff --git a/vue2/vue/src/views/Student/ExamPaper.vue b/vue2/vue/src/views/Student/ExamPaper.vue new file mode 100644 index 0000000..0ffdbf9 --- /dev/null +++ b/vue2/vue/src/views/Student/ExamPaper.vue @@ -0,0 +1,291 @@ + + + + + +