a is a question about fundamentals. Everyone pretty much needs to get this one correct. If you don't it means you don't know the subject matter.
b is a question to test what you have been taught. If you were paying attention and studying you should get most of the marks. It will still be difficult though and there's potential to lose marks.
c is a harder question. The students that are advanced in the subject will be able to tackle it. You might be able to get full marks in some of the c questions but probably not them all. In most you will be able to get some marks for effort shown.
Is the relevant law available on https://www.gesetze-im-internet.de/ ?
I'm not your lawyer, so this is just my 2 cents. If you're specifically asking for legal help, please consult a lawyer on your behalf so you can discuss the details.
I think you might have an overly broad conception of the duties of a teacher towards students. They should protect them from harm, so laying an actual trap (or just not warning about a potential danger) so that a student gets hurt would be in violation of the teacher's duty. But giving your students a test to make sure they're actually studying is such a common (and common-sense) expression of distrust that I'd be surprised if it were illegal to not expect good faith from their students.
Relevant: §2 LehrErzVDBest https://www.gesetze-im-internet.de/lehrerzvdbest_1/DDNR00019... (Former GDR law that was kept in force after reunification. Not sure whether the part about not doing damage to the socialist society is still part of current law.)
From what I read from the reference in your comment, that law applies to the part which forms the former gdr in germany.
According to that website (run by two official ministries) the law is current and your comment about that part surprises me as well.
Whoops, sorry. I used to wonder why people make the elementary mistake of not noticing they're talking to a different person. Now I know: it's because the "threads" view shows the replies to your own comments, but not the comment you originally replied to. So there's not enough context to notice that the usernames are different.
He is dealing with kids or young persons and he is purposely creating distress when the goal was to educate.
Even if it is not good for students to cheat, the way he dealt with that will have probably ruined a few students lives. Think about that...
And also take into account that him and the institution have created the conditions leading to these students cheating. If you have empathy you can easily guess that it is possible that some of the caught students were not 'bad persons' but just did it because they had the opportunity and on the other side a lot of pressure (future depending on the success of this exam, family poverty, violent family pressure to not fail).
It would have been better to do this thing as an educational move / warning to show the concerned students that there is a risk cheating.
And also using measures to avoid cheating in the first place: taking phones, not letting students go to toilets in middle (this is common) etc...
The purpose might be legitimate, but if you can remember your student years, you can imagine the stress that could incur the fact to suddenly encounter a question that they have no way to be able te reply.
Imagine a student that was well prepared for the exam, and suddenly there is a question he is supposed to be able to reply as it is in the exam but in no way related to what he prepared. Some stressed students could suddenly feel insecure and wonder what they did badly during their revision.
Also, it is like the police creating an illegal situation to catch someone. Would have the students attempted to cheat if there was not a question that made no sense to them?
As the article indicate itself, more students than usual went to the bathroom for this exam...
It is like a cop coming to you and saying "do you want free drug?", you reply ok and then he arrests you for drug possession charge...