Here is the generated query:

```sql
SELECT 
       student_exercises.* FROM student_exercises 
INNER JOIN 
      student_assignments ON student_assignments.id = student_exercises.student_assignment_id 
INNER JOIN
      students ON students.id = student_assignments.student_id 
INNER JOIN 
      users ON users.id = students.user_id 
INNER JOIN
      student_assignments student_assignments_student_exercises_join ON student_assignments_student_exercises_join.id = student_exercises.student_assignment_id 
INNER JOIN students students_student_exercises_join ON students_student_exercises_join.id = student_assignments_student_exercises_join.student_id 
INNER JOIN consents ON consents.consentable_id = students_student_exercises_join.id AND consents.consentable_type = 'Student' 
WHERE student_exercises.assignment_exercise_id = 11 AND consents.did_consent = 't' 
ORDER BY students.has_dropped, students.is_auditing, lower(users.last_name)
```

Note the redundant joins.