Ah, I see what you mean.  I have been struggling to do the following to no avail:
1. Try to keep the consent logic out of student_exercises
2. Keep the query optimal

Seems like a tough call :)