From 121f74b222fa54f96ef3dcb9d0ebfc5fecf55481 Mon Sep 17 00:00:00 2001 From: yuan <3558860895@qq.com> Date: Sun, 1 Dec 2024 03:53:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=EF=BC=9A=E6=95=99=E5=B8=88?= =?UTF-8?q?=E7=AB=AF=E5=A2=9E=E5=8A=A0=E6=89=B9=E6=94=B9=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E6=89=B9=E6=94=B9=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=88=86=E6=95=B0?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E6=9F=A5=E8=AF=A2=EF=BC=9B=20=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=EF=BC=9A=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E5=AD=97=E6=AE=B5=EF=BC=8C=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=89=80=E9=9C=80=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../student/StudentExamPaperController.java | 3 +- .../teacher/TeacherAnswerSheetController.java | 14 +- .../com/ruoyi/test/config/MyBatisConfig.java | 1 - .../com/ruoyi/test/domain/DO/ExamPaperDO.java | 1 + .../ruoyi/test/domain/DO/ExamPaperDO1.java | 1 + .../com/ruoyi/test/domain/DO/ScoreListDO.java | 20 + .../ruoyi/test/domain/DO/correctTestsDO.java | 6 - .../java/com/ruoyi/test/domain/ExamPaper.java | 1 + .../com/ruoyi/test/domain/Markedtest.java | 1 + .../ruoyi/test/domain/Vo/MarkedtestVo.java | 27 - .../ruoyi/test/seriver/IExamPaperService.java | 1 + .../test/seriver/IMarkedtestService.java | 3 + .../test/seriver/IStudentClassService.java | 1 + .../seriver/Impl/ExamPaperServiceImpl.java | 8 + .../seriver/Impl/MarkedtestServiceImpl.java | 74 ++- .../seriver/Impl/StudentClassServiceImpl.java | 19 + .../main/resources/mapper/ExamPaperMapper.xml | 2 + .../resources/mapper/MarkedtestMapper.xml | 4 +- vue2/vue/src/components/Teacher/Aside.vue | 15 +- vue2/vue/src/router/index.js | 12 + vue2/vue/src/views/Student/Exam.vue | 2 - .../vue/src/views/Student/TestPaperDetail.vue | 4 +- vue2/vue/src/views/Teacher/Correct.vue | 7 +- .../src/views/Teacher/CorrectExamPaper.vue | 481 ++++++++++++++++++ vue2/vue/src/views/Teacher/Score.vue | 191 +++++++ vue2/vue/src/views/Teacher/ViewExamPaper.vue | 10 +- 26 files changed, 854 insertions(+), 55 deletions(-) create mode 100644 ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/ScoreListDO.java delete mode 100644 ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/correctTestsDO.java delete mode 100644 ruoyi-test/src/main/java/com/ruoyi/test/domain/Vo/MarkedtestVo.java create mode 100644 vue2/vue/src/views/Teacher/CorrectExamPaper.vue create mode 100644 vue2/vue/src/views/Teacher/Score.vue 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 30e7c9a..d888a76 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 @@ -76,7 +76,7 @@ public class StudentExamPaperController { List list1 = new ArrayList<>(); for(ClassExamPaper classExamPaper : list ){ ExamPaper examPaper = iExamPaperService.selectById(classExamPaper.getId()); - if(examPaper.getStatus()==0){ + if(examPaper.getStatus()==0L){ continue; } if(type!=null&&!examPaper.getType().equals(type)){ @@ -92,6 +92,7 @@ public class StudentExamPaperController { examPaperDO1.setSubject(examPaper.getSubject()); examPaperDO1.setStart_time(null); examPaperDO1.setEnd_time(null); + examPaperDO1.setGlId(examPaper.getGlId()); Long testid = examPaper.getId(); List list2 = iExamCreateService.selectListByPid(testid); examPaperDO1.setTotalquestion(list2.size()); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/test/teacher/TeacherAnswerSheetController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/test/teacher/TeacherAnswerSheetController.java index 0f3a773..96ad311 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/test/teacher/TeacherAnswerSheetController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/test/teacher/TeacherAnswerSheetController.java @@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.test.domain.DO.Correct; import com.ruoyi.test.domain.DO.QuestionAnswerDO; +import com.ruoyi.test.domain.DO.ScoreListDO; import com.ruoyi.test.domain.Markedtest; import com.ruoyi.test.domain.Message; import com.ruoyi.test.domain.StudentClass; @@ -50,10 +51,19 @@ public class TeacherAnswerSheetController { @Autowired private IMassageService iMassageService; + @ApiOperation("学生成绩列表") + @GetMapping("selectScoreList") + public R> selectScoreList(int pageNum,int pageSize){ + SysUser sysUser = SecurityUtils.getLoginUser().getUser(); + Long teacherId = sysUser.getUserId(); + List teacherManageClass = iTeacherManageClassService.selectById(teacherId); + List studentList = iStudentClassService.getStudentClassByTeacherIdList(teacherManageClass); + return R.ok(iMarkedtestService.selectScoreList(pageNum,pageSize,studentList,teacherId)); + } + @ApiOperation("查看学生的考试情况(最新)") @GetMapping("selectQuestionanswer") public R selectQuestionanswer(Long senderId, Long testid) { - System.out.println("==============="+senderId+" "+testid); return R.ok(iQuestionanswerService.selectQuestionanswer(senderId,testid)); } @@ -90,7 +100,7 @@ public class TeacherAnswerSheetController { @ApiOperation("试卷批改完毕提交") @PostMapping("addmarkedtest") - public R addmarkedtest(Long senderId,Long testid){ + public R addmarkedtest(@RequestParam Long senderId, @RequestParam Long testid){ if(iMarkedtestService.addmarkedtest(senderId,testid)!=0){ return R.ok("提交完成!"); } diff --git a/ruoyi-test/src/main/java/com/ruoyi/test/config/MyBatisConfig.java b/ruoyi-test/src/main/java/com/ruoyi/test/config/MyBatisConfig.java index 4601463..7781e49 100644 --- a/ruoyi-test/src/main/java/com/ruoyi/test/config/MyBatisConfig.java +++ b/ruoyi-test/src/main/java/com/ruoyi/test/config/MyBatisConfig.java @@ -1,5 +1,4 @@ package com.ruoyi.test.config; -import com.ruoyi.test.domain.User; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import com.baomidou.mybatisplus.core.mapper.BaseMapper; diff --git a/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/ExamPaperDO.java b/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/ExamPaperDO.java index 59f0ea4..53e61a5 100644 --- a/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/ExamPaperDO.java +++ b/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/ExamPaperDO.java @@ -8,6 +8,7 @@ import java.util.List; public class ExamPaperDO { private Long id; + private Long glId; private String subject; private String grade; private String name; 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 33d8cf0..09101a6 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 @@ -5,6 +5,7 @@ import lombok.Data; @Data public class ExamPaperDO1 { private Long id; + private Long glId; private String name; private String subject; private Integer totalquestion; diff --git a/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/ScoreListDO.java b/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/ScoreListDO.java new file mode 100644 index 0000000..f35db16 --- /dev/null +++ b/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/ScoreListDO.java @@ -0,0 +1,20 @@ +package com.ruoyi.test.domain.DO; + +import lombok.Data; + +import java.util.Map; + +@Data +public class ScoreListDO { + + private Long senderId; + private String senderName; + private String grade; + private String Class1; + private Long testid; + private Double score; + private String examName; + private Integer ranking;//排名 + private Long status; + +} diff --git a/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/correctTestsDO.java b/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/correctTestsDO.java deleted file mode 100644 index a0c72d6..0000000 --- a/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/correctTestsDO.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.ruoyi.test.domain.DO; - -public class correctTestsDO { - - -} diff --git a/ruoyi-test/src/main/java/com/ruoyi/test/domain/ExamPaper.java b/ruoyi-test/src/main/java/com/ruoyi/test/domain/ExamPaper.java index 09d58ec..6b6e486 100644 --- a/ruoyi-test/src/main/java/com/ruoyi/test/domain/ExamPaper.java +++ b/ruoyi-test/src/main/java/com/ruoyi/test/domain/ExamPaper.java @@ -7,6 +7,7 @@ import lombok.Data; public class ExamPaper { private Long id; + private Long glId; private String grade; private String subject; private String createtime; diff --git a/ruoyi-test/src/main/java/com/ruoyi/test/domain/Markedtest.java b/ruoyi-test/src/main/java/com/ruoyi/test/domain/Markedtest.java index fe30ac8..00da177 100644 --- a/ruoyi-test/src/main/java/com/ruoyi/test/domain/Markedtest.java +++ b/ruoyi-test/src/main/java/com/ruoyi/test/domain/Markedtest.java @@ -15,5 +15,6 @@ public class Markedtest { private Integer tquestions; private Integer time; private String finishtime; + private Long status; } diff --git a/ruoyi-test/src/main/java/com/ruoyi/test/domain/Vo/MarkedtestVo.java b/ruoyi-test/src/main/java/com/ruoyi/test/domain/Vo/MarkedtestVo.java deleted file mode 100644 index a515dc9..0000000 --- a/ruoyi-test/src/main/java/com/ruoyi/test/domain/Vo/MarkedtestVo.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.ruoyi.test.domain.Vo; - -import lombok.Data; - -@Data -public class MarkedtestVo { - - private Long id; - -// private String grade; -// -// private String subject; - - private String name; - - private String sender; - - private double score; - private double totalscore; - private Integer totalquestions; - private Integer tquestions; - private Integer time; - private String finishtime; - - - -} diff --git a/ruoyi-test/src/main/java/com/ruoyi/test/seriver/IExamPaperService.java b/ruoyi-test/src/main/java/com/ruoyi/test/seriver/IExamPaperService.java index c23235b..8bce541 100644 --- a/ruoyi-test/src/main/java/com/ruoyi/test/seriver/IExamPaperService.java +++ b/ruoyi-test/src/main/java/com/ruoyi/test/seriver/IExamPaperService.java @@ -40,4 +40,5 @@ public interface IExamPaperService { IPage selectByGrateAndSubjectAndId(int pagenum,int pagesize,String grade,String subject,Long id); + List selectByGlId(Long teacherId); } diff --git a/ruoyi-test/src/main/java/com/ruoyi/test/seriver/IMarkedtestService.java b/ruoyi-test/src/main/java/com/ruoyi/test/seriver/IMarkedtestService.java index 9df4668..993c46a 100644 --- a/ruoyi-test/src/main/java/com/ruoyi/test/seriver/IMarkedtestService.java +++ b/ruoyi-test/src/main/java/com/ruoyi/test/seriver/IMarkedtestService.java @@ -2,6 +2,7 @@ package com.ruoyi.test.seriver; import com.baomidou.mybatisplus.core.metadata.IPage; import com.ruoyi.test.domain.DO.Correct; +import com.ruoyi.test.domain.DO.ScoreListDO; import com.ruoyi.test.domain.Markedtest; import com.ruoyi.test.domain.StudentClass; @@ -28,4 +29,6 @@ public interface IMarkedtestService { Markedtest selectmarkedtestByTestid(Long id,Long testId); List selectByStudentList(Long id,List list); + + IPage selectScoreList(int pageNum,int pageSize,List studentList,Long teacherId); } diff --git a/ruoyi-test/src/main/java/com/ruoyi/test/seriver/IStudentClassService.java b/ruoyi-test/src/main/java/com/ruoyi/test/seriver/IStudentClassService.java index 860c063..bab094a 100644 --- a/ruoyi-test/src/main/java/com/ruoyi/test/seriver/IStudentClassService.java +++ b/ruoyi-test/src/main/java/com/ruoyi/test/seriver/IStudentClassService.java @@ -17,5 +17,6 @@ public interface IStudentClassService { List selectByTeacherIdList(List teacherManageClasses); + List getStudentClassByTeacherIdList(List teacherManageClasses); } diff --git a/ruoyi-test/src/main/java/com/ruoyi/test/seriver/Impl/ExamPaperServiceImpl.java b/ruoyi-test/src/main/java/com/ruoyi/test/seriver/Impl/ExamPaperServiceImpl.java index 0081904..8af924b 100644 --- a/ruoyi-test/src/main/java/com/ruoyi/test/seriver/Impl/ExamPaperServiceImpl.java +++ b/ruoyi-test/src/main/java/com/ruoyi/test/seriver/Impl/ExamPaperServiceImpl.java @@ -16,6 +16,7 @@ import org.springframework.security.core.parameters.P; import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Collections; import java.util.List; @Service @@ -141,6 +142,13 @@ public class ExamPaperServiceImpl extends ServiceImpl selectByGlId(Long teacherId) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(ExamPaper::getGlId,teacherId); + return examPaperMapper.selectList(queryWrapper); + } + // @Override // public List totalExamPaper(List list, List list2) { // List list1 = new ArrayList<>(); diff --git a/ruoyi-test/src/main/java/com/ruoyi/test/seriver/Impl/MarkedtestServiceImpl.java b/ruoyi-test/src/main/java/com/ruoyi/test/seriver/Impl/MarkedtestServiceImpl.java index be3c904..e20a8ed 100644 --- a/ruoyi-test/src/main/java/com/ruoyi/test/seriver/Impl/MarkedtestServiceImpl.java +++ b/ruoyi-test/src/main/java/com/ruoyi/test/seriver/Impl/MarkedtestServiceImpl.java @@ -8,7 +8,7 @@ import com.ruoyi.system.service.ISysUserService; import com.ruoyi.test.domain.*; import com.ruoyi.test.domain.DO.Correct; import com.ruoyi.test.domain.DO.QuestionAnswerDO; -import com.ruoyi.test.domain.Vo.MarkedtestVo; +import com.ruoyi.test.domain.DO.ScoreListDO; import com.ruoyi.test.domain.Vo.QuestionanswerVo; import com.ruoyi.test.domain.Vo.QuestionbankVo; import com.ruoyi.test.mapper.AnswerMapper; @@ -86,6 +86,7 @@ public class MarkedtestServiceImpl extends ServiceImpl selectmarkedtestListSenderId(Long senderId) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); - queryWrapper.eq(Markedtest::getSenderId,senderId); + queryWrapper.eq(Markedtest::getSenderId,senderId) + .eq(Markedtest::getStatus,1L); return markedtestMapper.selectList(queryWrapper); } @@ -181,7 +183,8 @@ public class MarkedtestServiceImpl extends ServiceImpl queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(Markedtest::getSenderId,id) - .eq(Markedtest::getTestid,testId); + .eq(Markedtest::getTestid,testId) + .eq(Markedtest::getStatus,1L); return markedtestMapper.selectOne(queryWrapper); } @@ -227,4 +230,69 @@ public class MarkedtestServiceImpl extends ServiceImpl selectScoreList(int pageNum, int pageSize, List studentList, Long teacherId) { + List examPapers = iExamPaperService.selectByGlId(teacherId); + List scoreList = new ArrayList<>(); + for(ExamPaper examPaper : examPapers){ + + for(StudentClass studentClass : studentList){ + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(Markedtest::getSenderId,studentClass.getStudentid()) + .eq(Markedtest::getTestid,examPaper.getId()); + Markedtest markedtest = markedtestMapper.selectOne(queryWrapper); + ScoreListDO scoreListDO = new ScoreListDO(); + if(markedtest!=null){ + scoreListDO.setSenderId(studentClass.getStudentid()); + scoreListDO.setTestid(examPaper.getId()); + scoreListDO.setSenderName(iSysUserService.selectUserById(studentClass.getStudentid()).getUserName()); + scoreListDO.setExamName(examPaper.getName()); + scoreListDO.setScore(markedtest.getScore()); + scoreListDO.setGrade(studentClass.getGrade()); + scoreListDO.setClass1(studentClass.getClass1()); + scoreListDO.setStatus(markedtest.getStatus()); + scoreList.add(scoreListDO); + } + } + } + + System.out.println(scoreList); + + // 按年级和班级分组 + Map> groupedByGradeAndClass = scoreList.stream() + .collect(Collectors.groupingBy(score -> score.getGrade() + "-" + score.getClass1())); + + // 计算每个组内的排名 + for (Map.Entry> entry : groupedByGradeAndClass.entrySet()) { + List students = entry.getValue(); + + // 按得分降序排序 + students.sort((s1, s2) -> Double.compare(s2.getScore(), s1.getScore())); + + // 给每个学生计算排名 + int rank = 1; + for (int i = 0; i < students.size(); i++) { + ScoreListDO student = students.get(i); + // 如果与前一个学生分数相同,则排名相同 + if (i > 0 && students.get(i).getScore() == students.get(i - 1).getScore()) { + student.setRanking(students.get(i - 1).getRanking()); + } else { + student.setRanking(rank); + } + rank++; + } + } + + // 把所有学生数据合并回一个列表并返回 + List collect = groupedByGradeAndClass.values().stream() + .flatMap(List::stream) + .collect(Collectors.toList()); + // 创建 Page 对象,设置当前页和每页大小 + IPage page = new Page<>(pageNum, pageSize); + + // 将 List 设置为 records + page.setRecords(collect); + return page; + } + } \ No newline at end of file diff --git a/ruoyi-test/src/main/java/com/ruoyi/test/seriver/Impl/StudentClassServiceImpl.java b/ruoyi-test/src/main/java/com/ruoyi/test/seriver/Impl/StudentClassServiceImpl.java index 0c2a424..a501bd9 100644 --- a/ruoyi-test/src/main/java/com/ruoyi/test/seriver/Impl/StudentClassServiceImpl.java +++ b/ruoyi-test/src/main/java/com/ruoyi/test/seriver/Impl/StudentClassServiceImpl.java @@ -73,5 +73,24 @@ public class StudentClassServiceImpl extends ServiceImpl getStudentClassByTeacherIdList(List teacherManageClasses) { + // 用于存储查询结果的学生ID列表 + List studentIds = teacherManageClasses.stream() + .flatMap(teacherManageClass -> { + // 对每个TeacherManageClass查询符合的学生ID + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(StudentClass::getClass1, teacherManageClass.getClass1()) + .eq(StudentClass::getGrade, teacherManageClass.getGrade()); + + // 执行查询,获取学生ID列表 + List ids = studentClassMapper.selectList(queryWrapper); + return ids.stream(); + }) + .collect(Collectors.toList()); // 最终返回所有符合条件的学生ID列表 + + return studentIds; + } + } diff --git a/ruoyi-test/src/main/resources/mapper/ExamPaperMapper.xml b/ruoyi-test/src/main/resources/mapper/ExamPaperMapper.xml index bb2997f..49864cb 100644 --- a/ruoyi-test/src/main/resources/mapper/ExamPaperMapper.xml +++ b/ruoyi-test/src/main/resources/mapper/ExamPaperMapper.xml @@ -7,6 +7,7 @@ insert into exam_paper( + gl_id, grade, subject, name, @@ -14,6 +15,7 @@ time, createtime )values ( + #{paperCreateDO.glId} #{paperCreateDO.grade}, #{paperCreateDO.subject}, #{paperCreateDO.name}, diff --git a/ruoyi-test/src/main/resources/mapper/MarkedtestMapper.xml b/ruoyi-test/src/main/resources/mapper/MarkedtestMapper.xml index 3e4e67d..1dc307c 100644 --- a/ruoyi-test/src/main/resources/mapper/MarkedtestMapper.xml +++ b/ruoyi-test/src/main/resources/mapper/MarkedtestMapper.xml @@ -14,7 +14,8 @@ tquestions, totalquestions, time, - finishtime + finishtime, + status )values ( #{markedtest.senderId}, #{markedtest.testid}, @@ -24,6 +25,7 @@ #{markedtest.totalquestions}, #{markedtest.time}, #{markedtest.finishtime} + #{markedtest.status} ) diff --git a/vue2/vue/src/components/Teacher/Aside.vue b/vue2/vue/src/components/Teacher/Aside.vue index 5171a70..d7d783d 100644 --- a/vue2/vue/src/components/Teacher/Aside.vue +++ b/vue2/vue/src/components/Teacher/Aside.vue @@ -15,14 +15,17 @@ 主页 - - - 试卷中心 - - + + + + + + + - 分数查询 + 分数中心 + 批改中心 diff --git a/vue2/vue/src/router/index.js b/vue2/vue/src/router/index.js index 4f63915..d4453d7 100644 --- a/vue2/vue/src/router/index.js +++ b/vue2/vue/src/router/index.js @@ -8,6 +8,18 @@ import store from '../store'; // 引入 Vuex store Vue.use(VueRouter); const routes = [ + { + path:'/teacher/score', + name:'Score', + component: () => import(/* webpackChunkName: "about" */ '../views/Teacher/Score.vue'), + meta: { requiresAuth: true } + }, + { + path:'/teacher/correctExamPaper', + name:'CorrectExamPaper', + component: () => import(/* webpackChunkName: "about" */ '../views/Teacher/CorrectExamPaper.vue'), + meta: { requiresAuth: true } + }, { path:'/teacher/viewExamPaper', name:'ViewExamPaper', diff --git a/vue2/vue/src/views/Student/Exam.vue b/vue2/vue/src/views/Student/Exam.vue index c151540..9542844 100644 --- a/vue2/vue/src/views/Student/Exam.vue +++ b/vue2/vue/src/views/Student/Exam.vue @@ -212,8 +212,6 @@ export default { questionCount: record.totalquestion, totalScore: record.totalscore, time: record.time, - startTime: record.start_time || "未设置", - endTime: record.end_time || "未设置", hasTaken: hasTaken, }; }) diff --git a/vue2/vue/src/views/Student/TestPaperDetail.vue b/vue2/vue/src/views/Student/TestPaperDetail.vue index 45bd247..e043487 100644 --- a/vue2/vue/src/views/Student/TestPaperDetail.vue +++ b/vue2/vue/src/views/Student/TestPaperDetail.vue @@ -75,8 +75,8 @@ -

你的答案:{{ question.answer }}

-

正确答案:{{ question.idanswer }}

+

你的答案:{{ question.idanswer }}

+

正确答案:{{ question.answer }}

分数:{{ question.score }} 分

解析:{{ question.analysis }}

diff --git a/vue2/vue/src/views/Teacher/Correct.vue b/vue2/vue/src/views/Teacher/Correct.vue index e96a09f..a1163dc 100644 --- a/vue2/vue/src/views/Teacher/Correct.vue +++ b/vue2/vue/src/views/Teacher/Correct.vue @@ -164,6 +164,7 @@ export default { if (response.data.code == 200) { this.examPapers = response.data.data; this.filteredExamPapers = [...this.examPapers]; // Initially, show all exam papers + console.log('examPapers', this.filteredExamPapers); } else { alert("数据加载失败"); } @@ -187,7 +188,11 @@ export default { }); }, correctPaper(paper){ - + console.log('paper', paper); + this.$router.push({ + name: 'CorrectExamPaper', + query: { userId: this.userId,studentId: paper.sendId, testid: paper.testId ,name: paper.name} // 传递试卷 ID + }); }, async remind(paper){ const name = paper.name; diff --git a/vue2/vue/src/views/Teacher/CorrectExamPaper.vue b/vue2/vue/src/views/Teacher/CorrectExamPaper.vue new file mode 100644 index 0000000..d6b82a0 --- /dev/null +++ b/vue2/vue/src/views/Teacher/CorrectExamPaper.vue @@ -0,0 +1,481 @@ + + + + + + diff --git a/vue2/vue/src/views/Teacher/Score.vue b/vue2/vue/src/views/Teacher/Score.vue new file mode 100644 index 0000000..09b462e --- /dev/null +++ b/vue2/vue/src/views/Teacher/Score.vue @@ -0,0 +1,191 @@ + + + + + diff --git a/vue2/vue/src/views/Teacher/ViewExamPaper.vue b/vue2/vue/src/views/Teacher/ViewExamPaper.vue index 9813211..85a4691 100644 --- a/vue2/vue/src/views/Teacher/ViewExamPaper.vue +++ b/vue2/vue/src/views/Teacher/ViewExamPaper.vue @@ -17,7 +17,11 @@ v-for="(question, index) in questions" :key="question.id" class="question-box" - :class="{ answered: answers[question.id]?.length > 0, active: currentQuestionIndex === index, correct: question.tf === 'true', incorrect: question.tf === 'false' }" + :class="{ answered: answers[question.id]?.length > 0, + active: currentQuestionIndex === index, + correct: question.tf === 'true', + incorrect: question.tf === 'false' + }" @click="scrollToQuestion(index)" > {{ index + 1 }} @@ -76,8 +80,8 @@ -

你的答案:{{ question.answer }}

-

正确答案:{{ question.idanswer }}

+

你的答案:{{ question.idanswer }}

+

正确答案:{{ question.answer }}

分数:{{ question.score }} 分

解析:{{ question.analysis }}