At least McLaggen seemed sufficiently deterred, having earned enough detention to take his mind off Hermione, so she was able to finally do what she had intended to do when Slughorn had first invited her.