feat: 시험모드(일괄채점·타이머) + 회차별 진입 + 즐겨찾기 왕복토글/정렬 - #14
Conversation
|
Warning Review limit reached
Next review available in: 24 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough연습 설정에 학습·시험 모드, 랜덤·회차 진입, 시간 제한 및 시험 상태가 추가되었습니다. PracticeSession은 모드별 채점과 자동 종료를 처리하고, QuestionCard는 피드백 표시 여부에 따라 선택과 해설 UI를 제어합니다. Changes연습 설정 및 시험 상태
연습 문제 로딩
세션 진행과 표시
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant PracticeSetup
participant PracticePage
participant PracticeSession
participant ProgressRepository
PracticeSetup->>PracticePage: 설정값 전달
PracticePage->>PracticeSession: 질문, mode, timeLimitMs 전달
PracticeSession->>PracticeSession: 답안 선택 및 시간 갱신
PracticeSession->>ProgressRepository: 학습 즉시 기록 또는 시험 제출 기록
PracticeSession-->>PracticePage: 세션 요약 전달
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/features/practice/PracticeSession.tsx (1)
141-149: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win시험모드 조기 종료 시 확인 절차 없음.
그만두기(라인 195-197)와종료(라인 221-223) 버튼이 모두finish()를 즉시 호출합니다. 시험모드에서는finish()가submitExam()으로 이어져 현재까지의 답안을 되돌릴 수 없이 채점·기록합니다. 실수로 클릭하면 남은 문항을 풀 기회가 사라지므로, 시험모드에서 미응답 문항이 남아있을 때는 확인 다이얼로그를 추가하는 것을 권장합니다.♻️ 제안: 미완료 시험 조기 종료 시 확인
function finish() { if (finishedRef.current) return; + if (mode === "exam" && Object.keys(answers).length < questions.length) { + const confirmed = window.confirm("아직 풀지 않은 문제가 있습니다. 지금 제출하시겠습니까?"); + if (!confirmed) return; + } finishedRef.current = true; if (mode === "exam") { submitExam(); } else { onFinish(summarizeSession(questions, answers)); } }Also applies to: 195-197, 221-223
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/features/practice/PracticeSession.tsx` around lines 141 - 149, Update finish in PracticeSession to require confirmation before submitExam when mode is "exam" and unanswered questions remain; only proceed with the existing finishedRef guard and submission after the user confirms, while preserving immediate completion for fully answered exams and non-exam sessions.src/features/practice/PracticeSetup.tsx (1)
51-62: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win회차 목록 로딩이 출석 기록(getAttempts) 실패에 불필요하게 종속됨.
Promise.all로 묶여있어getAttempts()만 실패해도(예: IndexedDB 접근 불가)getExamIndex()가 성공했더라도exams가 빈 배열로 설정되어 회차별 진입 UI 전체가 비어 보이게 됩니다. 두 데이터는 독립적으로 처리하는 것이 더 안전합니다.♻️ 제안: 개별 실패를 허용하도록 분리
useEffect(() => { - Promise.all([questionRepository.getExamIndex(), progressRepository.getAttempts()]).then( - ([examList, attempts]) => { - setExams(examList); - setStatuses(computeExamStatuses(examList, attempts)); - }, - (err) => { - console.error("회차 목록을 불러오지 못했다:", err); - setExams([]); - } - ); + questionRepository.getExamIndex().then( + (examList) => { + setExams(examList); + progressRepository + .getAttempts() + .then((attempts) => setStatuses(computeExamStatuses(examList, attempts))) + .catch((err) => console.error("풀이 기록을 불러오지 못했다:", err)); + }, + (err) => { + console.error("회차 목록을 불러오지 못했다:", err); + setExams([]); + } + ); }, []);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/features/practice/PracticeSetup.tsx` around lines 51 - 62, Update the useEffect loading flow in PracticeSetup so getExamIndex() and getAttempts() are handled independently instead of through Promise.all. Preserve and display the exam list whenever getExamIndex() succeeds, while allowing getAttempts() failure to use an appropriate empty/default status input without clearing exams; retain error handling for exam-index failure.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/app/practice/page.tsx`:
- Around line 29-42: Attach an immediate no-op catch handler to theoryMapPromise
when it is created in the practice page flow, while still awaiting the original
promise later for its result. Ensure failures from getTheoryMap are marked
handled if getQuestions rejects before the await, without changing the existing
question-selection behavior.
---
Nitpick comments:
In `@src/features/practice/PracticeSession.tsx`:
- Around line 141-149: Update finish in PracticeSession to require confirmation
before submitExam when mode is "exam" and unanswered questions remain; only
proceed with the existing finishedRef guard and submission after the user
confirms, while preserving immediate completion for fully answered exams and
non-exam sessions.
In `@src/features/practice/PracticeSetup.tsx`:
- Around line 51-62: Update the useEffect loading flow in PracticeSetup so
getExamIndex() and getAttempts() are handled independently instead of through
Promise.all. Preserve and display the exam list whenever getExamIndex()
succeeds, while allowing getAttempts() failure to use an appropriate
empty/default status input without clearing exams; retain error handling for
exam-index failure.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d8debca7-8569-40fb-9564-f46747a5878e
📒 Files selected for processing (10)
src/app/practice/page.tsxsrc/app/review/page.tsxsrc/features/practice/PracticeSession.tsxsrc/features/practice/PracticeSetup.tsxsrc/features/practice/QuestionCard.tsxsrc/lib/examStatus.test.tssrc/lib/examStatus.tssrc/lib/timer.test.tssrc/lib/timer.tssrc/repositories/QuestionRepository.ts
기능 설명
우선순위 1(시험모드)·2(회차별 진입)·3(즐겨찾기 왕복토글+정렬) 처리.
작업내용
src/lib/examStatus.ts(신설) — 회차별 완료/진행중/미응시 계산, 테스트 4개src/lib/timer.ts—remainingMs/formatDuration추가, 테스트 5개src/features/practice/QuestionCard.tsx— 채점표시를showFeedbackprop으로 분리, 즐겨찾기 버튼 상시 클릭 가능src/repositories/QuestionRepository.ts—getExamIndex()추가src/features/practice/PracticeSetup.tsx— 모드/진입방식/회차목록/제한시간 UIsrc/app/practice/page.tsx— 랜덤/회차별 분기src/features/practice/PracticeSession.tsx— 모드별 채점/제출, 타이머, 즐겨찾기 왕복+하이드레이션src/app/review/page.tsx— PracticeSessionmode/timeLimitMsprop 추가, addedAt 정렬검증:
npx tsc --noEmit,npm run lint(경고 2개뿐, 기존/의도된 것),npm run build,npx vitest run(60개 전부 통과) 다 통과. Codex 리뷰 1회 돌림 — 즐겨찾기 하이드레이션 누락(P2) 지적받아 그 자리에서 수정·커밋 완료.수동 브라우저 QA(타이머 카운트다운, 시험모드 실제 흐름, 회차 상태 갱신)는 이 세션에 브라우저 조작 도구가 없어서 못 함 — PR 머지 전 직접 확인 필요.
참고문서
docs/superpowers/plans/2026-07-31-exam-mode-and-fixes.md(로컬 전용, repo 미포함)Summary by CodeRabbit
새 기능
개선