-
Notifications
You must be signed in to change notification settings - Fork 0
DBP-71: 做題點數 #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DBP-71: 做題點數 #17
The head ref may contain hidden characters: "pan93412/dbp-71-\u5617\u8A66\u505A\u984C\u734E\u52F5\u9EDE\u6578"
Conversation
pan93412
commented
Sep 30, 2025
- feat: add logout and logout_all event
- feat(events): implement submit_answer points
- docs(event): document points
Closed DBP-85 第一名獎勵點數 Closed DBP-71 嘗試做題獎勵點數 Closed DBP-67 每日做題獎勵點數 Closed DBP-66 答對獎勵點數
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a comprehensive points system for question submissions and adds logout event tracking. The changes include logout events for token revocation, a detailed points granting system for various submission scenarios, and comprehensive documentation for the events system.
- Add logout and logout_all events for token management
- Implement points granting for question submissions (first attempt, daily attempt, correct answer, first place)
- Document the complete events and points system
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
internal/useraccount/token.go | Add event triggering for logout and logout_all when revoking tokens |
internal/useraccount/token_test.go | Add tests for logout event triggering in token revocation |
internal/events/constants.go | Add new logout event type constants |
internal/events/points.go | Implement comprehensive points granting system for submissions |
internal/events/points_test.go | Add extensive test coverage for all points granting scenarios |
internal/events/README.md | Document all events and points granting rules |
httpapi/auth/revoke.go | Update to use useraccount context for token revocation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Copilot: Using time.Now().AddDate(0, 0, -1) for daily checks is problematic because it checks for the last 24 hours, not for 'today'. This could miss or incorrectly grant points near midnight. Consider using a date-based comparison instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.