We all have bad days.
You recognized your stressor, made better choices after that and still plugged away. Congrats! Thats the way we do it
The point is to keep going, not fall off completely because of a bad day here or there. You handled it very well and you know how to prevent it on future school days. Here's to a fresh start tomorrow!