If the sentence has a "the" article, you are supposed to use "the" in the translation. A time where you would not use "the" is when you have the article "degli/della/del/dello" because "di" can be used as a possessive, but can also be used to mean "some" or an unmentioned quantity. i.e. "Degli uomini parlano al ragazzo." can mean "Men speak to the boy." with an unspecified and unquantified number of men, or it can mean "Some men speak to the boy." with an quantified amount of men, though it has specified that there is a limited amount of men. How it is translated is personal taste and the differences are only semantics, but the bottom line is that if you see "gli" you write the translation with "the" and if you see "degli" then as long as it is not being used as a possessive, then it is safe to leave it out of the translation.
This is how I understand it, if I am wrong, please correct me.
The inconsistent use of articles really bothers me. Sometimes they are deemed absolutely necessary, even if the answer sounds a little odd. Other times you can just skip them. Please Duolingo, make it consistent. Either you have to use the article all the time or you don't.
That is correct. Gli is used in plural cases with masculine nouns that take lo or l' in singular case.