"Is this your Chinese teacher?"
Good observation: in the English sentence, "Is this your Chinese teacher?" the word "Chinese" could refer either to nationality or to language, that is, either to a teacher (of any subject) who is Chinese, or to a teacher (of any nationality) who teaches the Chinese language.
However, this Chinese sentence, 这是你的汉语老师吗, does not share that ambiguity, as 汉语 refers to the Chinese language only, rather than to the nation; the 语 part indicates "language."
I don't know if it is "wrong," but it sounds funny. There is no need for 的 here. Also, you are using the old style of writing, which is used in Taiwan, but not Mainland China.
On reflection, the original answer (by Duolingo) is a bit rude. Shouldn't it be 他是你的中文老师吗？A person is not an it.
I know you have 2 crowns in Japanese and 4 in Russian, and therefore are somewhat used to languages that are highly declined, but PLEASE don't put the genitive marker places that it doesn't have to go. Mandarin is AGGLUTINATIVE. That means you don't have to stick 的/の/-ος/-ы everywhere if it's obvious that two words should stick together as one unit.
When referring to a school subject, we tend to use 语文 instead of 汉语。Though it's a bit complicated. Basically 语文 covers both language, literature, historical, and political education, with an early focus on language that morphs into literature as children progress through the school system, with a healthy dose of nationalist history and politics sprinkled in at all ages.
So I guess if you hear it from a Chinese person talking about a course he/she took in China, it's 语文。If it's about a language course for L2 speakers, though, it probably means 中文/汉语/华语/普通话。