fix(M01): 시험 계산 수 고르기 글로 보냄 · 저장이 파일 글 모양을 지킴

- 화면 [계산] — 고르기 값은 원래 값(수면 수) 그대로 보냄 · 고르기 칸 고칠 때 모두 수면 수로 저장
- 엔진 입력 — 글로 온 수를 고르기 원래 값·Decimal 로 받음
- 저장 — 안 바뀐 요소는 옛 글 그대로(한 줄 요소 한 줄 · 들여쓰기 · 줄바꿈) · 고친 요소만 새로 씀
- 시험 — 13-4-1 글 입력 계산 · 저장 차이가 고친 줄만 · 3-3-1 시험에 지역·보정작업 입력

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PAdA5ThqmtVSsbzjusk1cJ
This commit is contained in:
2026-09-19 19:41:59 +09:00
co-authored by Claude Opus 5
parent 280d51879f
commit 43d72588f6
6 changed files with 126 additions and 16 deletions
@@ -382,6 +382,14 @@ def _inputs(row: dict, given: dict) -> dict:
if name not in given:
raise FormulaError(f"「{row['열쇠']}」 입력 「{name}」 없음")
value = given[name]
if isinstance(value, str): # 화면이 글로 보낸 수 — 고르기 원래 값 · 아니면 수로
if "고르기" in spec:
value = next((o for o in spec["고르기"] if str(o) == value.strip()), value)
else:
try:
value = Decimal(value.strip())
except ArithmeticError:
pass
if isinstance(value, (int, float)):
value = Decimal(str(value))
if "고르기" in spec and value not in spec["고르기"]: