-
Notifications
You must be signed in to change notification settings - Fork 15
feat(be): contest problem statistics graph #3298
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
base: main
Are you sure you want to change the base?
Conversation
…atistics function
|
✅ Syncing Preview App Succeeded Application: |
|
✅ Syncing Preview App Succeeded Application: |
|
✅ Syncing Preview App Succeeded Application: |
|
✅ Syncing Preview App Succeeded Application: |
hjkim24
left a comment
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.
일단 컨트롤러랑 서비스 부분만 봤어요! 수정 부탁드립니당
| }) | ||
| } | ||
|
|
||
| @Get(':problemId/statistics/graph') |
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.
저희 대회에 대한 통계니까 Problem 쪽이 아니라 Contest 쪽에 두는게 맞을 것 같아요! 컨트롤러랑 서비스 모두 옮겨주세요
| mode?: 'distribution' | 'timeline' | ||
| }) { | ||
| // 대회가 종료된 상태인지 확인 | ||
| const contest = await this.prisma.contest.findUniqueOrThrow({ |
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.
findUniqueOrThrow를 쓰면 404에 대한 에러 처리가 깔끔하지 않아서 findUnique나 First로 찾고 !contest로 EntityNotExist 예외 처리 던져주는게 더 좋을 것 같아요!
| ) | ||
| } | ||
|
|
||
| if (!contest.startTime) { |
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.
이렇게 하면 큰 의미가 있는건지 잘 모르겠어요..
| } | ||
|
|
||
| // 대회 소속 문제 검증 | ||
| await this.prisma.contestProblem.findUniqueOrThrow({ |
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.
이것도 위에랑 마찬가지!
| async getContestProblemStatistics({ | ||
| contestId, | ||
| problemId, | ||
| mode |
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.
mode를 두신 이유가 무엇일까요? 오답 유형 분포랑 문제별 타임라인은 무조건 같이 보여주는 걸로 알고 있는데
| @Get(':problemId/statistics/graph') | ||
| @UserNullWhenAuthFailedIfPublic() | ||
| async getContestProblemStatistics( | ||
| @Req() req: AuthenticatedRequest, |
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.
사용하지 않는 파라미터 삭제해주세요!
…ub.com/skkuding/codedang into t2254-contest-problem-statistics-graph
|
✅ Syncing Preview App Succeeded Application: |
Description
대회 종료 후 특정 대회의 특정 문제에 대한 통계 그래프 데이터를 조회할 수 있는 API
<기능>
오답 분포 통계 (Distribution)
WA,TLE,MLE,RE,CE,ETCWA← WrongAnswerTLE← TimeLimitExceededMLE← MemoryLimitExceededRE← RuntimeError + SegmentationFaultErrorCE← CompileErrorETC← ServerError + OutputLimitExceeded시간별 제출 추이 통계 (Timeline)
Accepted제출 수와Wrong제출 수(WA/TLE/MLE/RE/CE/ETC의 합)를 집계함.모드 선택 기능
mode쿼리 파라미터를 통해 원하는 통계만 선택적으로 조회할 수 있습니다mode=distribution: 오답 분포만 반환mode=timeline: 시간별 제출 추이만 반환mode미지정 시: 두 통계 모두 반환 (both)접근 정책:
ForbiddenAccessException발생)Additional context
StatisticsModeValidationPipe를 추가하여mode쿼리 파라미터의 유효성을 검증Before submitting the PR, please make sure you do the following
fixes #123).