Compare commits

..

No commits in common. "15c2cb4cac4b5c5154b60178bf27b908fdd0d40f" and "b475e4bb8d26910c715fc8320e115bacf42f02d7" have entirely different histories.

2 changed files with 8 additions and 7 deletions

View File

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

View File

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