diff --git a/example/main.pdf b/example/main.pdf deleted file mode 100644 index 8f9afd4..0000000 Binary files a/example/main.pdf and /dev/null differ diff --git a/src/coverpage.typ b/src/coverpage.typ index c812633..b201057 100644 --- a/src/coverpage.typ +++ b/src/coverpage.typ @@ -6,7 +6,7 @@ class, instructors, semester, - exam + exam ) = [ #set text(size: 20pt, font: "Latin Modern Roman Dunhill") #v(-18pt) @@ -24,11 +24,11 @@ #context { table( columns: ((2cm), (0.9cm,) * states.num-questions(), (1.5cm)).flatten(), - - [Question:], + + [Question:], ..for q in states.questions.at() { (str(q.num),) }, [ Total ], - - [Points:], + + [Points:], ..for q in states.questions.at() { (str(q.points),) }, [ #states.num-points() ] ) } @@ -54,40 +54,40 @@ } #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), @@ -95,7 +95,7 @@ [ #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) ], @@ -105,7 +105,7 @@ [ #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], @@ -113,10 +113,9 @@ ) ] ) - #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. @@ -124,11 +123,10 @@ #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() ] - diff --git a/src/lib.typ b/src/lib.typ index 8657eb6..27dbfce 100644 --- a/src/lib.typ +++ b/src/lib.typ @@ -111,9 +111,9 @@ text-scale: 1, body, ) = { - + if type(header) == function { - + header = header(class, semester, exam) } @@ -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) @@ -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) @@ -177,4 +176,3 @@ #metadata("exam-end") ] } -