调整模拟考试试卷结构和评分规则
修改试卷组成为: - 填空题: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 <noreply@anthropic.com>
This commit is contained in:
parent
4f95514af8
commit
3704d52a26
@ -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分
|
||||
}
|
||||
|
||||
// 评分
|
||||
|
||||
@ -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分(保密管理人员论述题)
|
||||
}
|
||||
|
||||
// 按题型配置随机抽取题目
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user