Skip to content

Commit 04aba5b

Browse files
authored
Merge pull request #32 from ClassConnect-org/tests
added correct answer to questionDTO
2 parents 600d310 + 022d33a commit 04aba5b

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

internal/dto/question_response.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ import (
99
// QuestionResponseDTO represents the structure to be used
1010
// when returning a question object in an HTTP response.
1111
type 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

Comments
 (0)