Repository navigation
v1.0.1
答题卡生成器 v1.0.1 —— 纯前端、零依赖、完全免费开源的自制答题卡排版工具。单文件即可运行,也可用 Docker / GitHub Pages 部署。
v1.0.1 是 1.0.0 之后的第一个更新,主要集中在作答区贴图、撤销重做、分页与排版精度上。所有条目均通过无头浏览器(Chromium)量化验证后才合入。
✨ 新增
- 解答题图片可直接贴进作答区:选中解答题模块后,把鼠标停在预览区某个作答区上按 Ctrl+V 即贴进该题(点选作答区也行,属性面板同步高亮该题卡;未悬停时贴第 1 题)。图片叠加在作答区内 —— 不占高度、不挤压横线,学生照常在旁边书写;九宫格定位(左上/上中/右上/左中/居中/右中/左下/下中/右下)+ 图片宽(%)可调。实测:九宫格 9 位置与期望角点偏差全部 0.00px,插图前后区块总高差 0.00px(不占高度、不影响分页)。
- 撤销 / 重做:快照式历史(最多 100 步),连续输入按 0.7s 窗口合并;工具栏按钮 + Ctrl+Z / Ctrl+Y。
- 复制 / 剪切 / 粘贴:Ctrl+C / Ctrl+X / Ctrl+V 复制模块;选中「图片」模块时 Ctrl+V 可直接粘贴剪贴板图片(本机压缩、仅存浏览器);选中「解答题」时贴进作答区。
- 选择题「行间距(mm)」:填涂与手写两种样式都生效。
- 填空题分层自动编号:小题
(1)(2)→ 小小题①②→ 更深a) b),各层一眼可区分;旧模板里硬编码的(1)(1)(1)自动重算。
🐛 修复
- 作答区贴图在打印时压过边框:叠加层原用「绝对定位 +
transform居中 +max-height/overflow裁切」,屏幕预览正常、Ctrl+P 打印预览里图片越出边框。重构为定位层铺满作答区 + flex 九宫格(去 transform)+ 盒子自带overflow:hidden兜底。实测(1:3.75 超高图、60% 宽、100mm 盒):屏幕 / 打印媒体 / 真实 PDF 三方几何完全一致,0.00mm 越界。 - 新增题型不再重复题号:新加的选择/填空/解答题不再一律用默认起始号(1/11/13),改为自动接续已有总题数(实测 13 题卷面 → 新解答题 14、再选择题 15)。
- 点解答题任意位置都能选中该题:此前只有空白区响应,点题号行「13.」无反应;现在整个作答盒(含题号行)都响应,提示与题卡均改用卷面题号。
- 填空题「行间距」不均匀:该值同时被用作折行
line-height与题间margin,导致题间行距 = 设定值 ×2(16mm 实测题间 32.1mm)。现已一致(16mm → 16.06 / 16.06)。 - 选择题「行间距」不作用于标题与第一行:grid 的
row-gap只作用于行与行之间,标题→第一行恒 2.12mm;补padding-top后与行间距一致(16mm → 17.12 / 17.12)。 - 考号填涂区限宽:默认不超过页宽 1/4(可调 10–60%),把宽度让给右侧手写栏。实测 A3 16 位 87.6 → 74.5mm(25% 页宽)。
- 属性面板题卡排版:「第 1 题 + 当前」角标不再被拆成两行。
📦 部署
docker run -d -p 8080:80 --name asb ghcr.io/dc1024/answer-sheet-builder:1.0.1
# 或:ghcr.io/dc1024/answer-sheet-builder:1.0 / :latest / :sha-<commit>在线体验:https://dc1024.github.io/answer-sheet-builder/
v1.0.1 of the Answer Sheet Builder — a pure front-end, zero-dependency, free and open-source answer-sheet layout tool.
Added
- Paste images straight into a free-response answer area: select the block, hover an answer area and press Ctrl+V (clicking works too). The image overlays inside the box — no height taken, ruled lines untouched — with 9-grid positioning and width (%). Measured: 0.00px deviation on all 9 positions; 0.00px total block height change.
- Undo / redo (snapshot history, 100 steps, 0.7s coalescing; Ctrl+Z / Ctrl+Y).
- Copy / cut / paste blocks (Ctrl+C / Ctrl+X / Ctrl+V); paste a clipboard image into an Image block, or into an answer area.
- Row spacing (mm) for choice questions; layered auto-numbering for fill-in-the-blank.
Fixed
- Images no longer cross the answer-box border in print (transform-based clipping was unreliable in Chrome's print pipeline): screen / print media / real PDF now measure identically with 0.00mm overflow.
- New blocks no longer duplicate question numbers — the starting number continues from the existing total (13-question sheet → new answer block starts at 14).
- Clicking anywhere on an answer box selects that question (previously only the blank middle area responded).
- Fill-in-blank row spacing was doubled between questions (16mm set → 32.1mm measured); now uniform.
- Choice row spacing now also applies between the title and the first row (was a constant 2.12mm).
- Exam-number grid capped at 1/4 page width (A3 16 digits: 87.6 → 74.5mm).
- Properties-panel question-card layout no longer wraps mid-badge.
Deploy
docker run -d -p 8080:80 --name asb ghcr.io/dc1024/answer-sheet-builder:1.0.1