Both are grammatically correct, but it depends on the situation which one would be appropriate.
Generally speaking, we use the plural with everything except one, and no counts as not one.
No students were present.
There are, however, two exceptions. The first is if there could only possibly be one or zero. For example, when talking about the moon, we use the singular:
There was no moon last night.
So, if there were a university committee which normally had one student representative, it would be OK to say
There was no student [representative] present
The second is when we want to be emphatic: we can use the singular to emphasize that there was not one single.... So, if the teacher was disappointed to find that no student turned up, he or she could say
Not one single student was present
No student was present
Here is an idiomatic expression that is a good example of the use of the singular for emphasis:
to leave no stone unturned
Here is an example using almost the same phrasing as the question:
While no student was allowed to leave the schoolhouse, representatives of the press and other news media, on invitation of the school authorities, were permitted to enter the classrooms to observe the proceedings. We the Students: Supreme Court Cases for and About Students - James B Raskin, 2008