Skip to content

[DP-411] 퀴즈 이력 API 테스트 커버리지 보완#136

Merged
github-actions[bot] merged 2 commits intodevelopV2from
auto/feature/DP-411-quiz-history
Apr 24, 2026
Merged

[DP-411] 퀴즈 이력 API 테스트 커버리지 보완#136
github-actions[bot] merged 2 commits intodevelopV2from
auto/feature/DP-411-quiz-history

Conversation

@nYeonG4001
Copy link
Copy Markdown
Collaborator

Summary

  • 퀴즈 이력 목록 조회 (GET /users/me/quiz-history): 사용자별 퀴즈 시도 이력을 페이징 반환. sort=newest|oldest 지원, DynamoDB 배치 조회로 첫 번째 문제 텍스트(preview) 포함
  • 퀴즈 결과 상세 조회 (GET /quiz-history/{attemptId}): 특정 시도의 문제 목록(DynamoDB) + 내 답안(PostgreSQL) + 획득 포인트 반환. 타인 접근 시 403
  • 퀴즈 제출 시 답안 저장 (POST /contents/{contentId}/quiz/submit): answers[] 필드 추가, quiz_attempt_answers 테이블에 문항별 정답 여부 저장
  • AiSummaryService.fromAiServerLevel 추가: AI 레벨(mid) → 앱 레벨(MIDDLE) 역변환
  • 에러코드 추가: QUIZ_ATTEMPT_NOT_FOUND (404), QUIZ_ATTEMPT_FORBIDDEN (403)

New Endpoints

Method Endpoint Auth Description
GET /users/me/quiz-history O 퀴즈 이력 목록 (페이징, 정렬)
GET /quiz-history/{attemptId} O 퀴즈 결과 상세

New Tables

  • quiz_attempt_answers: 퀴즈 시도별 문항 답안 저장 (attempt_id FK, question_id, selected_option_id, answer_text, is_correct)

Test Coverage

  • AiQuizServiceTest: submitQuiz(답안 저장), getQuizHistory, getQuizResult 10케이스 추가
  • AiQuizRepositoryTest (신규): batchFindFirstQuestions 6케이스
  • QuizHistoryControllerTest (신규): 목록 조회 200, 빈 결과 200, 상세 조회 200, 403, 404
  • AiSummaryServiceTest: fromAiServerLevel 케이스 추가

Test plan

  • GET /users/me/quiz-history — 로그인 사용자의 이력 목록 페이징 확인
  • GET /users/me/quiz-history?sort=oldest — 정렬 순서 확인
  • GET /quiz-history/{attemptId} — 내 시도 상세 조회 200
  • GET /quiz-history/{attemptId} — 타인 시도 접근 시 403
  • GET /quiz-history/{attemptId} — 존재하지 않는 attemptId 시 404
  • POST /contents/{contentId}/quiz/submit — answers 포함 제출 후 DB 저장 확인

@github-actions github-actions Bot merged commit b75fa58 into developV2 Apr 24, 2026
2 checks passed
@sonarqubecloud
Copy link
Copy Markdown

@nYeonG4001 nYeonG4001 changed the title [DP-411] 퀴즈 이력 목록/상세 API + 제출 시 답안 저장 [DP-411] 퀴즈 이력 API 테스트 커버리지 보완 Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant