Moodiness, anger, and lack of focus can be depression and/or anxiety. It's worth talking to a psychiatrist about and determining if there is more going on here, and then the two of you can determine the best treatment options for you. It sounds like your mind is wondering, or pre-occupied and it needs to be determined why? Normally this is depression and/or anxiety but only a professional can tell you for sure. The fact that you feel so good when exercising goes along with this as well. Many people have "test stress" and cannot do well on tests, but you mention other problems as well. Make yourself an appt. and get working on this so you can get your life back. Good luck and take care.
Are you nervous about the tests? Are you sleeping enough? Do you have a big course load? In my opinion, there can be many causes for lack of focus.