Post traumatic stress disorder (PTSD) is very commonly found in people who have experienced a severely traumatic event. This is commonly seen in war veterans as a result of traumatic events. Examples include seeing a family member die, or being a part of a terrible accident.
The brain often cannot recognize it as something that actually happened, so it stops the sufferer from functioning as a normal person in society, and sufferers often have to have special care.
Sofia could talk to teachers. She could go back up and rework projects to get points she missed, she could ask for extra credit assignments, she should ask her teachers the best way. A lot of times they'll have secret ways to help struggling students.