Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed example/main.pdf
Binary file not shown.
50 changes: 24 additions & 26 deletions src/coverpage.typ
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class,
instructors,
semester,
exam
exam
) = [
#set text(size: 20pt, font: "Latin Modern Roman Dunhill")
#v(-18pt)
Expand All @@ -24,11 +24,11 @@
#context {
table(
columns: ((2cm), (0.9cm,) * states.num-questions(), (1.5cm)).flatten(),
[Question:],

[Question:],
..for q in states.questions.at(<exam-end>) { (str(q.num),) }, [ Total ],
[Points:],

[Points:],
..for q in states.questions.at(<exam-end>) { (str(q.points),) }, [ #states.num-points() ]
)
}
Expand All @@ -54,48 +54,48 @@
}

#v(12pt)
#smallcaps("Print") Your Name:
#smallcaps("Print") Your Name:
#box(width: 1fr, [#line(length:100%, stroke: 0.5pt)])

#v(12pt)
#smallcaps("Print") Your Student ID:
#smallcaps("Print") Your Student ID:
#box(width: 1fr, [#line(length:60%, stroke: 0.5pt)])

#v(12pt)
#smallcaps("Print") the Name and Student ID of the person to your left:
#smallcaps("Print") the Name and Student ID of the person to your left:
#box(width: 1fr, [#line(length:100%, stroke: 0.5pt)])

#v(12pt)
#smallcaps("Print") the Name and Student ID of the person to your right:
#smallcaps("Print") the Name and Student ID of the person to your right:
#box(width: 1fr, [#line(length:100%, stroke: 0.5pt)])

#v(12pt)
#smallcaps("Print") the Name and Student ID of the person in front of you:
#smallcaps("Print") the Name and Student ID of the person in front of you:
#box(width: 1fr, [#line(length:100%, stroke: 0.5pt)])

#v(12pt)
#smallcaps("Print") the Name and Student ID of the person behind you:
#smallcaps("Print") the Name and Student ID of the person behind you:
#box(width: 1fr, [#line(length:100%, stroke: 0.5pt)])


#line(length: 100%, stroke: 1pt)

#context [
You have #time. There are #states.num-questions() questions of varying credit. (#states.num-points() points total)
#context [
You have #time. There are #states.num-questions() questions of varying credit. (#states.num-points() points total)
]

#align(center)[
#pointstable()
]

#states.print-answers.update(true)
#grid(
columns: (1fr, 1fr),
gutter: 12pt,
[
#set par(justify: false)
For questions with *circular bubbles*, you may select only one choice.

#multi-choice(
[ Unselected option (Completely unfilled) ],
bad()[ Don't do this (it will be graded as incorrect) ],
Expand All @@ -105,30 +105,28 @@
[
#set par(justify: false)
For questions with *square checkboxes*, you may select one or more choices.

#multi-select(
correct()[You can select],
correct()[multiple squares],
bad()[(Don't do this)],
)
]
)
#states.print-answers.update(false)


Anything you write outside the answer boxes or you #strike([cross out]) will not be graded. If you write multiple answers, your answer is ambiguous, or the bubble/checkbox is not entirely filled in, we will grade the worst interpretation. For coding questions with blanks, you may write at most one statement per blank and you may not use more blanks than provided.

If an answer requires hex input, you must only use capitalized letters (`0xB0BACAFE` instead of `0xb0bacafe`). For hex and binary, please include prefixes in your answers unless otherwise specified, and do not truncate any leading 0’s. For all other bases, do not add any prefixes or suffixes.


#line(length: 100%, stroke: 1pt)
#box(width: 100%, stroke: 1pt, inset: 6pt, )[
As a member of the UC Berkeley community, I act with honesty, integrity, and respect for others. I will follow the rules of this exam.
]
Acknowledge that you have read and agree to the honor code above and sign your name below:

Acknowledge that you have read and agree to the honor code above and sign your name below:
#v(20pt)
#box(width: 1fr, [#line(length:100%, stroke: 0.5pt)])

#pagebreak()
]

16 changes: 7 additions & 9 deletions src/lib.typ
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@
text-scale: 1,
body,
) = {

if type(header) == function {

header = header(class, semester, exam)
}

Expand All @@ -135,9 +135,9 @@

show heading.where(level: 1): it => titled-question(title: it)
show heading.where(level: 2): it => titled-subquestion(title: it)

show raw: set text(font: "New Computer Modern Mono", size: 1.25em, weight: 700, top-edge: 5pt)

show raw: it => {
show "~": set text(font: "Atkinson Hyperlegible Mono", weight: 500)
show "^": set text(font: "Atkinson Hyperlegible Mono", weight: 500)
Expand All @@ -161,14 +161,13 @@
}

if coverpage == none {
states.print-answers.update(it => print-answers)
frontpage(class, instructors, semester, exam, time, last-edited)
states.print-answers.update(it => print-answers)
} else if type(coverpage) == string {
} else if type(coverpage) == str {
include coverpage
} else if type(coverpage) == function {
coverpage = coverpage(class, instructors, semester, exam, time, print-answers, header, footer, last-edited)
coverpage(class, instructors, semester, exam, time, print-answers, header, footer, last-edited)
}
states.print-answers.update(it => print-answers)

[
#states.show-answer-letters.update(it => answer-letters)
Expand All @@ -177,4 +176,3 @@
#metadata("exam-end") <exam-end>
]
}