7. The teacher checked the work of three students - Alekseev, Vasiliev, and Sergeev, but did not take their papers with him. He told the students: “All of you have completed the work, and you received different grades (‘3’, ‘4’, ‘5’). Sergeev did not get a ‘5’, Vasiliev did not get a ‘4’, and I think Alekseev got a ‘4’. It turned out later that the teacher correctly named the grade for only one of the students. What grade did each of the students receive?
7. Since it is not clear which of the statements is true in this problem, we need to consider three cases.

Case 1. Let's assume the teacher told the truth to Sergeyev. Then, based on the problem's conditions, we will fill in the table. "Sergeyev did not get a '5'." We will put a '-' in the corresponding cell. "Vasilyev did not get a '4'" - this statement is false. Therefore, Vasilyev received a '4'. We will put a '+' in the corresponding cell. "Alexeev got a '4'" - this statement is false. Therefore, Alexeev did not get a '4'. We will put a '-' in the corresponding cell.

|  | A | C | B |
| :---: | :---: | :---: | :---: |
| 3 |  |  |  |
| 4 | - |  | + |
| 5 |  | - |  |

Since Vasilyev received a '4', he could not have received a '3' or '5', and Sergeyev could not have received a '4'. We will reflect this in the table.

|  | A | C | B |
| :---: | :---: | :---: | :---: |
| 3 |  |  | - |
| 4 | - | - | + |
| 5 |  | - | - |

Analyzing the table allows us to conclude that Sergeyev received a '3', and Alexeev received a '5'.

|  | A | C | B |
| :---: | :---: | :---: | :---: |
| 3 | - | + | - |
| 4 | - | - | + |
| 5 | + | - | - |

Case 2. Let's assume the teacher told the truth to Vasilyev, and named the wrong grade to the other two students. Then, based on the conditions, we will fill in the table. Vasilyev did not get a '4'. We will put a '-' in the corresponding cell. Sergeyev did not get a '5' - this is a false statement. Therefore, Sergeyev received a '5'. We will put a '+' in the corresponding cell. Alexeev got a '4' - this is a false statement. Therefore, Alexeev did not get a '4'. We will put a '-' in the corresponding cell.

|  | A | C | B |
| :---: | :---: | :---: | :---: |
| 3 |  |  |  |
| 4 | - |  | - |
| 5 |  | + |  |

Since Sergeyev received a '5', he could not have received a '4' or '3'. We will reflect this in the table.

|  | A | C | B |
| :---: | :---: | :---: | :---: |
| 3 |  | - |  |
| 4 | - | - | - |
| 5 | - | + | - |

From the table, it is clear that no one received a '4'. This contradicts the problem's conditions. Therefore, our assumption was incorrect.

Case 3. Let's consider the assumption that the third part of the answer is true, namely: "Alexeev received a '4' and the first two statements are false: 'Sergeyev did not get a '5', Vasilyev did not get a '4'." We will fill in the table based on these conditions:

|  | A | C | B |
| ---: | ---: | ---: | ---: |
| 3 |  |  |  |
| 4 | + |  | + |
| 5 |  | + |  |

We see that two students received a '4' simultaneously, which contradicts the conditions. Therefore, this assumption is incorrect.

Answer: Alexeev received a '5', Sergeyev - '3', Vasilyev - '4'.