"Which one has a hat?"
Translation:Lequel a un chapeau ?
No, it is markdown code (a subset of the official markdown). See https://translations.duolingo.com/comment/337193#comment-2254175
I'm sorry but in the link that you have posted here "lequel" is used as an object in every single example (when used as an interrogative pronoun), and text of this article doesn't deal with the issue whether it can or cannot be a subject at all.
Maybe you had wanted to post here some other link, and accidentally posted this one?
As with the examples I already gave, you can see that "lequel" can be a subject.
- lequel/laquelle a un chapeau ?
- lequel/laquelle est à toi ?
- lesquels/lesquelles portent un chapeau ?
You can use all of them in indirect interrogative sentences as well:
- je lui montre lequel/laquelle a un chapeau (subject).
- tu ne sais pas lesquels/lesquelles tu vas choisir (object)