exeamLog.go 1.5 KB

1234567891011121314151617181920212223242526272829
  1. package model
  2. import (
  3. "time"
  4. "go.mongodb.org/mongo-driver/bson/primitive"
  5. )
  6. type ExeamLog struct {
  7. Id primitive.ObjectID `bson:"_id,omitempty" json:"_id"`
  8. Cid string `bson:"cid,omitempty" json:"cid"` // 分类id
  9. Uid string `bson:"uid,omitempty" json:"uid"` // 用户id
  10. Title string `bson:"title,omitempty" json:"title"` // 考核标题
  11. Type string `bson:"type,omitempty" json:"type"` // 考核类型: 理论/实操
  12. Correct *int `bson:"correct,omitempty" json:"correct"` // 正确题目数
  13. Error *int `bson:"error,omitempty" json:"error"` // 错误题目数
  14. TotalScore *int `bson:"totalScore,omitempty" json:"totalScore"` // 总分
  15. ExeamResult map[string][]*TestRecord `bson:"exeamResult,omitempty" json:"exeamResult"` // 考核结果/ choiceQuestion:[{}] judgeQuestion:[{}]
  16. // 成绩
  17. Score *int `bson:"score,omitempty" json:"score"` // 分数
  18. CompleteRate *int `bson:"completeRate,omitempty" json:"completeRate"` // 完成进度
  19. CreateTime time.Time `bson:"createTime,omitempty" json:"createTime"`
  20. UpdateTime time.Time `bson:"updateTime,omitempty" json:"updateTime"`
  21. }
  22. type TestRecord struct {
  23. Test
  24. ExeamAnswer string `bson:"exeamAnswer,omitempty" json:"exeamAnswer"` // 答案
  25. }