Technically, Hermione did attend her classes. She showed up early to turn in her homework and to ask about the work for that day. She met resistance at first, naturally, but she reasoned that she was unable to practice any spells regardless and she was already fulfilling the theoretical requirements.