"...เนื้อความที่เขียนมาไม่ตรงตามหัวข้อที่ให้มาก็จริง..."

It is a pity to fail this student's essay on technical ground (not addressing the given problem). But any teacher must do it (on technical ground). With compassion, the student should be given the reason.

In real life, one cannot always make excuses for failure to meet given targets. One must learn to focus and work on targets --not excuses-- as best as one can in one's situation.