It is looking up class attendance records (there are about 70) and matching them with attendance records (there are about 35).
2 answers
Put debug log. It will show the error and usage of limits.Avoid using SOQL or DML inside the for loop.
--
Magulan Duraipandian
www.infallibletechie.com