Program which turns power on/offf
For sensors, I'd look at passive infrared (PIR) detectors first.  Those are triggered by warm objects like human bodies moving around.  You probably need a few per classroom to cover different angles and differnt movement planes.  A false positive is better than a false negative.

These things produce a analog or digital signal.  These signals can be measured easily enough by a microcontroller.  The microcontroller collects all the signals, in the case of analog decides whether each one is indicating motion, computes a aggregate yes/no motion value, performs some time lengthening on motion detected, and then produces a single digital output for the lights to be on or off.  To turn the lights on and off from a digital output, I'd use a plain old relay.  The relay can be driven from the digital output via a transistor.  The output of the relay then acts just like the wall switch to turn the lights on or off.

I mentioned only briefly that the micro should time-extend the motion signal to make the lights on/off signal.  This is important to keep the lights from turning off frequently when everyone is still for brief periods of time.  I'd probably keep the lights on for 3-5 minutes after the last motion was detected.