Skip to content

Commit

Permalink
use gk-ek as a thumbnail and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
SillyFreak committed Oct 12, 2024
1 parent 7b2a834 commit 2719725
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 48 deletions.
8 changes: 8 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ doc:
for f in $(find gallery -maxdepth 1 -name '*.typ'); do typst c "$f"; done
for f in question-types small-example gk-ek-austria; do typst c --input solution=true "gallery/$f.typ" "gallery/$f-solved.pdf"; done

mkdir -p tmp
typst c --ppi 250 "gallery/gk-ek-austria.typ" "tmp/thumbnail{n}.png"
typst c --ppi 250 "gallery/gk-ek-austria.typ" "tmp/thumbnail-solved{n}.png" --input solution=true
mv tmp/thumbnail1.png thumbnail.png
mv tmp/thumbnail-solved1.png thumbnail-solved.png
rm tmp/thumbnail*.png
rmdir tmp

# run test suite
test *args:
typst-test run {{ args }}
Expand Down
104 changes: 56 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,62 +14,70 @@ See the [manual](docs/manual.pdf) for details.

## Example

A rendered version of this example can be found in the [gallery](gallery/).
<table>
<tr>
<td>
<a href="gallery/gk-ek-austria.typ">
<img src="thumbnail.png">
</a>
</td>
<td>
<a href="gallery/gk-ek-austria.typ">
<img src="thumbnail-solved.png">
</a>
</td>
</tr>
</table>

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

```typ
#import "@preview/scrutinize:0.2.0": grading, question, questions
#import question: q
#import questions: free-text-answer, single-choice, multiple-choice, with-solution
// toggle this comment or pass `--input solution=true` to produce a sample solution
// #questions.solution.update(true)
#set table(stroke: 0.5pt)
#context [
#let total = grading.total-points(question.all())
The candidate achieved #h(3em) out of #total points.
]
= Instructions
#with-solution(true)[
Use a pen. For multiple choice questions, make a cross in the box, such as in this example:
#pad(x: 5%)[
Which of these numbers are prime?
#multiple-choice(
(([1], false), ([2], true), ([3], true), ([4], false), ([5], true)),
)
]
]
#import "@preview/scrutinize:0.3.0" as scrutinize: grading, task, solution, task-kinds
#import task: t
// ... document setup ...
#context {
let ts = task.all(level: 2)
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)],
)
#show heading: it => [
#it.body #h(1fr) / #question.current().points
]
// ... show the grading key ...
}
#q(points: 2)[
= Question 1
// ...
Write an answer.
= Grundkompetenzen -- Theorieteil B
#free-text-answer(height: 4cm)[
An answer
]
]
#lorem(40)
#q(points: 1)[
= Question 2
== Writing Text
#t(category: "b", points: 3)
#lorem(30)
Select the largest number:
#task-kinds.free-form.lines(stretch: 180%, lorem(20))
== Multiple Choice
#t(category: "b", points: 2)
#lorem(30)
#single-choice(
([5], [20], [25], [10], [15]),
2, // 0-based index
)
]
#{
set align(center)
task-kinds.choice.multiple((
(lorem(3), true),
(lorem(5), true),
(lorem(4), false),
))
}
```
Binary file added thumbnail-solved.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added thumbnail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2719725

Please sign in to comment.