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) }