fixed level generation in Javascript

if there are non-hidden requirements the question isn't complete at
that level
only open sections containing mandatory fields when they're highlighted
Merge pull request #310 from theodi/fix-wrong-level-via-JS

Fix wrong level displayed via Javascript