Skip to content

Commit

Permalink
remove other examples; the only thing not demonstrated that was demon…
Browse files Browse the repository at this point in the history
…strated before is a solved example question
  • Loading branch information
SillyFreak committed Oct 12, 2024
1 parent 27a916b commit 9b4978c
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 206 deletions.
7 changes: 5 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ default:
# generate manual
doc:
typst compile docs/manual.typ docs/manual.pdf
for f in $(find gallery -maxdepth 1 -name '*.typ'); do typst c "$f"; done
for f in question-types small-example example; do typst c --input solution=true "gallery/$f.typ" "gallery/$f-solved.pdf"; done
for f in $(find gallery -maxdepth 1 -name '*.typ'); do \
f="$(basename "$f" .typ)"; \
typst c "gallery/$f.typ"; \
typst c "gallery/$f.typ" "gallery/$f-solved.pdf" --input solution=true; \
done

mkdir -p tmp
typst c --ppi 250 "gallery/example.typ" "tmp/example{n}.png"
Expand Down
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ See the [manual](docs/manual.pdf) for details.
</tr>
</table>

This and more examples can be found in the [gallery](gallery/). Here are some excerpts from the shown example:
This example can be found in the [gallery](gallery/). Here are some excerpts from it:

```typ
#import "@preview/scrutinize:0.3.0" as scrutinize: grading, task, solution, task-kinds
#import task-kinds: free-form, gap, choice
#import task: t
// ... document setup ...
Expand All @@ -42,28 +43,28 @@ This and more examples can be found in the [gallery](gallery/). Here are some ex
let total = grading.total-points(ts)
let grades = grading.grades(
[Nicht Genügend (5)],
4/8 * total,
[Genügend (4)],
5/8 * total,
[Befriedigend (3)],
6/8 * total,
[Gut (2)],
7/8 * total,
[Sehr Gut (1)],
[F],
0.6 * total,
[D],
0.7 * total,
[C],
0.8 * total,
[B],
0.9 * total,
[A],
)
// ... show the grading key ...
}
// ...
= Grundkompetenzen -- Theorieteil B
= Basic competencies -- theoretical part B
#lorem(40)
== Text schreiben
#t(category: "b", points: 3)
== Writing
#t(category: "b", points: 4)
#lorem(30)
#task-kinds.free-form.lines(stretch: 180%, lorem(20))
Expand All @@ -74,7 +75,7 @@ This and more examples can be found in the [gallery](gallery/). Here are some ex
#{
set align(center)
task-kinds.choice.multiple((
choice.multiple((
(lorem(3), true),
(lorem(5), true),
(lorem(4), false),
Expand Down
Binary file modified docs/manual.pdf
Binary file not shown.
5 changes: 3 additions & 2 deletions docs/manual.typ
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ Once we have the total points of the exam figured out, we need to define the gra
#lorem(20)
```)

Obviously we would not want to render this representation as-is, but #ref-fn("grading.grades()") gives us a convenient way to have all the necessary information, without assuming things like inclusive or exclusive point ranges. The `test.typ` example in the gallery has a more complete demonstration of a grading key.
Obviously we would not want to render this representation as-is, but #ref-fn("grading.grades()") gives us a convenient way to have all the necessary information, without assuming things like inclusive or exclusive point ranges. The example in the gallery has a more complete demonstration of a grading key.

One thing to note is that #ref-fn("grading.grades()") does not process the limits of the grade ranges; they're simply passed through. If you prefer to ignore total points and instead show percentages, or want to use both, that is also possible:

Expand All @@ -258,7 +258,8 @@ Tasks have a desired response, and producing sample solutions can be made very c

- #ref-fn("solution._state"): this boolean state controls whether solutions are currently shown in the document. Some methods have convenience functions on the module level to make accessing them easier: #ref-fn("solution.get()"), #ref-fn("solution.update()").
- #ref-fn("solution.answer()"): this function uses the solution state to conditionally hide the provided answer.
- #ref-fn("solution.with()"): this function sets the solution state temporarily, before switching back to the original state. The `small-example.typ` example in the gallery uses this to show a solved example task at the beginning of the document.
- #ref-fn("solution.with()"): this function sets the solution state temporarily, before switching back to the original state.
// The `small-example.typ` example in the gallery uses this to show a solved example task at the beginning of the document.

Additionally, the solution state can be set using the Typst CLI using `--input solution=true` (or `false`, which is already the default). Within context expressions, a task can use ```typ #solution.get()``` or ```typ #solution.answer()``` to find out whether solutions are shown. This is also used by Scrutinize's task templates.

Expand Down
Binary file removed gallery/question-types-solved.pdf
Binary file not shown.
Binary file removed gallery/question-types.pdf
Binary file not shown.
50 changes: 0 additions & 50 deletions gallery/question-types.typ

This file was deleted.

Binary file removed gallery/small-example-solved.pdf
Binary file not shown.
Binary file removed gallery/small-example.pdf
Binary file not shown.
57 changes: 0 additions & 57 deletions gallery/small-example.typ

This file was deleted.

Binary file removed gallery/test.pdf
Binary file not shown.
81 changes: 0 additions & 81 deletions gallery/test.typ

This file was deleted.

0 comments on commit 9b4978c

Please sign in to comment.