7. In a certain exam, the passing score is 65 points. The overall average score of the class is 66 points, and the average score of all students who passed is 71 points, while the average score of all students who failed is 56 points. To reduce the number of failing students, the teacher adds 5 points to each student's score. After the score adjustment, the average score of all students who passed becomes 75 points, and the average score of all students who failed becomes 59 points. It is known that the number of students in the class is between 15 and 30. Therefore, the class has $\qquad$ students.
7. 24 .

Let the class have $n$ students. If before the bonus points, $x$ students passed the exam, then
$$
71 x+56(n-x)=66 n \Rightarrow x=\frac{2 n}{3},
$$

which means $n$ is a multiple of 3.
Let $y$ be the number of students who passed after the bonus points. Then
$$
75 y+59(n-y)=71 n \Rightarrow y=\frac{3 n}{4},
$$

which means $n$ is a multiple of 4.
In summary, $n$ is a multiple of 12.
Since $15<n<30$, therefore, $n=24$.