So long as you are awake enough to be safe and aim at the target, you can shoot a gun. Realistically, guns are designed to be used even if you aren't at your sharpest, and there is only so much you'll learn during a session. You are also active, while doing a leisurely activity (assuming here that even if it was an accredited class, it was optional).
This isn't quite like taking a biology class where you are supposed to be sharp enough to learn - or prove you grasp complex subjects. It takes more mental effort. On top of this, classroom conditions are different. Stuck in a chair, in a room often too cold/too warm, listening to someone go on about the history of trees and how they developed into the modern tree. Thrilling.