Skip to content

Commit 8d20db8

Browse files
committed
implement: Document the draft workflow from source add to build (t45)
1 parent 45357ae commit 8d20db8

1 file changed

Lines changed: 17 additions & 15 deletions

File tree

‎docs/source/drafts.md‎

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 📝 Drafts
22

3-
A draft is a JSON file beside a problem sheet. It names the markdown file the sheet was converted
4-
to and holds that file's hash, the blocks the markdown is made of, one field per question, part
3+
A draft is a JSON file beside a problem sheet. A draft names the markdown file the sheet was
4+
converted to and holds that file's hash, the blocks the markdown is made of, one field per question, part
55
and solution, and the log of the commands that wrote those fields. `in2lambda convert` reads a document and writes a set in
66
one command. A draft is the other way of working: in2lambda converts the document once, and the
77
questions are then written, checked and rebuilt from the frozen markdown and the log.
@@ -166,9 +166,9 @@ b2 (lines 3-3) is in no field and not marked ignore.
166166
b8 (lines 15-16) is in no field and not marked ignore.
167167
```
168168

169-
The spec writes the two questions, their parts and the two headings it was told to ignore. It
170-
then reports the blocks it made nothing of: the rubric, which no selector matches, and the
171-
solutions, which this spec has no `solution` selector for. A spec run accounts for every block of
169+
The spec writes the two questions, their parts and the two headings it was told to ignore.
170+
`in2lambda spec run` then reports the two blocks the spec wrote no field from: the rubric, which
171+
no selector matches, and the solutions, which this spec has no `solution` selector for. A spec run accounts for every block of
172172
the document or names the blocks it left out.
173173

174174
Each field records where its value came from:
@@ -265,8 +265,8 @@ Wrote q1.p1.text.
265265
}
266266
```
267267

268-
A literal is layer 4: no line of the source says it, so the field has no range behind it and
269-
arrives edited.
268+
A literal is layer 4. No line of the source holds the wording, so the field's `ranges` is empty.
269+
The field's `edited` is `true`.
270270

271271
The second question and its part are both quoted:
272272

@@ -295,7 +295,7 @@ Warning: q1.p1 has no solution: neither q1.p1.solution nor q1.solution is writte
295295
report. Whoever is writing the draft reads that report to find the blocks in no field and the
296296
questions with no solution. A finding at level error is the draft contradicting its own source:
297297
lines nothing accounts for, two fields quoted from the same lines, a numbering with a hole in it,
298-
maths Lambda Feedback will not render. A finding at level warning may be right about the sheet.
298+
maths Lambda Feedback will not render.
299299
A question with no solution is reported at level warning, because many sheets write their
300300
solutions in another file, and some sheets have none.
301301

@@ -324,7 +324,8 @@ Wrote b8a and b8b.
324324
```
325325

326326
The document is unchanged. `b8a` and `b8b` are blocks of the draft, quoted by their ids as any
327-
other block is, and a replay arrives at the same two ids by running the same command again:
327+
other block is. `in2lambda draft replay` runs `split block b8 16` again from the log, and writes
328+
the blocks `b8a` and `b8b` again. The two solutions are then quoted into the two questions:
328329

329330
```bash
330331
$ in2lambda draft question solution q1 --text b8a
@@ -368,9 +369,9 @@ Replays as it stands.
368369
```
369370

370371
`in2lambda draft replay` builds the draft again from the frozen markdown and the log, and
371-
compares the result with the file byte for byte. It refuses where the document has changed since
372-
in2lambda froze it, where the log names a command this version of in2lambda has not got, and
373-
where somebody edited a field by hand.
372+
compares the result with the file byte for byte. `in2lambda draft replay` refuses where the
373+
document has changed since in2lambda froze it, where the log names a command this version of
374+
in2lambda has not got, and where somebody edited a field by hand.
374375

375376
A command that changes the draft deletes the draft's report, because the report described the
376377
draft before the command ran. So the checks run again:
@@ -388,9 +389,10 @@ Wrote /home/you/sheet/out/set.zip
388389
```
389390

390391
`in2lambda build` writes the draft out as a Lambda Feedback set: `out/set.zip` and the files it
391-
is zipped from. It refuses a draft `in2lambda validate` has not been run on since the draft last
392-
changed, and a draft whose report holds a finding at level error. It writes the set over a
393-
finding at level warning, and prints that finding beside what it wrote. The fields become the
392+
is zipped from. `in2lambda build` refuses a draft that `in2lambda validate` has not been run on
393+
since the draft last changed, and refuses a draft whose report holds a finding at level error.
394+
Where the report holds only findings at level warning, `in2lambda build` prints each finding as a
395+
`Warning:` line and then writes `out/set.zip`. The fields become the
394396
questions and parts of the export - see [the question format](question-format) for what the
395397
export holds.
396398

0 commit comments

Comments
 (0)