7. (10 points) In a class of 40 students all facing forward, they stand in a line from front to back, and report numbers in the order of $1, 2, 3, 4, 1, 2, 3,$
4, 1, 2, 3, 4, and so on, with each student reporting a number once. Students who report 3 turn around. Afterwards, if two adjacent students face each other, they will shake hands once and then turn around simultaneously, until no students are facing each other. How many times do all the students shake hands in the entire process? $\qquad$ times.
【Solution】Solution: According to the problem, after the student with number 3 turns around, they will face the student with number 4, and they will shake hands $40 \div 4=10$ (times);

In the second round, the student with number 4 shakes hands with the student with number 1, and they will shake hands $10-1=9$ (times);
$$
10+(9+8+7+6+5+4+3+2+1) \times 3=145 \text { (times) }
$$

Answer: In the entire process, all the students in the class shook hands a total of 145 times.