Skip to content

Commit 689fac9

Browse files
committed
including whole category in round data
1 parent 5a60ee7 commit 689fac9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

quiz/types.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ const (
8484
)
8585

8686
type Round struct {
87-
Question string `json:"question"`
88-
Answers []string `json:"answers"`
89-
Correct int `json:"correct,omitempty"`
90-
Current int `json:"current_round"`
91-
Max int `json:"max_round"`
92-
Category string `json:"category"`
87+
Question string `json:"question"`
88+
Answers []string `json:"answers"`
89+
Correct int `json:"correct,omitempty"`
90+
Current int `json:"current_round"`
91+
Max int `json:"max_round"`
92+
Category CategoryDefinition `json:"category"`
9393
}
9494

9595
type RoundSummary struct {
@@ -229,7 +229,7 @@ func (c Category) GetRounds(n int) []*Round {
229229
continue
230230
}
231231
round := q.ToRound()
232-
round.Category = c.ID
232+
round.Category = c.GetDefinition()
233233
rounds = append(rounds, &round)
234234
}
235235
return rounds

0 commit comments

Comments
 (0)