Fix students not checked in query.

(cherry picked from commit 98ac4d21b2f35264643c57be988b0934449aa294)