Good question. I would ask "male or female student?", but then perhaps if you had said "who is it?" (que é ele/ela, qualquer que seja o sexo da pessoa.) would do.
By using "it´s a boy or a girl", first of all, it could lead others to think of a "kid/child".
Plus, it could lead to those present to automatically think of the question "it´s a boy or a girl?", used when one have just known of the birth of a baby!
Granted, perhaps this habit is not widely used these days, but depending the way you asked, people could subconsciously make that association. And with that make it a good joke!
More succinctly, you could use "He or she?" (short "for is it a he or she?") or just "male or female?" (short for "is it a female or female student - in our case here.)
To a slangy people or in a colloquial setting, one could ask "it´s/is it a John or Jane Doe?", though.
And certainly other ways, so let´s wait for more comments, since English is really vast. Whereas my memory isn´t!