This was a regression caused by MDL-6340. I missed the necessary AND parent = 0 AND hidden = 0 in one query of the question table.
This api is called very few times in behat initilisation process, so such optimization is an over engineer. Hence removing it.
…pended users (Student's view)