Caroline Fisher is the teacher of Scout. She forces Scout to tell her dad to stop teaching her at home. She patted Scout on the hand with a ruler because she thought Scout kept on answering back.
It could be both, maybe they hurt themselves because they want to call some attention or it could also be their way to feel better with themselves