Skip to content

Commit 6b31961

Browse files
authored
Merge pull request #29 from database-playground/pan93412/dbp-102-api-可以回傳一個題目的嘗試次數和攻克次數
feat(graph): implement statistics of questions
2 parents a96ab04 + f436408 commit 6b31961

File tree

4 files changed

+616
-0
lines changed

4 files changed

+616
-0
lines changed

graph/question.graphqls

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ extend type Question {
8787
Have you solved the question?
8888
"""
8989
solved: Boolean!
90+
91+
"""
92+
The statistics of the question, e.g. pass rate.
93+
"""
94+
statistics: QuestionStatistics!
9095
}
9196

9297
extend type User {
@@ -101,6 +106,28 @@ type SubmissionStatistics {
101106
solvedQuestionByDifficulty: [SolvedQuestionByDifficulty!]!
102107
}
103108

109+
type QuestionStatistics {
110+
"""
111+
Number of correct submissions
112+
"""
113+
correctSubmissionCount: Int!
114+
115+
"""
116+
Total number of submissions
117+
"""
118+
submissionCount: Int!
119+
120+
"""
121+
Number of users who attempted
122+
"""
123+
attemptedUsers: Int!
124+
125+
"""
126+
Number of users who passed
127+
"""
128+
passedUsers: Int!
129+
}
130+
104131
type SolvedQuestionByDifficulty {
105132
difficulty: QuestionDifficulty!
106133
solvedQuestions: Int!

graph/question.resolvers.go

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)