Skip to content

feat(be): contest problem statistics graph#3298

Merged
hjkim24 merged 20 commits intomainfrom
t2254-contest-problem-statistics-graph
Jan 20, 2026
Merged

feat(be): contest problem statistics graph#3298
hjkim24 merged 20 commits intomainfrom
t2254-contest-problem-statistics-graph

Conversation

@seoin2744
Copy link
Copy Markdown
Contributor

@seoin2744 seoin2744 commented Nov 18, 2025

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

@skkuding-bot
Copy link
Copy Markdown

skkuding-bot Bot commented Nov 18, 2025

Syncing Preview App Succeeded

Application: frontend
Revision: 0e51eba9da20b10d1f0980548b0f00e1be9cda50
Health Status: Healthy

Open Preview | View in Argo CD

@seoin2744 seoin2744 changed the title contest problem statistics graph feat(be): contest problem statistics graph Nov 18, 2025
@skkuding-bot
Copy link
Copy Markdown

skkuding-bot Bot commented Nov 20, 2025

Syncing Preview App Succeeded

Application: frontend
Revision: ae254da4fa345686c945bcf9de70faa7e326b96c
Health Status: Healthy

Open Preview | View in Argo CD

@skkuding-bot
Copy link
Copy Markdown

skkuding-bot Bot commented Nov 20, 2025

Syncing Preview App Succeeded

Application: frontend
Revision: e275d1e7400e8799c1d1d6996430ed358410a5d8
Health Status: Healthy

Open Preview | View in Argo CD

@skkuding-bot
Copy link
Copy Markdown

skkuding-bot Bot commented Nov 20, 2025

Syncing Preview App Succeeded

Application: frontend
Revision: b82ef258a815b725720a9eb4d99ca7d8615cf86a
Health Status: Healthy

Open Preview | View in Argo CD

Copy link
Copy Markdown
Contributor

@hjkim24 hjkim24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

일단 컨트롤러랑 서비스 부분만 봤어요! 수정 부탁드립니당

Comment thread apps/backend/apps/client/src/problem/problem.controller.ts Outdated
Comment thread apps/backend/apps/client/src/problem/problem.service.ts Outdated
Comment thread apps/backend/apps/client/src/problem/problem.service.ts Outdated
Comment thread apps/backend/apps/client/src/problem/problem.service.ts Outdated
Comment thread apps/backend/apps/client/src/problem/problem.service.ts Outdated
Comment thread apps/backend/apps/client/src/problem/problem.controller.ts Outdated
@skkuding-bot
Copy link
Copy Markdown

skkuding-bot Bot commented Nov 21, 2025

Syncing Preview App Succeeded

Application: frontend
Revision: 3e97de4fd8198ca83b17704e5797d80da62fece2
Health Status: Healthy

Open Preview | View in Argo CD

@RyuRaseul RyuRaseul added ⛳️ team-backend 🍊squad-유자차 스쿼드 유자차 작업물입니다 labels Jan 9, 2026
@skkuding-bot
Copy link
Copy Markdown

skkuding-bot Bot commented Jan 19, 2026

Syncing Preview App Succeeded

Application: frontend
Revision: c1e7b00866b958ef5c1a3bc6cc3cc07633d624a5
Health Status: Healthy

Open Preview | View in Argo CD

@seoin2744 seoin2744 requested a review from hjkim24 January 19, 2026 17:53
@skkuding-bot
Copy link
Copy Markdown

skkuding-bot Bot commented Jan 19, 2026

Syncing Preview App Succeeded

Application: frontend
Revision: 613cd0b7e21865386d0f9c8dbb5410e2b4367125
Health Status: Healthy

Open Preview | View in Argo CD

@skkuding-bot
Copy link
Copy Markdown

skkuding-bot Bot commented Jan 19, 2026

Syncing Preview App Succeeded

Application: frontend
Revision: e7f8f853b004929cb241317ee885ffdff050263c
Health Status: Healthy

Open Preview | View in Argo CD

@skkuding-bot
Copy link
Copy Markdown

skkuding-bot Bot commented Jan 19, 2026

Syncing Preview App Succeeded

Application: frontend
Revision: b10f49f88fc086e0b3c54e3dc3410cdf4f7b28bd
Health Status: Healthy

Open Preview | View in Argo CD

Copy link
Copy Markdown
Contributor

@hjkim24 hjkim24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 마지막 태스크 수고 많으셨습니다!!

@hjkim24 hjkim24 added this pull request to the merge queue Jan 20, 2026
Merged via the queue into main with commit 705aa73 Jan 20, 2026
11 checks passed
@hjkim24 hjkim24 deleted the t2254-contest-problem-statistics-graph branch January 20, 2026 06:31
@seoin2744 seoin2744 self-assigned this Jan 24, 2026
junhyunlee123 pushed a commit that referenced this pull request Jan 30, 2026
### 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍊squad-유자차 스쿼드 유자차 작업물입니다 ⛳️ team-backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants