Yes. Hindi is like latin languages such as French or Italian in this respect. In contrast to English, possessive pronouns bear the gender of what or whom is "possessed", not the person who possesses.
There are even languages like German where it bears both genders :-) sein/seine/ihr/ihre.
In certain tenses (simple past tense, perfective tenses), transitive verbs (verbs which can admit direct objects) conjugate with their object(s) rather than the subject.
In such sentences, ने is attached to the subject to indicate that the verb is not conjugating with it.
नानी ने गाना गाया था - 'Grandmother had sung a song'. Verbs are masculine because गाना is masculine.
नानी ने ठुमरी गायी थी - Grandmother had sung a thumri (a type of song in Indian classical music)'. Verbs are feminine because ठुमरी is feminine.
नानी ने गाने गाये थे - 'Grandmother had sung songs'. Verbs are masc plural because गाने is masc plural.
नानी ने ठुमरियाँ गायी थीं -'Grandmother had sung thumris'. Verbs are fem plural because ठुमरियाँ is fem plural.
If a transitive verb is used without any objects in a particular sentence, then it is conjugated as masculine singular. So, 'Grandmother had sung' is नानी ने गाया था
I think that "His grandmother would sing" is also a correct translation. Even though "would" is more commonly used for conditionals and future in the past, "would" can also express a habit in the past as a synonym of "used to". But maybe it is not accepted in order to avoid any confusion in a lesson about tenses?