feat(web): 시험지 미리보기/PDF — 실제 한국 시험지 조판으로 재설계#24
Merged
Conversation
시험지 미리보기/PDF 가 실제 한국 시험지 조판으로 출력되도록 전면 재설계.
- ExamSheet 재설계: 제목 박스(과목 라벨·발행 정보) + 인적사항 표
(학년·반/번호/이름/점수) + 2단 컬럼·가운데 괘선(명조 본문) 조판
- 객관식 ①~⑤ 보기를 본문에서 분리해 별도 행으로 배치 (lib/exam-choices),
빠른 정답표에서 정답 값을 보기 번호(③)로 매핑
- 빠른 정답을 별지(인쇄 시 새 페이지)의 격자 표로 분리
- 미리보기 = 인쇄와 동일 마크업을 ScaledSheet 로 축소 렌더 (A4 794px)
- 인쇄: 화면 UI 를 display:none 처리해 잔여 빈 페이지 제거,
column-fill 균형 유지로 한 페이지 미만 분량의 왼단 쏠림 해소,
인쇄 중 document.title 을 시험지 제목으로 바꿔 PDF 파일명 적용
- segmentAuto: 조사가 붙은 수식 토큰(x+2인, b^{2}-c^{2}의) 을 수식+조사로
분리해 ^{} 원문 노출 제거, 부등호 비교(b>c)도 수식으로 인식
검증: Playwright 24/24 (미리보기 구조·보기 분리·정답 매핑·옵션 토글·
배율 재계산·인쇄 2페이지 PDF·8문항 3페이지 흐름), vitest 43/43, build 통과
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 6 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
문제
시험지 미리보기/PDF 출력이 시험지 같지 않았음:
변경
시험지 조판 (preview/print 동일 마크업·스타일 공유)
lib/exam-choices.ts의splitChoices가 ①~⑤ 전부·순서대로 있을 때만 본문/보기 분리 → 보기를 별도 행으로 조판 (길면 세로 스택)answerChoiceIndex, 모호하면 원본 값)인쇄 경로 수정
.sub-nav/.page-body/.action-bar-sticky)를 print 에서display:none— visibility 만으로는 박스 높이가 남아 항상 마지막에 빈 페이지가 생기던 기존 버그 제거column-fill: balance유지 — 가득 찬 페이지는 순차 채움, 마지막 페이지만 좌우 균형 (auto 로 두면 1페이지 미만 분량이 왼단에만 쏠림)document.title을 시험지 제목으로 교체 → PDF 파일명에 반영 (afterprint 에 복원)segmentAuto (결과/검증 화면도 함께 개선)
2a(b-c)+b^{2}+c^{2}+12와,b>c인)을 수식+조사로 분리 —^{2}중괄호 원문이 그대로 노출되던 찐빠 제거b>c)를 수식 신호로 인식,10명의/5곳에같은 일반 단어는 그대로 텍스트검증 (Playwright, 실서버 27182)
24/24 체크 통과 — 시트 2장 구조, 머리/인적사항, 2단+괘선, 보기 5개 분리·마커, 정답 ③ 매핑, 옵션 토글(정답표 포함/미포함·셔플·제목 반영), 뷰포트 축소 시 배율 재계산, 인쇄 PDF 정확히 2페이지(빈 페이지 없음), 8문항 케이스 3페이지(1면 가득 → 2면 이월 → 정답 별지) 흐름 확인.
vitest 43/43 (exam-choices 11 + segmentAuto 회귀 3 추가), tsc·next build 통과.
🤖 Generated with Claude Code
Summary by cubic
Redesigned the exam preview and PDF to match a real Korean exam sheet, with a true A4 layout and 1:1 parity between preview and print. This improves readability and fixes the extra blank page in exported PDFs.
New Features
splitChoicesseparates ①–⑤ from the body only when all markers are in order; long choices stack vertically.answerChoiceIndexmaps answers to markers (e.g., ③) when unambiguous.ScaledSheetrenders actual A4 (794px) and scales to fit; preview and print share the same markup/styles.segmentAutoUX: splits particles glued to math (e.g.,b^{2}-c^{2}의), recognizes inequalities likeb>c, leaves words like “10명의” as text.exam-choicesunit tests; expandedlatex-renderercases.Bug Fixes
display:none.column-fill: balanceso only the last page is balanced; prevents left-column bias for short sheets.document.titleduring print (restored after).Written for commit 9f33878. Summary will update on new commits.