Is it possible to test for the existence or count of an element/group? (Support #159)
Description
In our exams we typically have (at most) two kinds of questions, which are treated a bit differently. The usage is to distinguish between MC and open questions.
Typically we put the open questions at the end, optionally shuffled (with a newif).
We put the mc questions in one element \element{general}
and the open questions in another \element{open}
.
Sometimes we have no open questions, so the open group is not defined c.q. empty.
Is there a test to see if a group contains any elements, so that we can avoid errors in the latex run in such cases?
Now we use the hack to see if a specific file exists (test for file openquestions) but this is not robust, because the file might be present but not defining any open questions, for instance
because they have been commented out.
History
Updated by Alexis Bienvenüe about 12 years ago
The LaTeX counter \xxx@k
sould contain the number of question from group xxx.
Updated by Pieter Van den Hombergh about 12 years ago
Alexis Bienvenüe wrote:
The LaTeX counter
\xxx@k
sould contain the number of question from group xxx.
Thank you for your quick answer.
Updated by Alexis Bienvenüe almost 12 years ago
- % Done changed from 0 to 100
- Status changed from New to Closed