Fix bug in exam controller.

It wasn't querying the correct data