Shunpei knew that finishing his homework will surprise An and make her feel proud of him. Also, with his homework done, he would spend more time with An, not concentrating on the homework. The birthday gift was the icing on the cake. But I don't think he expected An's reaction.
Just look at her face!!!



In that moment, she has her guard totally down, showing how much Shunpei's gesture means to her. If you listen closely, you can even hear the sound of wedding bells...
Thank you for the translation!