My University professor copied parts of my assignment for the sample solution. Should he have credited me? So I just saw this and found it kind of funny, a bit weird, I guess flattering and wondered if he should have at least asked me or gave me some credit and is he allowed to do this as the professor? !
I got a 100/100 in this 2000 words assignment for his course and today I decided to see the essay-like solution he posted for everyone to see, and there are complete paragraphs exactly the same as mine, even the commas. I didn't rediscover anything with this assignment, the topic is not new, but the expressions, the writing and the ideas are all mine.
Anyway I am not gonna say anything to him but I did laugh at the thought that if I ever use my answer again in a similar topic imagine if then I am accused of plagiarism from myself and/or him :)
(btw English is not my first language sorry for any mistakes)
Yes, this is both flattering and weird. I would call it unprofessional and tacky.
He should have thanked you for the nice answer and asked your permission to post parts of it.
Whether you should have public credit for that work may depend on policies at your school and on how you and the instructor think about the impact of such an announcement on other students.
Do stick with this:

Anyway I am not gonna say anything to him but I did laugh at the
thought that if I ever use my answer again in a similar topic imagine
if then I am accused of plagiarism from myself and/or him :)