I went away for 40 days last year, on my return the immigration officer asked basic questions in thai (name, school name etc) and why I left during classes.
I presented the immigration officer with the “letter of absence” which I got from school. Stating my reason for leaving country during classes and that I will be taking online lessons.
Very reluctantly they allowed me in.
While issuing the letter my school messaged me this
You may deny to enter Thailand.
1) If you cannot speak Thai.
2) If you leave the country many times, or longer than 2 weeks.