Instructions
Start the "Floo Powder" level in Year 2. Play through the level until you reach the Herbology Class building.
Open the wardrobe at the back of the room to get earmuffs. The earmuffs block out the sound of screaming mandrakes. Without the earmuffs, your character can't handle the mandrakes.
Pick up a mandrake and plant it in one of the marked pots. Plant the other two mandrakes in pots to complete the lesson.
Exit the classroom and continue down the path toward the Fountain Courtyard.
Get the earmuffs from the wardrobe on the left side of the courtyard. Grab the mandrake that's blocking the path and then plant him in the marked pot. Continue on into the Lessons Hallway.
Take the earmuffs from the wardrobe next to the Transfiguration Classroom entrance.
Pick up the screaming mandrake and approach the glass wall that's blocking the Defense Against the Dark Arts classroom. When you're close enough, the mandrake's scream will shatter the glass.
Plant the mandrake in the pot and head into the classroom to learn the Immobilus spell. Use the spell twice on each of the pixies to open the classroom's exit.