
It's not surprising she snapped. She's just had major surgery & is in discomfort, if not pain. It doesn't sound as if you've had her very long, so she's no reason to trust you or your family fully yet. Children should also be taught that when a dog is asleep or in its own territory/basket etc. it should be left alone, especially if the dog is off colour. I wouldn't attempt training class at least until she's had her stitches out. If you are fully committed to this dog, there is plenty you can do to help her gain confidence at home. Doing some basic obedience will help her, if it's done by being firm but very kind & giving her plenty of rewards & praise when she does something right. If she poohed in the hall, she was probably desperate - obviously spaying makes it hurt when she "goes" and she probably put it off until she had to.
It will take time and patience, but if you can put yourself in her place & try to work out why she's doing things, you'll find it easier to train her out of bad habits. When you take on a rescue dog, you have to accept that you have a "grown up" puppy & need to start at the beginning with its training. Sh'e only 2 yrs old, so it shouldn't be too dificult, but harder than with an 8 wk old pup. Once she's recovered from her spaying, do find a good training class.