24 lines
916 B
Go
24 lines
916 B
Go
package quesbank
|
|
|
|
// QuestionType 题目类型
|
|
type QuestionType int
|
|
|
|
const (
|
|
QuestionTypeSingleChoice QuestionType = 0 // 单选题
|
|
QuestionTypeMultipleChoice QuestionType = 1 // 多选题
|
|
QuestionTypeFillBlank QuestionType = 2 // 填空题
|
|
QuestionTypeTrueFalse QuestionType = 3 // 判断题
|
|
QuestionTypeShortAnswer QuestionType = 4 // 简答题
|
|
)
|
|
|
|
// Question 通用题目结构
|
|
type Question struct {
|
|
Qid string `json:"qid"` // 题目ID
|
|
Type QuestionType `json:"type"` // 题目类型
|
|
Text string `json:"text"` // 题目内容
|
|
Options map[string]string `json:"options"` // 选项 (A: xxx, B: xxx)
|
|
Answers []string `json:"answers"` // 答案
|
|
BlankCount int `json:"blankCount"` // 填空题空格数量
|
|
BlankAnswer map[string]string `json:"blankAnswer"` // 填空题答案
|
|
}
|