From 3704d52a264bbb53169879217df8756010f3c5a3 Mon Sep 17 00:00:00 2001 From: yanlongqi Date: Mon, 1 Dec 2025 21:18:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A8=A1=E6=8B=9F=E8=80=83?= =?UTF-8?q?=E8=AF=95=E8=AF=95=E5=8D=B7=E7=BB=93=E6=9E=84=E5=92=8C=E8=AF=84?= =?UTF-8?q?=E5=88=86=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改试卷组成为: - 填空题:20道(40分,每题2分) - 判断题:10道(10分,每题1分) - 单选题:10道(10分,每题1分) - 多选题:10道(20分,每题2分) - 简答题:1道(10分) - 论述题:2道供选择,根据职位类型作答1道(10分) 总分:100分(包含两道论述题但用户只需选答其中一道) 主要变更: - exam_handler.go: 更新试卷创建时的题型配置 - exam_grading.go: 更新阅卷时的分值映射表 - 确保创建和评分逻辑一致 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- internal/handlers/exam_grading.go | 14 +++++++------- internal/handlers/exam_handler.go | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/internal/handlers/exam_grading.go b/internal/handlers/exam_grading.go index 900d64e..d50197f 100644 --- a/internal/handlers/exam_grading.go +++ b/internal/handlers/exam_grading.go @@ -68,13 +68,13 @@ func gradeExam(recordID uint, examID uint, userID uint) { // 使用固定的题型分值映射 scoreMap := map[string]float64{ - "fill-in-blank": 2.0, - "true-false": 2.0, - "multiple-choice": 1.0, - "multiple-selection": 2.5, - "short-answer": 8.0, // 简答题 8 分 - "ordinary-essay": 9.0, // 论述题 9 分 - "management-essay": 9.0, // 论述题 9 分 + "fill-in-blank": 2.0, // 填空题每题2分 + "true-false": 1.0, // 判断题每题1分 + "multiple-choice": 1.0, // 单选题每题1分 + "multiple-selection": 2.0, // 多选题每题2分 + "short-answer": 10.0, // 简答题10分 + "ordinary-essay": 10.0, // 论述题10分 + "management-essay": 10.0, // 论述题10分 } // 评分 diff --git a/internal/handlers/exam_handler.go b/internal/handlers/exam_handler.go index 600c521..bdc3aac 100644 --- a/internal/handlers/exam_handler.go +++ b/internal/handlers/exam_handler.go @@ -46,13 +46,13 @@ func CreateExam(c *gin.Context) { // 使用固定的题型配置(总分100分) questionTypes := []models.QuestionTypeConfig{ - {Type: "fill-in-blank", Count: 10, Score: 2.0}, // 20分 - {Type: "true-false", Count: 10, Score: 2.0}, // 20分 + {Type: "fill-in-blank", Count: 20, Score: 2.0}, // 40分 + {Type: "true-false", Count: 10, Score: 1.0}, // 10分 {Type: "multiple-choice", Count: 10, Score: 1.0}, // 10分 - {Type: "multiple-selection", Count: 10, Score: 2.5}, // 25分 - {Type: "short-answer", Count: 2, Score: 10.0}, // 20分 - {Type: "ordinary-essay", Count: 1, Score: 4.5}, // 4.5分(普通涉密人员论述题) - {Type: "management-essay", Count: 1, Score: 4.5}, // 4.5分(保密管理人员论述题) + {Type: "multiple-selection", Count: 10, Score: 2.0}, // 20分 + {Type: "short-answer", Count: 1, Score: 10.0}, // 10分 + {Type: "ordinary-essay", Count: 1, Score: 10.0}, // 10分(普通涉密人员论述题) + {Type: "management-essay", Count: 1, Score: 10.0}, // 10分(保密管理人员论述题) } // 按题型配置随机抽取题目