From ef4db46a90b062fcc3e226314730df8b88a5703a Mon Sep 17 00:00:00 2001 From: yuan <3558860895@qq.com> Date: Wed, 20 Nov 2024 01:03:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=AE=8C=E5=96=84=E8=80=83?= =?UTF-8?q?=E8=AF=95=E7=AD=94=E9=A2=98=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi/test/domain/DO/AnswerSheetDO.java | 2 + .../ruoyi/test/domain/DO/QuestionbankDO.java | 1 + .../Impl/AnswerSheetDOServiceImpl.java | 5 +- vue2/vue/src/views/Student/Exam.vue | 11 +- vue2/vue/src/views/Student/ExamPaper.vue | 304 ++++++++++++------ 5 files changed, 221 insertions(+), 102 deletions(-) diff --git a/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/AnswerSheetDO.java b/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/AnswerSheetDO.java index b2ee4a1..365bb76 100644 --- a/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/AnswerSheetDO.java +++ b/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/AnswerSheetDO.java @@ -19,4 +19,6 @@ public class AnswerSheetDO { private List list; + private double sumscore; + } diff --git a/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/QuestionbankDO.java b/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/QuestionbankDO.java index 2f957c1..dbd9163 100644 --- a/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/QuestionbankDO.java +++ b/ruoyi-test/src/main/java/com/ruoyi/test/domain/DO/QuestionbankDO.java @@ -11,5 +11,6 @@ public class QuestionbankDO { private long id; private String content; private List> chance; + private double score; } 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 48a9edd..a994562 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 @@ -50,6 +50,7 @@ public class AnswerSheetDOServiceImpl extends ServiceImpl list = examCreateMapper.selectList(queryWrapper); List l = new ArrayList<>(); + double sum = 0; Gson gson = new Gson(); for(ExamCreate examCreate : list){ LambdaQueryWrapper queryWrapper1 = new LambdaQueryWrapper<>(); @@ -58,17 +59,19 @@ public class AnswerSheetDOServiceImpl extends ServiceImpl> listMap = gson.fromJson(chance,List.class); questionbankDO.setChance(listMap); l.add(questionbankDO); } - AnswerSheetDO answerSheetDO = new AnswerSheetDO(); answerSheetDO.setGrade(grade); answerSheetDO.setSubject(subject); answerSheetDO.setName(name); answerSheetDO.setList(l); + answerSheetDO.setSumscore(sum); return answerSheetDO; } } diff --git a/vue2/vue/src/views/Student/Exam.vue b/vue2/vue/src/views/Student/Exam.vue index 532ec4c..d3225f6 100644 --- a/vue2/vue/src/views/Student/Exam.vue +++ b/vue2/vue/src/views/Student/Exam.vue @@ -46,10 +46,10 @@

学科:{{ paper.subject }}

题目数:{{ paper.questionCount }}

试卷总分:{{ paper.totalScore }}

-

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

+

考试时长:{{ paper.time + " 分钟"}}

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

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

- + @@ -69,6 +69,7 @@ export default { components: {Aside, Header}, data() { return { + collapse: false, paperTypes: ["固定试卷", "时段试卷", "班级试卷"], // 试卷类型 subjects: ["语文", "数学"], // 学科 selectedType: "班级试卷", // 默认选中的试卷类型 @@ -104,8 +105,8 @@ export default { }, }, methods: { - startExam(name,subject) { - this.$router.push({ name: "ExamPaper", query: { name: name, subject: subject } }); + startExam(id,name,subject,time) { + this.$router.push({ name: "ExamPaper", query: { id:id ,name: name, subject: subject ,time:time} }); }, handleTypeChange(type) { this.selectedType = type; // 修改选中的试卷类型 @@ -149,7 +150,7 @@ export default { subject: record.subject, questionCount: record.totalquestion, totalScore: record.totalscore, - time: record.time + "分钟", + time: record.time, startTime: record.start_time || "未设置", endTime: record.end_time || "未设置", })); diff --git a/vue2/vue/src/views/Student/ExamPaper.vue b/vue2/vue/src/views/Student/ExamPaper.vue index 0ffdbf9..476b28a 100644 --- a/vue2/vue/src/views/Student/ExamPaper.vue +++ b/vue2/vue/src/views/Student/ExamPaper.vue @@ -5,15 +5,34 @@

{{ examTitle }}

总分:{{ totalScore }}   时长:{{ duration }}

剩余时间
{{ formattedTime }}

- + +
+ +
+ {{ index + 1 }} +
+
- -
-
-

{{ index + 1 }}. {{ question.text }}

+ +
+
+

{{ index + 1 }}. {{ question.text }} + ({{ question.score }} 分) +

- + - +