From 2a2d6cd88acafb74663d41a7fb350c890212e3ab Mon Sep 17 00:00:00 2001 From: Maxime Augier Date: Thu, 23 May 2024 09:40:04 +0200 Subject: [PATCH] Fix embarrassing point counting bug --- exam/lib.typ | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exam/lib.typ b/exam/lib.typ index f0587b9..f21e089 100644 --- a/exam/lib.typ +++ b/exam/lib.typ @@ -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) }