I feel that the part "shaking hands with one another" is restrictive, thus requiring no comma. -- I think that either can be right and that it is the author's choice to slightly emphasize the moving freely around the room, which is always a problem with students (who are usually shy). I feel the comma before the word "before" is placed to allow a breathing space and think we would normally use no comma if it weren't long like the one above.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.