diff --git a/Y-Security_HEIG-VD_logotype_rouge-rvb.svg b/Y-Security_HEIG-VD_logotype_rouge-rvb.svg new file mode 100644 index 0000000..243900a --- /dev/null +++ b/Y-Security_HEIG-VD_logotype_rouge-rvb.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/exam/lib.typ b/exam/lib.typ index cc70c03..c5e2b5a 100644 --- a/exam/lib.typ +++ b/exam/lib.typ @@ -1,4 +1,3 @@ -#let qctr = counter("question") #let pctr = counter("points") #let french_month = ("janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre") @@ -35,9 +34,11 @@ #let exam(title: "Exam", course: none, date: none, class: none, year: none, author: none, subtitle: none, indications: none, - time: none, allowed: none) = doc => { + time: none, allowed: none, pad_page: false) = doc => { - { + let marker(m) = align(center, text( weight: "bold", size: 30pt, m)); + + { // Page de garde set text(font: "Montserrat") let date = if date == none { datetime.today() } else { date }; @@ -86,17 +87,36 @@ align(right, text(size: 12pt, [Total: #total points])) + } // Fin page de garde + + let guard = { + pagebreak() + block(width: 100%, height: 100%, align(horizon, marker("PAGE VIDE"))) } - pagebreak() - set text(font: "Carlito", size: 12pt) - show heading: h => pad(bottom: 0.5em, text(fill: eastern, size: 16pt, weight: "light", h.body + " " + show_points(points_counter(h)))) + + show heading: h => { + let body = context { counter(heading).display() } + " " + h.body + " " + show_points(points_counter(h)); + pad(bottom: 0.5em, text(fill: eastern, size: 16pt, weight: "light", body)) + + } let head = text(fill: gray)[#course #year - #title]; set page(header: head, footer: align(right, text(fill: gray, "Page ") + context counter(page).display("1 | 1", both: true))) + + if pad_page { + guard + } + + pagebreak() + doc + v(2em) + marker("FIN") + + guard }; // Bloc réponse caché en mode production @@ -119,7 +139,9 @@ context pctr.update(t => t + points) let pts = strong(show_points(points)); - context { qctr.step() } + let qctr = counter("question") + + context { qctr.step(level: 2) } let num = context { qctr.display() }; //v(2em, weak: true) block(breakable: false, diff --git a/lab/demo.typ b/lab/demo.typ index 4a24724..65381fa 100644 --- a/lab/demo.typ +++ b/lab/demo.typ @@ -1,4 +1,4 @@ -#import "lab.typ" : laboratoire, question, operation +#import "lib.typ" : laboratoire, question, operation #show: doc => laboratoire( title: "Some random lab", course: "XYZ", diff --git a/lab/lib.typ b/lab/lib.typ index 39ab005..07652bd 100644 --- a/lab/lib.typ +++ b/lab/lib.typ @@ -1,10 +1,4 @@ -#show heading: h => { - let fresh = counter(heading).get(); - counter("manipulation").update(fresh) - counter("question").update(fresh) - h - } #let context_step(key) = context { let lvl = query(selector(heading).before(here())).at(-1).level+1; @@ -16,12 +10,20 @@ header: [#course - Labo X - #title], footer: [], numbering: "1 / 1" - ); + ) + + set heading(numbering: "1.1") + + show heading: h => { + let fresh = counter(heading).get(); + counter("manipulation").update(fresh) + counter("question").update(fresh) + h + } + doc } -#set heading(numbering: "1.1") - #let pretty_block(color, title, x) = { let edge = color; @@ -74,4 +76,4 @@ bli bli blu blu -#question[xxxx][yyyyyy] \ No newline at end of file +#question[xxxx][yyyyyy]