This was your first class? If that is the case, the building, new people and new dogs alone are enough distraction even for a trained dog. Distraction takes time to work up to and should not be added (at least, not on purpose) until the exercises are solid.
There are three D’s to dog training: duration, distraction and distance. All teaching begins with duration, what the behavior looks like and how to do it. Then you build on duration. For example, the stay. Stay starts with one second and builds slowly to several minutes, but one second at a time and if the dog fails at three seconds, we go back to two seconds and we don't move forward until it is easy for the dog. This builds a strong foundation for stay. You want to build duration with every exercise you teach your dog. This will prepare her to remain engaged when faced with distractions. Just like humans, we start easy and build on that knowledge, whether school or work or a hobby. With dogs, we often expect them to go from kindergarten to high school in one six-week class. Inch by inch it’s a cinch, yard by yard it’s hard – for both you and your dog.
Once you have duration and this is easy for her in your regular training place, you add distraction at home, maybe with toys or food and then by practicing in all kinds of places. But, you start easy. Let's say your dog has a perfect three minute sit-stay in your house with distractions and now you want to practice outside of the house, say at a PetSmart. You might have to start in the parking lot, asking for a few seconds, then build that behavior until you have duration in the parking lot. Then maybe you move to the sidewalk in front of the PetSmart. Again, you start with little duration and build on this. Then, you might make it into the lobby...then the store...then the store in front of the parakeets. It all depends on the dog, of course.