I'd suggest that your quality of sleep may have had something to do with it, but you said that you fell asleep right away.
I would say that it could just be in the bedding down process and that you just need to make yourself get up.
A pre sleep routine might help your brain wind down before sleep, homework might not be the best thing to be doing right before you go to sleep. I turn most of my lights out and read a book before i go to sleep.
Light is one of the brains triggers to say it needs to be awake. I find by turning out lights and dimming them it seems help my brain start to wind down. I guess it's telling my brain its getting close to time to go to bed.