I think the difficulty is that it's impossible to tell whether a requirement is .q_hidden because it's not relevant or because it's been satisfied. I think that it hinges on whether the question has been answered or not. It should only count as completed if the question has been answered (see code on lines 215-216) and the requirement is hidden.

It's probably better to cycle through the questions and for each one work out whether it's been completed or not, and go from there.