Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrProtoQuestionSetLevelInvalid = errors.New("question set level is invalid") ErrProtoQuestionSetIDInvalid = errors.New("question set id is invalid") ErrProtoQuestionTypeInvalid = errors.New("question type is invalid") )
View Source
var ProtoLevelMap = map[questionsv1.DifficultyLevel]models.QuestionSetLevel{ questionsv1.DifficultyLevel_DIFFICULTY_LEVEL_UNSPECIFIED: models.Unknown, questionsv1.DifficultyLevel_DIFFICULTY_LEVEL_EASY: models.Easy, questionsv1.DifficultyLevel_DIFFICULTY_LEVEL_MEDIUM: models.Medium, questionsv1.DifficultyLevel_DIFFICULTY_LEVEL_HARD: models.Hard, }
Functions ¶
func ConvertProtoQuestionSet ¶
func ConvertProtoQuestionSet(protoQuestionSet *questionsv1.QuestionSet) (*models.QuestionSet, error)
Converts protobuf's generated question set to internal model question set.
TODO: Add question difficulty to protobuf, currently missing
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.