"Are you a middle school student?"
I also put あなたは中学生ですか and had it marked wrong.
I find it very frustrating that the Japanese course is much less flexible than the other language courses I am taking in the range of different answers it accepts.
This means that even though I know the answers to all of the questions (I lived in Japan for several years, and am really just doing this course for fun), I find myself using the flashcards rather than just free typing most of the time, because the course is likely to reject many of my answers even though they are actually correct.
I know that the courses can't feasibly be programmed to accept every single possible answer for every single question, but I do find the Japanese course to be particularly limited and inflexible, and it would be great to see some improvements in this area.
中学校の学生です is a grammatically correct sentence, but it doesn't sound very natural. That would be like saying "a student of a middle school" instead of "a middle school student" - sure, you could say it that way, but why would you?
With 日本語生です, I assume you want to say "I am a Japanese student" (i.e. someone who is studying the Japanese language). You could say 日本語の学生です, but it might be better to just say 日本語を勉強しています ("I am studying Japanese").
In the UK, secondary school often includes both 中学校 and 高校, i.e. we don't divide it into two different schools like they do in Japan. I don't know how it is in Hong Kong, but maybe Duo rejected secondary school in your answer because a 高校生 is also a secondary school student?