summaryrefslogtreecommitdiff
path: root/muendliche-pruefung/lib.typ
blob: 85117a1262ccc9b7b91ac804169c491ade3e693b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// SPDX-FileCopyrightText: 2025 Gero Beckmann <orangerot@orangerot.dev>
//
// SPDX-License-Identifier: MIT

#let KIND = (:
  "WAHLPFLICHT":     "Wahlpflicht",
  "VERTIEFUNGSFACH": "Vertiefungsfach",
  "ERGAENZUNGSFACH": "Ergänzungsfach",
  "NONE":            ""
)

#let oral-exam(
  study: "",                                 // Studiengang
  lecture: "",                               // Fach
  kind: KIND.NONE,                           // Prüfungsart KIND.{WAHLPFLICHT, VERTIEFUNGSFACH, ERGUENZUNGSFACH}
  date: datetime(year: 0, month: 1, day: 1), // Prüfungsdatum
  examiner: "",                              // PrüferIn (Prof)
  assistant: "",                             // BeisitzerIn
  grade_received: 0.0,                       // Note
  grade_reasonable: "",                      // War die Note angemessen?
  exam_duration: duration(minutes: 0),       // Prüfungsdauer
  attendance: (
  /* Veranstaltung, Dozent(in), Jahr, regelmäßig besucht? */
    (lecture: "", lecturer: "", year: "", did_attend: ""),
    (lecture: "", lecturer: "", year: "", did_attend: ""),
    (lecture: "", lecturer: "", year: "", did_attend: ""),
    (lecture: "", lecturer: "", year: "", did_attend: ""),
  ),
  attendance_worth: [
    // Hat sich der Besuch / Nichtbesuch der Veranstaltung für dich gelohnt?
  ],
  preparation_time: [
    // Wie lange und wie hast alleine bzw. mit anderen vorbereitet?
  ],
  agreements: [
    // Fanden vor der Prüfung Absprachen zu Form oder Inhalt statt? Wurden sie eingehalten?
  ],
  preparations: [
    // Welche Tips zur Vorbereitung kannst Du geben?
  ],
  examiner_behavior: [
    // Wie war der Prüfungsstil des Prüfers / der Prüferin?
  ],
  examiner_recommendation: (none, [          // true, false
    // Kannst du ihn / sie weiterempfehlen? Warum?
  ]),
  examinee_behavior: [
    // Kannst Du Ratschläge Verhalten in der Prüfung geben?
  ],
  doc
) = [
  #let radiobox(checked: false) = if checked {$circle.filled$} else {$circle$}

  #show <study>: study
  #show <lecture>: lecture
  #show <date>: if date.year() > 0 {date.display("[day].[month].[year]")}
  #show <examiner>: examiner
  #show <assistant>: assistant
  #show <grade_received>: if grade_received > 0.0 {str(grade_received+0.01).slice(0,3).replace(".",",")}
  #show <grade_reasonable>: grade_reasonable
  #show <exam_duration>: if exam_duration.minutes() > 0 [#exam_duration.minutes()]
  #show <attendance_worth>: attendance_worth
  #show <preparation_time>: preparation_time
  #show <agreements>: agreements
  #show <preparations>: it => [#it #preparations]
  #show <examiner_behavior>: examiner_behavior
  #show <examinee_behavior>: it => [#it #examinee_behavior]
  #show <kind>: {
    for exam_kind in KIND.values().filter(it => it != KIND.NONE) [
      #radiobox(checked: kind == exam_kind) #exam_kind \
    ]
  }
  #show <examiner_recommendations>: [
    #let can_recommend = examiner_recommendation.at(0)
    #radiobox(checked: can_recommend == true) Ja \
    #radiobox(checked: can_recommend == false) Nein

    #examiner_recommendation.at(1)
  ]
  #show <attendance>: it => {
    let g = it.fields()
    let _ = g.remove("children")
    let _ = g.remove("label")
    let events = attendance.map(((lecture, lecturer, year, did_attend)) =>
      (lecture, lecturer, year, did_attend)
    ).flatten()

    table(..g,
      ..it.fields().children.at(0).children,
      ..(events + 4*4*([],)).slice(0,4*4)
    )
  }

  #include "muendliche-pruefung.typ"

  #doc
]