@@ -9,14 +9,15 @@ import (
99// QuestionResponseDTO represents the structure to be used
1010// when returning a question object in an HTTP response.
1111type QuestionResponseDTO struct {
12- ID * primitive.ObjectID `json:"id"`
13- CourseID * uuid.UUID `json:"course_id"`
14- Title * string `json:"title"`
15- Description * string `json:"description"`
16- Tags * []int `json:"tags"`
17- AuthorID * uuid.UUID `json:"authorid"`
18- Votes * int `json:"votes"`
19- UserVote * int `json:"user_vote"` // 1 for upvote, -1 for downvote, 0 for no vote
20- CreatedAt * time.Time `json:"created_at"`
21- Answers * []AnswerResponseDTO `json:"answers"`
12+ ID * primitive.ObjectID `json:"id"`
13+ CourseID * uuid.UUID `json:"course_id"`
14+ Title * string `json:"title"`
15+ Description * string `json:"description"`
16+ Tags * []int `json:"tags"`
17+ AuthorID * uuid.UUID `json:"authorid"`
18+ Votes * int `json:"votes"`
19+ UserVote * int `json:"user_vote"` // 1 for upvote, -1 for downvote, 0 for no vote
20+ CreatedAt * time.Time `json:"created_at"`
21+ CorrectAnswer * primitive.ObjectID `json:"correct_answer"` // id of the correct answer
22+ Answers * []AnswerResponseDTO `json:"answers"`
2223}
0 commit comments