This is exactly what I did at my school, as we didn't have any monitors at all. It worked really well, provided you were able to identify the IP address of each Pi without powering it on.
As ghp has said, the best solution for this is to register the MAC addresses of the Pis in the router, and that way you can reflash SD cards and also take them all out, upgrade them, and put them back in again and don't have to worry about matching up the cards to individual Pis.
There was, however, one difference in your setup compared to the one I did, that you may want to consider. Having a class of 20 Pis all connected over WiFi to the same router is fine, but when they all run VNC at the same time things may not be so fine. It really depends on the type router, the network, the location of the router compared to the classroom, etc.
Obviously, SSH would solve this immediately, but is a lot harder for a class to use. I wouldn't recommend going down this method.
However, one of the most underappreciated programs for the Pi (in my opinion) is Adafruit's WebIDE
. It's a web interface that allows you to write Python (or other languages) code easily, and run them on the Pi. I've used it with a class before, and got excellent results. By default all the code is stored on BitBucket, but this can be easily changed so it's stored either on GitHub, or on the Pi. See the Advanced Options section
for more info on this.
Only last thing to add is that as the Pis are headless, the likelihood that they'll be shutdown properly is decreased compared to having a monitor (people forget to shut them down using the WebIDE, and then the plug is pulled on them while they're still on). This can cause the SD cards to become corrupted, and while this is very very rare these days (and well done to the Pi Team for reducing this significantly), it's very very very
useful to have a few extra SD cards with the software flashed on them that you can just swap in and use instead.
Good luck, and if you need any help or want more details from someone who's done what you're trying to do, I'll be happy to help.