Sec. 31. (a) If a student is suspended from school or from any educational function under this chapter, the student's absence from school because of the suspension is not a violation of:
(1) IC 20-33-2; or
(2) any other statute relating to compulsory school attendance.
(b) If a student is expelled from school or from any educational function under this chapter, the student's absence from school because of the expulsion is a violation of IC 20-33-2 or any other statute relating to compulsory school attendance if the student may enroll in:
(1) an alternative education program in the county or in a county immediately adjacent to the county containing the school corporation from which the student was expelled; or
(2) a virtual charter school;
during the student's expulsion. In the event an alternative education program or virtual charter school is not available for a student to attend under this subsection, the student's expulsion is not a violation of IC 20-33-2 or any other statute relating to compulsory school attendance.