When i was isolated i had killer productively however that turned to shit when i had friends around.
I found it really good to do hw during free periods (because i thought it was dead time) so when i got home i could do my own study routine and not worry about teachers hassling me for not doing...