Compare commits

...

2 Commits

2 changed files with 7 additions and 8 deletions

View File

@ -1,13 +1,12 @@
#import "@ysec/exam:0.1.0": exam, question, reponse
#show: doc => exam(
#import "@y-sec/exam:0.1.0": exam, question, reponse
#show: exam(
title: "Examen en Typst",
subtitle: "Y-Security - Typst Essentials",
course: "TES",
date: datetime(year: 2024, month: 5, day: 27),
date: datetime(year: 2050, month: 1, day: 1),
author: "Maxime Augier",
time: "45 minutes",
allowed: "une page A4 (recto-verso) de résumé personnel",
doc
)
= Questions et Réponses

View File

@ -6,14 +6,14 @@
#let solution_mode = { sys.inputs.at("mode", default: "") == "solution" };
#let points_counter(h) = {
// Find the first heading at a level equal or higher than this one
// Find the first heading at a level equal or lower (more important) than this one
let headings_after = query(selector(heading)
.after(h.location())
.after(h.location(), inclusive: false)
).filter(nh => nh.level <= h.level);
let start_value = pctr.at(h.location())
let stop_value = if headings_after.len() == 0 { pctr.final() }
else { pctr.at(headings_after.last().location()) }
else { pctr.at(headings_after.first().location()) }
stop_value.at(0) - start_value.at(0)
}
@ -29,7 +29,7 @@
#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) = doc => {
{
set text(font: "Montserrat")