Repository navigation
fix: report a grown draw's own count, catch duplicate IDs in the bank - #18
Merged
Merged
Conversation
When a draw already held questions from an earlier build and asked for
more than the section has, the error gave the shortfall as the count
("#draw(<s>, 5) asks for 4") and counted the held questions as
elsewhere in the exam. It now counts them as available to the draw and
reports the count written in the exam.
Two questions with the same ID were only caught when an exam read the bank, so a TA previewing bank.typ never saw it. #q now fails when an earlier question has its ID, and both errors say to give one of them a new ID.
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryFixes the count shown when a saved draw grows beyond the available questions. Adds duplicate-ID checks to bank previews.
Reviews (1) · Last reviewed commit: "fix(typst): a duplicate question ID stop..." · Reviewed by Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two fixes from trying sortes as an instructor and as a TA.
#draw(<s>, 2)had already been built and was changed to#draw(<s>, 5)with only 3 questions in<s>, the error said "asks for 4". It also counted the draw's own questions as "elsewhere in this exam". It now says<s> has 3 unused questions; #draw(<s>, 5) asks for 5. Write 2 more, or draw fewer.bank.typ. Onlysortes buildcaught it, and that error had no fix.#qnow fails as soon as an earlier question has the same ID, and both errors say "give one of them a new ID". The bank renders pixel-identical when there's no duplicate, and a 500-question bank still compiles in under half a second.The duplicate-ID error can't point to the line in
bank.typ, because Typst drops the call site for errors inside acontextblock. It names the ID, and searching for it finds both copies.