feat(be): contest problem statistics graph#3298
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.
일단 컨트롤러랑 서비스 부분만 봤어요! 수정 부탁드립니당
…ub.com/skkuding/codedang into t2254-contest-problem-statistics-graph
|
✅ Syncing Preview App Succeeded Application: |
|
✅ 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.
LGTM! 마지막 태스크 수고 많으셨습니다!!
### Description
대회 종료 후 특정 대회의 특정 문제에 대한 통계 그래프 데이터를 조회할 수 있는 API
<기능>
1. **오답 분포 통계 (Distribution)**
- 문제에 대한 제출 결과 유형별 분포 그래프
- 지원하는 결과 유형: `WA`, `TLE`, `MLE`, `RE`, `CE`, `ETC`
- `WA` ← WrongAnswer
- `TLE` ← TimeLimitExceeded
- `MLE` ← MemoryLimitExceeded
- `RE` ← RuntimeError + SegmentationFaultError
- `CE` ← CompileError
- `ETC` ← ServerError + OutputLimitExceeded
- 총 제출 수와 각 결과 유형별 제출 수를 반환함.
2. **시간별 제출 추이 통계 (Timeline)**
- 대회 기간을 6등분하여 각 시간대별 제출 추이 그래프
- 타임슬롯 간격은 대회 시간에 따라 동적으로 결정됨 (예: 3시간 대회 → 30분, 6시간 대회 → 60분)
- 각 시간 슬롯별로 `Accepted` 제출 수와 `Wrong` 제출 수(WA/TLE/MLE/RE/CE/ETC의 합)를 집계함.
- 타임스탬프는 ISO8601 형식으로 반환됨.
**접근 정책:**
- 대회 종료 후에만 조회 가능 (대회 종료 전 접근 시 `ForbiddenAccessException` 발생)
- 인증 불필요 (대회 종료 후 누구나 접근 가능)
- 대회에 속한 문제인지 검증 후 통계 데이터 반환
### Additional context
- 대회 시작 시간과 종료 시간을 기반으로 타임라인을 6등분하여 슬롯을 생성
- 실제 사용자의 제출만 집계.
- 시드 데이터를 추가하여 스테이지에서 확인할 수 있게 함.
---
### Before submitting the PR, please make sure you do the following
- [ ] Read the [Contributing
Guidelines](https://github.com/skkuding/next/blob/main/CONTRIBUTING.md)
- [ ] Read the [Contributing
Guidelines](https://github.com/skkuding/next/blob/main/CONTRIBUTING.md#pr-and-branch)
and follow the [Commit
Convention](https://github.com/skkuding/next/blob/main/CONTRIBUTING.md#commit-convention)
- [ ] Provide a description in this PR that addresses **what** the PR is
solving, or reference the issue that it solves (e.g. `fixes #123`).
- [ ] Ideally, include relevant tests that fail without this PR but pass
with it.
---------
Co-authored-by: Kim Hakjae <37476664+hjkim24@users.noreply.github.com>
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의 합)를 집계함.접근 정책:
ForbiddenAccessException발생)Additional context
Before submitting the PR, please make sure you do the following
fixes #123).