nstanger / ouexam

University of Otago LaTeX exam template
0 stars 1 forks source link

subquestion can be used without an enclosing question #1

Closed nstanger closed 11 years ago

nstanger commented 11 years ago

There is no check that a subquestion environment should be inside a question (nor similarly that a subsubquestion should be inside a subquestion).

As reported by Stephen Cranefield:

I just noticed that my INFO323 exam has one top-level question with "(a)" in front of it instead of a number. It turns out that I had a subquestion environment at the top level, rather than a question environment. It might be a good idea if a warning could be given in this case, if it's easy to detect.

nstanger commented 11 years ago

The simplest solution is probably a depth counter that gets incremented when every question, subquestion or subsubquestion environment opens, and decrements when it closes. Output a warning if the depth isn’t what we expect for the question type (question = 0, subquestion = 1, subsubquestion = 2).